From a77b67eecd6fb754aabbc2f9f3ebde35799e0595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 28 Jan 2024 12:09:47 +0100 Subject: [PATCH 1/6] integration-testing: Migrate to Compose V2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compose V1 was deprecated in January 2023 and is not supported anymore since July 2023 Signed-off-by: Kévin Commaille --- testing/matrix-sdk-integration-testing/README.md | 12 ++++++------ .../assets/docker-compose.yml | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/README.md b/testing/matrix-sdk-integration-testing/README.md index a1233f2bd..07754f652 100644 --- a/testing/matrix-sdk-integration-testing/README.md +++ b/testing/matrix-sdk-integration-testing/README.md @@ -3,11 +3,11 @@ ## Requirements This requires a synapse backend with a ci patched configuration. You can easily get -it up and running with `docker-compose` via: +it up and running with `docker compose` via: ```sh -docker-compose -f assets/docker-compose.yml up -d -docker-compose -f assets/docker-compose.yml logs --tail 100 -f +docker compose -f assets/docker-compose.yml up -d +docker compose -f assets/docker-compose.yml logs --tail 100 -f ``` **Patches** @@ -20,13 +20,13 @@ The integration tests can be run with `cargo test` or `cargo nextest run`. The integration tests expect the environment variables `HOMESERVER_URL` to be the HTTP URL to access the synapse server and `HOMESERVER_DOMAIN` to be set to the domain configured in -that server. If you are using the provided `docker-compose`, the default will be fine. +that server. If you are using the provided `docker-compose.yml`, the default will be fine. ## Maintenance -To drop the database of your docker-compose run: +To drop the database of your docker compose run: ```bash -docker-compose -f assets/docker-compose.yml stop +docker compose -f assets/docker-compose.yml stop rm -rf ./assets/data ``` diff --git a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml index 81a630ace..e75f6a8a5 100644 --- a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml +++ b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3' - services: synapse: From 1e74be2b2d4cf295918fe34ad06578694e5ccb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 28 Jan 2024 12:10:57 +0100 Subject: [PATCH 2/6] integration-testing: Remove links in docker-compose.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not supported by podman and is not necessary by defaut Signed-off-by: Kévin Commaille --- testing/matrix-sdk-integration-testing/README.md | 2 ++ .../matrix-sdk-integration-testing/assets/docker-compose.yml | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/README.md b/testing/matrix-sdk-integration-testing/README.md index 07754f652..d0b452295 100644 --- a/testing/matrix-sdk-integration-testing/README.md +++ b/testing/matrix-sdk-integration-testing/README.md @@ -10,6 +10,8 @@ docker compose -f assets/docker-compose.yml up -d docker compose -f assets/docker-compose.yml logs --tail 100 -f ``` +Note that this works also with `podman compose`. + **Patches** You can see the patches we do to configuration (namely activate registration and resetting rate limits), check out what `assets/ci-start.sh` changes. diff --git a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml index e75f6a8a5..f6eb7e686 100644 --- a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml +++ b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml @@ -29,9 +29,6 @@ services: depends_on: postgres: condition: service_healthy - links: - - synapse - - postgres environment: SYNCV3_SERVER: http://synapse:8008 SYNCV3_SECRET: SUPER_SECRET From 411dd292444988d21287706a647ddd9608713e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 28 Jan 2024 12:15:25 +0100 Subject: [PATCH 3/6] integration-testing: Use volumes in docker-compose.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Podman running unprivileged containers by default, using system folders can result in permission issues inside the containers. Signed-off-by: Kévin Commaille --- testing/matrix-sdk-integration-testing/README.md | 2 +- .../assets/docker-compose.yml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/README.md b/testing/matrix-sdk-integration-testing/README.md index d0b452295..066cfbb5d 100644 --- a/testing/matrix-sdk-integration-testing/README.md +++ b/testing/matrix-sdk-integration-testing/README.md @@ -30,5 +30,5 @@ To drop the database of your docker compose run: ```bash docker compose -f assets/docker-compose.yml stop -rm -rf ./assets/data +docker volume rm assets_db assets_synapse ``` diff --git a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml index f6eb7e686..57f8d75a4 100644 --- a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml +++ b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml @@ -6,7 +6,7 @@ services: healthcheck: disable: true volumes: - - ./data/synapse:/data + - synapse:/data ports: - 8228:8008/tcp @@ -22,7 +22,7 @@ services: timeout: 5s retries: 5 volumes: - - ./data/db:/var/lib/postgresql/data + - db:/var/lib/postgresql/data sliding-sync-proxy: image: ghcr.io/matrix-org/sliding-sync:v0.99.11 @@ -36,3 +36,7 @@ services: SYNCV3_DB: "user=postgres password=postgres dbname=syncv3 sslmode=disable host=postgres" ports: - 8338:8338 + +volumes: + synapse: + db: \ No newline at end of file From 3ade16a07d0564910da6806abd69185abcbf1c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 28 Jan 2024 17:49:21 +0100 Subject: [PATCH 4/6] integration-testing: Add newline at end of docker-compose.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../matrix-sdk-integration-testing/assets/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml index 57f8d75a4..4dd73cac6 100644 --- a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml +++ b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml @@ -39,4 +39,4 @@ services: volumes: synapse: - db: \ No newline at end of file + db: From 25b2b191bbf7837162f830f7cbbc1e254dbe0a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 29 Jan 2024 11:48:58 +0100 Subject: [PATCH 5/6] integration-testing: Make sliding-sync proxy depend on synapse in docker compose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- testing/matrix-sdk-integration-testing/assets/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml index 4dd73cac6..4600d68ec 100644 --- a/testing/matrix-sdk-integration-testing/assets/docker-compose.yml +++ b/testing/matrix-sdk-integration-testing/assets/docker-compose.yml @@ -27,6 +27,7 @@ services: sliding-sync-proxy: image: ghcr.io/matrix-org/sliding-sync:v0.99.11 depends_on: + synapse: postgres: condition: service_healthy environment: From cd90265eab61676efe23f7a22440818f054eeab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 29 Jan 2024 11:50:33 +0100 Subject: [PATCH 6/6] integration-testing: Update command to clean up docker compose data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- testing/matrix-sdk-integration-testing/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/README.md b/testing/matrix-sdk-integration-testing/README.md index 066cfbb5d..8a03072ce 100644 --- a/testing/matrix-sdk-integration-testing/README.md +++ b/testing/matrix-sdk-integration-testing/README.md @@ -29,6 +29,5 @@ that server. If you are using the provided `docker-compose.yml`, the default wil To drop the database of your docker compose run: ```bash -docker compose -f assets/docker-compose.yml stop -docker volume rm assets_db assets_synapse +docker compose -f assets/docker-compose.yml down --volumes ```