This repository has been archived by the owner on Nov 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 676
Complement QoL changes #2663
Merged
Merged
Complement QoL changes #2663
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
86a19d0
Add option to specify keySize when generating keys
S7evinK 2968aa6
Update Complement dockerfiles to use buildkit and exec for the process
S7evinK d1062e5
Use larger keySize when running tests
S7evinK 025f552
Merge branch 'main' into s7evink/complement
S7evinK dbd402c
Enable BuildKit when building complement images
S7evinK 76748ae
Merge branch 's7evink/complement' of github.com:matrix-org/dendrite i…
S7evinK 35098a5
Merge branch 'main' of github.com:matrix-org/dendrite into s7evink/co…
S7evinK 35fd077
Use larger key size to avoid handshake errors
S7evinK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#syntax=docker/dockerfile:1.2 | ||
|
||
FROM golang:1.18-stretch as build | ||
RUN apt-get update && apt-get install -y postgresql | ||
WORKDIR /build | ||
|
@@ -26,14 +28,12 @@ RUN mkdir /dendrite | |
|
||
# Utilise Docker caching when downloading dependencies, this stops us needlessly | ||
# downloading dependencies every time. | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN go mod download | ||
|
||
COPY . . | ||
RUN go build -o /dendrite ./cmd/dendrite-monolith-server | ||
RUN go build -o /dendrite ./cmd/generate-keys | ||
RUN go build -o /dendrite ./cmd/generate-config | ||
RUN --mount=target=. \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
go build -o /dendrite ./cmd/generate-config && \ | ||
go build -o /dendrite ./cmd/generate-keys && \ | ||
go build -o /dendrite ./cmd/dendrite-monolith-server | ||
|
||
WORKDIR /dendrite | ||
RUN ./generate-keys --private-key matrix_key.pem | ||
|
@@ -45,10 +45,10 @@ EXPOSE 8008 8448 | |
|
||
# At runtime, generate TLS cert based on the CA now mounted at /ca | ||
# At runtime, replace the SERVER_NAME with what we are told | ||
CMD /build/run_postgres.sh && ./generate-keys --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key && \ | ||
CMD /build/run_postgres.sh && ./generate-keys --keysize 64 --server $SERVER_NAME --tls-cert server.crt --tls-key server.key --tls-authority-cert /complement/ca/ca.crt --tls-authority-key /complement/ca/ca.key && \ | ||
./generate-config -server $SERVER_NAME --ci > dendrite.yaml && \ | ||
# Replace the connection string with a single postgres DB, using user/db = 'postgres' and no password, bump max_conns | ||
sed -i "s%connection_string:.*$%connection_string: postgresql://postgres@localhost/postgres?sslmode=disable%g" dendrite.yaml && \ | ||
sed -i 's/max_open_conns:.*$/max_open_conns: 100/g' dendrite.yaml && \ | ||
cp /complement/ca/ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates && \ | ||
./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0} | ||
exec ./dendrite-monolith-server --really-enable-open-registration --tls-cert server.crt --tls-key server.key --config dendrite.yaml -api=${API:-0} | ||
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.
Yes! Especially with Synapse, matrix-org/synapse#13204 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. Looks like Synapse is already PID 1 inside the container and receives the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What difference does this make in practice?
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.
Seeming 5m 49s on this PR, vs 7m 5s on the last
main
run.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.
For Postgres it's almost 5m faster (8m 19s vs 12m 49s)