This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complement: init postgres DB directly inside the target image
Doing so in the base postgres image doesn't work with buildah because changes in a declared VOLUME in the Dockerfile is supposed to be discarded, cf https://docs.docker.com/engine/reference/builder/#volume Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
- Loading branch information
Mathieu Velten
committed
Sep 15, 2022
1 parent
c737744
commit 1e1e90e
Showing
4 changed files
with
44 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
complement tests: put postgres data folder on an host path on /tmp that we bindmount, outside of the container storage that can be quite slow. |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
complement: init postgres DB directly inside the target image instead of the base postgres image to fix building using Buildah. |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#! /bin/bash -eu | ||
# This script is designed for developers who want to test their code | ||
# against Complement. | ||
# | ||
# It creates a Complement-ready worker-enabled Synapse docker image from | ||
# the local checkout and runs Complement tests against it. | ||
# | ||
# This script assumes that it is located in the scripts-dev folder of a | ||
# Synapse checkout, and that Complement exists at ../../complement | ||
# In my case, I have /home/user/code/complement and /home/user/code/synapse. | ||
COMPLEMENT_DIR="/home/user/code/complement" | ||
|
||
cd "$(dirname $0)/.." | ||
|
||
# Build the Synapse image from the local checkout | ||
podman build -t matrixdotorg/synapse:latest -f docker/Dockerfile . | ||
|
||
# Build the base Synapse worker image | ||
podman build -t matrixdotorg/synapse:workers -f docker/Dockerfile-workers . | ||
|
||
cd "$COMPLEMENT_DIR" | ||
|
||
# Build the Complement Synapse worker image | ||
podman build -t matrixdotorg/complement-synapse:workers -f dockerfiles/SynapseWorkers.Dockerfile dockerfiles | ||
|
||
# Run the tests on the resulting image! | ||
#COMPLEMENT_CA=true COMPLEMENT_VERSION_CHECK_ITERATIONS=700 COMPLEMENT_DEBUG=1 COMPLEMENT_BASE_IMAGE=matrixdotorg/complement-synapse:workers go test -v -count=1 -tags="synapse_blacklist" -failfast ./tests | ||
#COMPLEMENT_VERSION_CHECK_ITERATIONS=100 COMPLEMENT_DEBUG=1 COMPLEMENT_BASE_IMAGE=complement-synapse go test -v -count=1 -parallel=1 ./tests/ | ||
|
||
COMPLEMENT_CA=true COMPLEMENT_VERSION_CHECK_ITERATIONS=700 COMPLEMENT_DEBUG=1 COMPLEMENT_BASE_IMAGE=matrixdotorg/complement-synapse:workers go test -v -count=1 -run "^TestOutboundFederationSend$" -tags="synapse_blacklist" ./tests | ||
|
||
# -run "^TestOutboundFederationSend$" | ||
|