From 8ae596295b7855d1e1152ad47ed55255a93d235e Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 9 Mar 2023 12:48:10 +0000 Subject: [PATCH 1/5] Fix removed build arg Screwup in 1334 --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b2846e63b..2c924bda0 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -78,6 +78,7 @@ jobs: - sytest_image_tag: bookworm dockerfile: synapse tags: "matrixdotorg/sytest-synapse:bookworm" + build_args: "SYTEST_IMAGE_TAG=bookworm" # Note: at the time of writing, bookworm's python3 is python 3.11. steps: From 64c640551dc46ad2d611aaa844237990a9adcd95 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 9 Mar 2023 13:46:26 +0000 Subject: [PATCH 2/5] Actually, remove bookworm Testing is currently the same thing as bookworm, and we never use the bookworm tag in Synapse's CI. --- .github/workflows/docker.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2c924bda0..98dd57c3c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,8 +25,6 @@ jobs: tag: buster - base_image: debian:testing tag: testing - - base_image: debian:bookworm - tag: bookworm steps: - name: Set up QEMU id: QEMU @@ -75,11 +73,6 @@ jobs: dockerfile: synapse tags: "matrixdotorg/sytest-synapse:testing" build_args: "SYTEST_IMAGE_TAG=testing" - - sytest_image_tag: bookworm - dockerfile: synapse - tags: "matrixdotorg/sytest-synapse:bookworm" - build_args: "SYTEST_IMAGE_TAG=bookworm" - # Note: at the time of writing, bookworm's python3 is python 3.11. steps: - name: Set up QEMU From bce3b8ea3cbd44e9ffeb616862d55e0143ae817f Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 9 Mar 2023 12:54:34 +0000 Subject: [PATCH 3/5] Make `--break-system-packages` optional --- docker/synapse.Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/synapse.Dockerfile b/docker/synapse.Dockerfile index 14187ea6d..fdb5673c9 100644 --- a/docker/synapse.Dockerfile +++ b/docker/synapse.Dockerfile @@ -3,6 +3,7 @@ ARG SYTEST_IMAGE_TAG=buster FROM matrixdotorg/sytest:${SYTEST_IMAGE_TAG} ARG PYTHON_VERSION=python3 +ARG SYSTEM_PIP_INSTALL_SUFFIX="" ENV DEBIAN_FRONTEND noninteractive @@ -26,8 +27,8 @@ RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-tool # For now, we need to tell Debian we don't care that we're editing the system python # installation. # Some context in https://github.com/pypa/pip/issues/11381#issuecomment-1399263627 -RUN ${PYTHON_VERSION} -m pip install -q --upgrade pip --break-system-packages -RUN ${PYTHON_VERSION} -m pip install -q --no-cache-dir poetry==1.3.2 --break-system-packages +RUN ${PYTHON_VERSION} -m pip install -q --upgrade pip ${SYSTEM_PIP_INSTALL_SUFFIX} +RUN ${PYTHON_VERSION} -m pip install -q --no-cache-dir poetry==1.3.2 ${SYSTEM_PIP_INSTALL_SUFFIX} # As part of the Docker build, we attempt to pre-install Synapse's dependencies # in the hope that it speeds up the real install of Synapse. To make this work, From 87c10e358f9400bc8716642e124a8f7686d3d16e Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 9 Mar 2023 12:54:54 +0000 Subject: [PATCH 4/5] Opt into nobbling system installation on bookworm --- .github/workflows/docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 98dd57c3c..46826a929 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -72,7 +72,9 @@ jobs: - sytest_image_tag: testing dockerfile: synapse tags: "matrixdotorg/sytest-synapse:testing" - build_args: "SYTEST_IMAGE_TAG=testing" + build_args: | + SYTEST_IMAGE_TAG=testing + SYSTEM_PIP_INSTALL_SUFFIX=--break-system-packages steps: - name: Set up QEMU From 0b830b2b07b474f9a46238303519c3168aa287c9 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 9 Mar 2023 13:05:02 +0000 Subject: [PATCH 5/5] Only build once per branch/PR --- .github/workflows/docker.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 46826a929..c4d0c1e1a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,6 +12,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-sytest-images: name: "Build sytest:${{ matrix.tag }}"