Skip to content

Commit

Permalink
Update the Synapse Worker configuration with new base image name and …
Browse files Browse the repository at this point in the history
…worker configuration (#105)

This PR updates Complement's Synapse worker-flavoured docker image in a few ways:

* Updates the base image name from `synapse:workers` to `synapse-workers`, as it's built from a separate Dockerfile from the base `matrixdotorg/synapse` image.
* Update the `SYNAPSE_WORKERS` env var name to `SYNAPSE_WORKER_TYPES`
* Switches to an explicit list of worker names. We dropped the `*` functionality after adding sharding capabilities. The worker configuration mirrors [that of sytest](https://github.com/matrix-org/sytest/blob/7d297956d6c5a177d2ea492ce6561b2e2500b291/lib/SyTest/Homeserver/Synapse.pm#L657-L1051).

These changes grew out of [this PR on Synapse](matrix-org/synapse#9162) which changed the base image.

I'd ideally like feedback from the Synapse team on the chosen worker configuration.
  • Loading branch information
anoadragon453 authored May 21, 2021
1 parent 5a7037b commit 04a2e63
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions dockerfiles/SynapseWorkers.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This dockerfile builds on top of Dockerfile-worker and includes a built-in postgres instance
# as well as sets up the homeserver so that it is ready for testing via Complement
FROM matrixdotorg/synapse:workers
FROM matrixdotorg/synapse-workers

# Download a caddy server to stand in front of nginx and terminate TLS using Complement's
# custom CA.
Expand Down Expand Up @@ -46,8 +46,21 @@ ENTRYPOINT \
SYNAPSE_REPORT_STATS=no \
# Set postgres authentication details which will be placed in the homeserver config file
POSTGRES_PASSWORD=somesecret POSTGRES_USER=postgres POSTGRES_HOST=localhost \
# Use all available worker types
SYNAPSE_WORKERS=* \
# Specify the workers to test with
SYNAPSE_WORKER_TYPES="\
event_persister, \
event_persister, \
background_worker, \
frontend_proxy, \
event_creator, \
user_dir, \
media_repository, \
federation_inbound, \
federation_reader, \
federation_sender, \
synchrotron, \
appservice, \
pusher" \
# Run the script that writes the necessary config files and starts supervisord, which in turn
# starts everything else
/configure_workers_and_start.py

0 comments on commit 04a2e63

Please sign in to comment.