Skip to content

Commit

Permalink
Fix Synapse docker builds again. (#1339)
Browse files Browse the repository at this point in the history
By only using the --break-system-packages on the versions
which support it.
  • Loading branch information
David Robertson authored Mar 17, 2023
1 parent 3ec41b7 commit cdac5a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -25,8 +29,6 @@ jobs:
tag: buster
- base_image: debian:testing
tag: testing
- base_image: debian:bookworm
tag: bookworm
steps:
- name: Set up QEMU
id: QEMU
Expand Down Expand Up @@ -74,11 +76,9 @@ jobs:
- sytest_image_tag: testing
dockerfile: synapse
tags: "matrixdotorg/sytest-synapse:testing"
build_args: "SYTEST_IMAGE_TAG=testing"
- sytest_image_tag: bookworm
dockerfile: synapse
tags: "matrixdotorg/sytest-synapse:bookworm"
# Note: at the time of writing, bookworm's python3 is python 3.11.
build_args: |
SYTEST_IMAGE_TAG=testing
SYSTEM_PIP_INSTALL_SUFFIX=--break-system-packages
steps:
- name: Set up QEMU
Expand Down
5 changes: 3 additions & 2 deletions docker/synapse.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand Down

0 comments on commit cdac5a1

Please sign in to comment.