-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Move Complement test matrix jobs definition to match Sytest and Trial. #14153
Move Complement test matrix jobs definition to match Sytest and Trial. #14153
Conversation
…ate_jobs.py Keep the set of workers defined as-is. Use string concatenation to form the string to not be messy. Perhaps alphabetize later? Make sure to accommodate monolith mode and database types.
While there, make use of env to reduce an obnoxiously long commandline and do a little housecleaning.
SYNAPSE_WORKER_TYPES is now passed through, so don't need that. Don't need to set it as an empty string if not running with workers, as that's done earlier. Add a little extra logging at the top to make sure it actually makes it all way through.
@@ -140,7 +140,7 @@ if [[ -n "$WORKERS" ]]; then | |||
export PASS_SYNAPSE_COMPLEMENT_USE_WORKERS=true | |||
|
|||
# Pass through the workers defined. If none, it will be an empty string | |||
export PASS_SYNAPSE_WORKER_TYPES="$SYNAPSE_WORKER_TYPES" | |||
export PASS_SYNAPSE_WORKER_TYPES="$WORKER_TYPES" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way it matches with the variables being declared on the commandline and environment at the same time. Standardization is good, redundancy is bad.
…ent.sh. Restore original condition, then hide it behind an empty string condition. Add a bit of logging so you know it's working.
As part of this, I was looking at the part of Synapse that parses the configuration for workers and does some sanity checking before setting up the worker for operation. It looks like the things that are capable of being sharded,
need to be added to their special maps rather there are more than one or not. This could be a left-over relic of not being migrated to generic workers app.
So basically, don't need to set send_federation(or start_pushers) at all any more if you are setting the worker instance into it's special map. I guess should mark those as deprecated but backward compatible? I'll be testing this out shortly. -Edit: Moving this thought/question into a separate PR |
Please sanity check me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one, and I don't fully understand the motivation here.
Firstly: we moved the sytest and trial job definitions to a python script because we wanted to run a limited subset of them on PRs, but the full set on develop and release branches. We haven't made a similar change yet for complement (and this change doesn't seem to do so).
Secondly: I expect changing the complement configuration to spawn more individual workers is going to make it slower for complement tests to run. It's already the longest CI job as it is---I'm not sure if we can afford this. (At least, not on every PR.)
Thirdly: this PR is tricky to review. It changes two things at once: moving the matrix definition; then adding new jobs to that matrix. It's sometimes okay to change multiple things in one PR, but if so it's best to keep the commit history is a sequence of independent, self-contained changes---that's not the case here.
(One can clean up commit history after the fact using an interactive rebase---but we ask that contributers don't do this after requesting review, as it conflicts with Github's review tools.)
I've left some thoughts, but I think it would be best to proceed by breaking this up into smaller PRs.
@@ -323,7 +323,8 @@ COMPLEMENT_DIR=../complement ./scripts-dev/complement.sh -run TestImportHistoric | |||
The above will run a monolithic (single-process) Synapse with SQLite as the database. For other configurations, try: | |||
|
|||
- Passing `POSTGRES=1` as an environment variable to use the Postgres database instead. | |||
- Passing `WORKERS=1` as an environment variable to use a workerised setup instead. This option implies the use of Postgres. | |||
- Passing `WORKERS=1` as an environment variable to use a set of workers that mirrors what is used in Sytest. This option implies the use of Postgres. | |||
- If setting `WORKERS=1`, optionally set `WORKER_TYPES=` to declare which worker types you wish to test. A simple comma-delimited string containing the worker types defined from the template in [here](https://github.com/matrix-org/synapse/blob/develop/docker/configure_workers_and_start.py). A safe example would be `WORKER_TYPES="federation_inbound,federation_sender,synchrotron,"`. See the [worker documentation](https://matrix-org.github.io/synapse/latest/workers.html) for additional information on workers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't want to have a trailing comma after synchrotron
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, that's right it needs to not be there.
set -o pipefail | ||
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | synapse/.ci/scripts/gotestfmt | ||
|
||
back-compat: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't this be included under the complement
job above as part of the matrix?
It's also not clear what this is testing backwards compatibility with?
This was one of my first trys at a PR and I've learned a lot since then. For some reason, the commits history is including a completely different PR in the history, which didn't get documented here. This WAS two separate PR's. #14202
That is completely fair and is something I didn't know. Now I know how to look up old PR's correctly(for instance I found the one you speak of in #13713 ).
This PR wasn't supposed to spawn more workers than is currently used. I didn't know it would blend the commit history with another PR just by adding a
This is absolutely true and in hind-sight a good idea. I'm thinking I'll break the backwards-compatibility mode into a PR first, so individual workers can be tested as an override. Then the second PR for moving the matrix definition to the
I probably won't ever use that, as I didn't know it existed until now 😁
Thanks for the time, I completely agree. This got way messier than it was supposed to. |
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.(run the linters)
In preparation for Faster joins, and further worker mode development, let's move configuration of the test options to the same place as Sytest and Trial and avoid configuration fragmentation.
Currently, the list of workers used by Complement for testing is defined in
start_for_complement.sh
which is the entrypoint for that docker image. I propose to locate this list incalculate_jobs.py
instead. At this time, this is a drop-in replacement for existing code, no workers are removed or added.Created a backwards compatibility mode for running complement.sh on the command-line so existing functionality is preserved. Using
WORKERS=1
and not settingWORKER_TYPES
to anything still uses the values originally defined in start_for_complement.shSigned-off-by: Jason Little realtyem@gmail.com