-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Merge the Complement testing Docker images into a single, multi-purpose image. #12881
Changes from 10 commits
e4137c1
865fa26
edc7fcd
15215bd
97699e3
9cd96d2
3a588a0
7bc03a6
bf37bf3
facccd0
7e9884a
423e212
470fabe
b0241e7
3537762
8ae3da7
33aeb67
9f8d317
9531da6
2beae8f
bc5d529
166b046
4a739ca
1af38ef
6daac8a
6c01955
2fd415b
b548132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Merge the Complement testing Docker images into a single, multi-purpose image. |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,22 +1,48 @@ | ||||||||||||||||||||||||||
# A dockerfile which builds an image suitable for testing Synapse under | ||||||||||||||||||||||||||
# complement. | ||||||||||||||||||||||||||
# This dockerfile builds on top of 'docker/Dockerfile-worker' in matrix-org/synapse | ||||||||||||||||||||||||||
reivilibre marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
# by including a built-in postgres instance, as well as setting up the homeserver so | ||||||||||||||||||||||||||
# that it is ready for testing via Complement. | ||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||
# Instructions for building this image from those it depends on is detailed in this guide: | ||||||||||||||||||||||||||
# https://github.com/matrix-org/synapse/blob/develop/docker/README-testing.md#testing-with-postgresql-and-single-or-multi-process-synapse | ||||||||||||||||||||||||||
FROM matrixdotorg/synapse-workers | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the ability to run Complement against various versions of Synapse by changing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, thanks — I should be able to support that easily. Out of interest: Does using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure it does, at the expense of building the entire Synapse image from scratch for each version ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you're running it with the pre-builts? Yeah, that sounds like it'd be good to support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will note just in case you think it would be useful: we could revive #11852 to publish the synapse-worker images to GHCR if that would make this kind of investigation easier. |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Install postgresql | ||||||||||||||||||||||||||
RUN apt-get update && \ | ||||||||||||||||||||||||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y postgresql-13 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Configure a user and create a database for Synapse | ||||||||||||||||||||||||||
RUN pg_ctlcluster 13 main start && su postgres -c "echo \ | ||||||||||||||||||||||||||
\"ALTER USER postgres PASSWORD 'somesecret'; \ | ||||||||||||||||||||||||||
CREATE DATABASE synapse \ | ||||||||||||||||||||||||||
ENCODING 'UTF8' \ | ||||||||||||||||||||||||||
LC_COLLATE='C' \ | ||||||||||||||||||||||||||
LC_CTYPE='C' \ | ||||||||||||||||||||||||||
template=template0;\" | psql" && pg_ctlcluster 13 main stop | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Modify the shared homeserver config with postgres support, certificate setup | ||||||||||||||||||||||||||
reivilibre marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
# and the disabling of rate-limiting | ||||||||||||||||||||||||||
COPY conf/workers-shared.yaml /conf/workers/shared.yaml | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
ARG SYNAPSE_VERSION=latest | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
FROM matrixdotorg/synapse:${SYNAPSE_VERSION} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
ENV SERVER_NAME=localhost | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
COPY conf/* /conf/ | ||||||||||||||||||||||||||
WORKDIR /data | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# generate a signing key | ||||||||||||||||||||||||||
RUN generate_signing_key -o /conf/server.signing.key | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we not still need a signing key? or is that generated somewhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't something I've touched (although the overall diff will make that less than obvious) — presumably it generated a signing key before. That said, this one eluded me for a bit! It's in Lines 115 to 126 in 7f92ac4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is something you've changed... or at least, I don't understand why you're saying it's not. Anyway, if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't write that file — it was already here: |
||||||||||||||||||||||||||
COPY conf/postgres.supervisord.conf /etc/supervisor/conf.d/postgres.conf | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
WORKDIR /data | ||||||||||||||||||||||||||
# Copy the entrypoint | ||||||||||||||||||||||||||
COPY conf/start-complement-synapse-workers.sh / | ||||||||||||||||||||||||||
reivilibre marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Expose nginx's listener ports | ||||||||||||||||||||||||||
EXPOSE 8008 8448 | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
ENTRYPOINT ["/conf/start.sh"] | ||||||||||||||||||||||||||
ENTRYPOINT ["/start-complement-synapse-workers.sh"] | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# Update the healthcheck to have a shorter check interval | ||||||||||||||||||||||||||
HEALTHCHECK --start-period=5s --interval=1s --timeout=1s \ | ||||||||||||||||||||||||||
CMD curl -fSs http://localhost:8008/health || exit 1 | ||||||||||||||||||||||||||
CMD /bin/sh /healthcheck.sh | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
# TODO Ideally we should be able to pass env vars straight in via Complement | ||||||||||||||||||||||||||
# but for now we burn them in to the image. | ||||||||||||||||||||||||||
# See https://github.com/matrix-org/complement/issues/6. | ||||||||||||||||||||||||||
ARG use_workers=true | ||||||||||||||||||||||||||
ENV SYNAPSE_COMPLEMENT_USE_WORKERS $use_workers | ||||||||||||||||||||||||||
ARG database=postgres | ||||||||||||||||||||||||||
ENV SYNAPSE_COMPLEMENT_DATABASE $database | ||||||||||||||||||||||||||
reivilibre marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.