matrix-org / rust-synapse-compress-state

A tool to compress some state in a Synapse instance's database
https://pypi.org/project/synapse-auto-compressor/
Apache License 2.0
142 stars 32 forks source link

add docker files #83

Closed saces closed 2 years ago

saces commented 2 years ago

simple alpine based docker container with synapse_compress_state and synapse_auto_compressor.

Example:

docker run -it --rm -v /run/postgresql/.s.PGSQL.5432:/run/postgresql/.s.PGSQL.5432 registry.gitlab.com/mb-saces/rust-synapse-compress-state:testing synapse_auto_compressor -p "postgresql://db_user:db_password@%2Frun%2Fpostgresql/synapse" -n 100 -c 500

My work repos lives here: https://gitlab.com/mb-saces/rust-synapse-compress-state

rlywtf commented 2 years ago

@saces This Dockerfile builds the binary into a different location than is expected by this project:

This commit makes it a bit different than the existing available image here: https://hub.docker.com/r/devture/rust-synapse-compress-state. It did otherwise build properly for me on my arm64 instance! 🥳

image

I'm going to keep poking around at things to see if I can get things working on my arm64 instance. 😅 Thank you for this PR!

rlywtf commented 2 years ago

I'm going to keep poking around at things to see if I can get things working on my arm64 instance. 😅 Thank you for this PR!

I was able to adjust the final two COPY commands in this PR and then utilize a locally build arm64 docker image with the Ansible+Docker=Matrix project after overriding this variable. 🎉

COPY --from=builder /opt/src/target/debug/synapse_compress_state /synapse-compress-state COPY --from=builder /opt/src/target/debug/synapse_auto_compressor /synapse-auto-compressor

squahtx commented 2 years ago

Could a sign-off be added, as per https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off ?

rlywtf commented 2 years ago

Could a sign-off be added, as per https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off ?

I assume this question is for @saces as the submitter and not me? I'm happy to add mine if you would like it from reviewers as well. 😅

Signed-off-by: @rlywtf github@rly.wtf

squahtx commented 2 years ago

Could a sign-off be added, as per https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off ?

I assume this question is for @saces as the submitter and not me?

That was for @saces, yes.