From 9de9cadb3433d7a2a3473baa430f1f99fdfb6959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 29 Sep 2022 12:05:41 +0200 Subject: [PATCH 01/15] enable build for Debian/Bullseye --- packaging/build-deb.sh | 2 +- packaging/docker-build/Dockerfile-debian | 63 +++++++++++++++++++ .../{Dockerfile => Dockerfile-ubuntu} | 0 packaging/docker-build/docker-compose.yml | 16 ++++- packaging/docker-build/docker-entrypoint.sh | 1 + 5 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 packaging/docker-build/Dockerfile-debian rename packaging/docker-build/{Dockerfile => Dockerfile-ubuntu} (100%) diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index f32fe148d..0b7e0e85c 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -3,7 +3,7 @@ set -e case $1 in - ""|bionic|buster|focal) + ""|bionic|buster|focal|bullseye) suites=("${1:-bionic}") ;; all) diff --git a/packaging/docker-build/Dockerfile-debian b/packaging/docker-build/Dockerfile-debian new file mode 100644 index 000000000..73fe48f32 --- /dev/null +++ b/packaging/docker-build/Dockerfile-debian @@ -0,0 +1,63 @@ +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG EXTRA_PACKAGES="python-dev python-pip" +ARG BUILD_IMAGE=ubuntu:18.04 +FROM ${BUILD_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive +ARG BUILD_IMAGE +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# use a common app path, copied from python-onbuild:latest +ENV WORKDIR /usr/src/app +RUN mkdir -p ${WORKDIR} +WORKDIR ${WORKDIR} +ENV PIP_DEFAULT_TIMEOUT 100 +RUN echo "Acquire::http::Pipeline-Depth 0;" >> /etc/apt/apt.conf + +# add a repo that contains a backport of dh-virtualenv 1.1 for focal, bionic +RUN apt-get update && \ + apt-get install -y software-properties-common + +# install dependencies +RUN apt-get update \ + && apt-get install -y \ + libffi-dev \ + libssl-dev \ + debhelper \ + gcc \ + dh-python \ + dh-virtualenv \ + python3-all \ + python3-all-dev \ + python3-dev \ + python3-pip \ + python3-setuptools \ + python3-venv \ + python3-wheel \ + build-essential \ + cmake \ + devscripts \ + equivs \ + libevent-dev \ + zlib1g-dev \ + libssl-dev \ + $EXTRA_PACKAGES + +RUN pip3 install greenlet +RUN pip3 install gevent + +# Add entrypoint script +COPY packaging/docker-build/docker-entrypoint.sh ${WORKDIR} +ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"] diff --git a/packaging/docker-build/Dockerfile b/packaging/docker-build/Dockerfile-ubuntu similarity index 100% rename from packaging/docker-build/Dockerfile rename to packaging/docker-build/Dockerfile-ubuntu diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 074978ec0..0bdc4e898 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -18,7 +18,7 @@ services: cassandra-medusa-builder-focal: build: context: ../.. - dockerfile: packaging/docker-build/Dockerfile + dockerfile: packaging/docker-build/Dockerfile-ubuntu args: - BUILD_IMAGE=ubuntu:20.04 - EXTRA_PACKAGES="" @@ -29,7 +29,7 @@ services: cassandra-medusa-builder-bionic: build: context: ../.. - dockerfile: packaging/docker-build/Dockerfile + dockerfile: packaging/docker-build/Dockerfile-ubuntu args: - BUILD_IMAGE=ubuntu:18.04 volumes: @@ -39,13 +39,23 @@ services: cassandra-medusa-builder-buster: build: context: ../.. - dockerfile: packaging/docker-build/Dockerfile + dockerfile: packaging/docker-build/Dockerfile-debian args: - BUILD_IMAGE=debian:buster volumes: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts + cassandra-medusa-builder-bullseye: + build: + context: ../.. + dockerfile: packaging/docker-build/Dockerfile-debian + args: + - BUILD_IMAGE=debian:bullseye + volumes: + - ../..:/usr/src/app/cassandra-medusa + - ../../packages:/usr/src/app/packages + - ./scripts:/usr/src/app/scripts release: build: context: ../.. diff --git a/packaging/docker-build/docker-entrypoint.sh b/packaging/docker-build/docker-entrypoint.sh index d5a5dc694..4cd30cd60 100755 --- a/packaging/docker-build/docker-entrypoint.sh +++ b/packaging/docker-build/docker-entrypoint.sh @@ -21,6 +21,7 @@ export SSH2_LIBS_SUFFIX # copy built packages into a mounted volume cd ${WORKDIR}/cassandra-medusa +mk-build-deps --install --tool "apt-get -y --no-install-recommends" debian/control dpkg-buildpackage -us -uc -b mv ../*.deb ${WORKDIR}/packages cd ${WORKDIR} From 956a4bdeda783dd0431e0d0ad975ceb945683403 Mon Sep 17 00:00:00 2001 From: Alexander Dejanovski Date: Thu, 23 Feb 2023 14:21:28 +0100 Subject: [PATCH 02/15] Add CI for building bullseye deb images --- .github/workflows/ci.yml | 8 ++++++-- packaging/build-deb.sh | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be8b66a49..8e92524a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,10 +55,12 @@ jobs: # Build debian packages strategy: matrix: - suite: [focal] + suite: [focal, bullseye] include: - suite: focal os-version: ubuntu-20.04 + - suite: bullseye + os-version: ubuntu-22.04 fail-fast: false runs-on: ${{ matrix.os-version }} steps: @@ -429,10 +431,12 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' strategy: matrix: - suite: [focal] + suite: [focal, bionic] include: - suite: focal os-version: ubuntu-20.04 + - suite: bionic + os-version: ubuntu-18.04 fail-fast: false runs-on: ${{ matrix.os-version }} steps: diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index 0b7e0e85c..e02edd12f 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -7,10 +7,10 @@ case $1 in suites=("${1:-bionic}") ;; all) - suites=(focal bionic buster) + suites=(focal bionic buster bullseye) ;; *) - echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster'" + echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster', 'focal', 'bullseye'" exit 1 ;; esac From ab947403d7c508d7e4a1f4c24a0a1fe235f0dfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 29 Sep 2022 12:05:41 +0200 Subject: [PATCH 03/15] enable build for Debian/Bullseye --- debian/rules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 6ff2e05c9..efa405cb0 100755 --- a/debian/rules +++ b/debian/rules @@ -30,8 +30,9 @@ export DH_VIRTUALENV_INSTALL_ROOT = /usr/share override_dh_virtualenv: dh_virtualenv \ - --python /usr/bin/python3 --preinstall=setuptools==40.3.0 --preinstall=pip==21.3.1 --preinstall=wheel --builtin-venv \ - --preinstall=poetry==1.6.1 --preinstall=dh-poetry==0.2.0 --pip-tool=dh-poetry + --extra-pip-arg "--no-cache-dir" \ + --python /usr/bin/python3 --preinstall=setuptools==52.0.0 --preinstall=pip==21.3.1 --preinstall=wheel --builtin-venv \ + --preinstall=poetry==1.6.1 --preinstall=dh-poetry==0.2.0 --pip-tool=dh-poetry override_dh_strip: dh_strip --no-automatic-dbgsym -X libssh2 -X libssh -X libgssapi_krb5 -X libcrypto -X libkrb5 -X libk5crypto From 38f194c319a8a11c09929b11c47c6bf1de72ce52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Sat, 21 Sep 2024 10:12:59 +0200 Subject: [PATCH 04/15] allow cross-platform build for linux/amd64 --- packaging/docker-build/docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 0bdc4e898..2ba13352d 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version: '2.1' +version: '2.10' services: cassandra-medusa-builder-focal: @@ -48,6 +48,8 @@ services: - ./scripts:/usr/src/app/scripts cassandra-medusa-builder-bullseye: build: + platforms: + - linux/amd64 context: ../.. dockerfile: packaging/docker-build/Dockerfile-debian args: From 18d517bd039b7079f54a3fa8a4363b6cee2040a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Sat, 21 Sep 2024 10:14:04 +0200 Subject: [PATCH 05/15] add build for debian-bookworm --- debian/rules | 2 +- packaging/build-deb.sh | 6 +- packaging/docker-build/Dockerfile-debian-12 | 62 +++++++++++++++++++++ packaging/docker-build/docker-compose.yml | 12 ++++ 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 packaging/docker-build/Dockerfile-debian-12 diff --git a/debian/rules b/debian/rules index efa405cb0..87d08141b 100755 --- a/debian/rules +++ b/debian/rules @@ -31,7 +31,7 @@ export DH_VIRTUALENV_INSTALL_ROOT = /usr/share override_dh_virtualenv: dh_virtualenv \ --extra-pip-arg "--no-cache-dir" \ - --python /usr/bin/python3 --preinstall=setuptools==52.0.0 --preinstall=pip==21.3.1 --preinstall=wheel --builtin-venv \ + --python /usr/bin/python3 --preinstall=setuptools==52.0.0 --preinstall=pip --preinstall=wheel --builtin-venv \ --preinstall=poetry==1.6.1 --preinstall=dh-poetry==0.2.0 --pip-tool=dh-poetry override_dh_strip: diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index e02edd12f..a7c711130 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -3,14 +3,14 @@ set -e case $1 in - ""|bionic|buster|focal|bullseye) + ""|bionic|buster|focal|bullseye|bookworm) suites=("${1:-bionic}") ;; all) - suites=(focal bionic buster bullseye) + suites=(focal bionic buster bullseye bookworm) ;; *) - echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster', 'focal', 'bullseye'" + echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster', 'focal', 'bullseye', 'bookworm'" exit 1 ;; esac diff --git a/packaging/docker-build/Dockerfile-debian-12 b/packaging/docker-build/Dockerfile-debian-12 new file mode 100644 index 000000000..3a5bbc598 --- /dev/null +++ b/packaging/docker-build/Dockerfile-debian-12 @@ -0,0 +1,62 @@ +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG EXTRA_PACKAGES="python-dev python-pip" +ARG BUILD_IMAGE=ubuntu:18.04 +FROM ${BUILD_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive +ARG BUILD_IMAGE +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# use a common app path, copied from python-onbuild:latest +ENV WORKDIR /usr/src/app +RUN mkdir -p ${WORKDIR} +WORKDIR ${WORKDIR} +ENV PIP_DEFAULT_TIMEOUT 100 +RUN echo "Acquire::http::Pipeline-Depth 0;" >> /etc/apt/apt.conf + +# add a repo that contains a backport of dh-virtualenv 1.1 for focal, bionic +RUN apt-get update && \ + apt-get install -y software-properties-common + +# install dependencies +RUN apt-get update \ + && apt-get install -y \ + libffi-dev \ + libssl-dev \ + debhelper \ + gcc \ + dh-python \ + dh-virtualenv \ + python3-all \ + python3-all-dev \ + python3-dev \ + python3-pip \ + python3-setuptools \ + python3-venv \ + python3-wheel \ + python3-greenlet \ + python3-gevent \ + build-essential \ + cmake \ + devscripts \ + equivs \ + libevent-dev \ + zlib1g-dev \ + libssl-dev \ + $EXTRA_PACKAGES + +# Add entrypoint script +COPY packaging/docker-build/docker-entrypoint.sh ${WORKDIR} +ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"] diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 2ba13352d..7c3529031 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -58,6 +58,18 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts + cassandra-medusa-builder-bookworm: + build: + platforms: + - linux/amd64 + context: ../.. + dockerfile: packaging/docker-build/Dockerfile-debian-12 + args: + - BUILD_IMAGE=debian:bookworm + volumes: + - ../..:/usr/src/app/cassandra-medusa + - ../../packages:/usr/src/app/packages + - ./scripts:/usr/src/app/scripts release: build: context: ../.. From 6fddd1dffec90f3f0ca7462b51f391a0ada23578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Wed, 2 Oct 2024 17:06:16 +0200 Subject: [PATCH 06/15] remove build support for buster --- packaging/build-deb.sh | 6 +++--- packaging/docker-build/docker-compose.yml | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index a7c711130..e7cc92336 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -3,14 +3,14 @@ set -e case $1 in - ""|bionic|buster|focal|bullseye|bookworm) + ""|bionic|focal|bullseye|bookworm) suites=("${1:-bionic}") ;; all) - suites=(focal bionic buster bullseye bookworm) + suites=(focal bionic bullseye bookworm) ;; *) - echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster', 'focal', 'bullseye', 'bookworm'" + echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'focal', 'bullseye', 'bookworm'" exit 1 ;; esac diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 7c3529031..9376fa071 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -36,16 +36,6 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts - cassandra-medusa-builder-buster: - build: - context: ../.. - dockerfile: packaging/docker-build/Dockerfile-debian - args: - - BUILD_IMAGE=debian:buster - volumes: - - ../..:/usr/src/app/cassandra-medusa - - ../../packages:/usr/src/app/packages - - ./scripts:/usr/src/app/scripts cassandra-medusa-builder-bullseye: build: platforms: From 8f71e47bb398983917d49442cb8bdda65a280434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Wed, 2 Oct 2024 17:22:00 +0200 Subject: [PATCH 07/15] rename dockerfile --- .../docker-build/{Dockerfile-debian => Dockerfile-debian-11} | 0 packaging/docker-build/docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packaging/docker-build/{Dockerfile-debian => Dockerfile-debian-11} (100%) diff --git a/packaging/docker-build/Dockerfile-debian b/packaging/docker-build/Dockerfile-debian-11 similarity index 100% rename from packaging/docker-build/Dockerfile-debian rename to packaging/docker-build/Dockerfile-debian-11 diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 9376fa071..39ca4239e 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -41,7 +41,7 @@ services: platforms: - linux/amd64 context: ../.. - dockerfile: packaging/docker-build/Dockerfile-debian + dockerfile: packaging/docker-build/Dockerfile-debian-11 args: - BUILD_IMAGE=debian:bullseye volumes: From 2eeb3d9189d3531033c4a360c2b5e3cea0bd5759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 13:44:27 +0200 Subject: [PATCH 08/15] remove build support for bionic --- packaging/build-deb.sh | 6 +++--- packaging/docker-build/docker-compose.yml | 12 ++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/packaging/build-deb.sh b/packaging/build-deb.sh index e7cc92336..dcacad319 100755 --- a/packaging/build-deb.sh +++ b/packaging/build-deb.sh @@ -3,14 +3,14 @@ set -e case $1 in - ""|bionic|focal|bullseye|bookworm) + ""|focal|bullseye|bookworm) suites=("${1:-bionic}") ;; all) - suites=(focal bionic bullseye bookworm) + suites=(focal bullseye bookworm) ;; *) - echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'focal', 'bullseye', 'bookworm'" + echo "Unknown distribution suite - allowed values: 'all', 'focal', 'bullseye', 'bookworm'" exit 1 ;; esac diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 39ca4239e..91b0af5b2 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -17,6 +17,8 @@ version: '2.10' services: cassandra-medusa-builder-focal: build: + platforms: + - linux/amd64 context: ../.. dockerfile: packaging/docker-build/Dockerfile-ubuntu args: @@ -26,16 +28,6 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts - cassandra-medusa-builder-bionic: - build: - context: ../.. - dockerfile: packaging/docker-build/Dockerfile-ubuntu - args: - - BUILD_IMAGE=ubuntu:18.04 - volumes: - - ../..:/usr/src/app/cassandra-medusa - - ../../packages:/usr/src/app/packages - - ./scripts:/usr/src/app/scripts cassandra-medusa-builder-bullseye: build: platforms: From 262be19e55221ce5ad3f60417dba59e11787dfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 15:49:19 +0200 Subject: [PATCH 09/15] add tester for bookworm --- .../docker-build/Dockerfile-debian-12-tester | 36 +++++++++++++++++++ packaging/docker-build/docker-compose.yml | 12 +++++-- .../docker-build/docker-entrypoint-test.sh | 23 ++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 packaging/docker-build/Dockerfile-debian-12-tester create mode 100755 packaging/docker-build/docker-entrypoint-test.sh diff --git a/packaging/docker-build/Dockerfile-debian-12-tester b/packaging/docker-build/Dockerfile-debian-12-tester new file mode 100644 index 000000000..8b8c39953 --- /dev/null +++ b/packaging/docker-build/Dockerfile-debian-12-tester @@ -0,0 +1,36 @@ +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#ARG EXTRA_PACKAGES="python-dev python-pip" +ARG BUILD_IMAGE=ubuntu:18.04 +FROM ${BUILD_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive +ARG BUILD_IMAGE +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# use a common app path, copied from python-onbuild:latest +ENV WORKDIR /usr/src/app +RUN mkdir -p ${WORKDIR} +WORKDIR ${WORKDIR} + +# # install dependencies +RUN apt-get update \ + && apt-get install -y \ + python3 \ + python3-venv \ + $EXTRA_PACKAGES + +# Add entrypoint script +COPY packaging/docker-build/docker-entrypoint-test.sh ${WORKDIR} +ENTRYPOINT ["/usr/src/app/docker-entrypoint-test.sh"] diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 91b0af5b2..ee2a84f70 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -version: '2.10' - services: cassandra-medusa-builder-focal: build: @@ -52,6 +50,16 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts + cassandra-medusa-tester-bookworm: + build: + platforms: + - linux/amd64 + context: ../.. + dockerfile: packaging/docker-build/Dockerfile-debian-12-tester + args: + - BUILD_IMAGE=debian:bookworm + volumes: + - ../../packages:/usr/src/app/packages release: build: context: ../.. diff --git a/packaging/docker-build/docker-entrypoint-test.sh b/packaging/docker-build/docker-entrypoint-test.sh new file mode 100755 index 000000000..a7528368d --- /dev/null +++ b/packaging/docker-build/docker-entrypoint-test.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +export SSH2_LIBS_SUFFIX + +export PACKAGE=${WORKDIR}/packages/$1 +echo $PACKAGE +dpkg -i $PACKAGE +medusa From cd677cf66f017e1c636a9e833a7f89e3cb25280a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 15:57:09 +0200 Subject: [PATCH 10/15] add tester for bullseye --- .../docker-build/Dockerfile-debian-11-tester | 36 +++++++++++++++++++ packaging/docker-build/docker-compose.yml | 10 ++++++ 2 files changed, 46 insertions(+) create mode 100644 packaging/docker-build/Dockerfile-debian-11-tester diff --git a/packaging/docker-build/Dockerfile-debian-11-tester b/packaging/docker-build/Dockerfile-debian-11-tester new file mode 100644 index 000000000..8b8c39953 --- /dev/null +++ b/packaging/docker-build/Dockerfile-debian-11-tester @@ -0,0 +1,36 @@ +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#ARG EXTRA_PACKAGES="python-dev python-pip" +ARG BUILD_IMAGE=ubuntu:18.04 +FROM ${BUILD_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive +ARG BUILD_IMAGE +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# use a common app path, copied from python-onbuild:latest +ENV WORKDIR /usr/src/app +RUN mkdir -p ${WORKDIR} +WORKDIR ${WORKDIR} + +# # install dependencies +RUN apt-get update \ + && apt-get install -y \ + python3 \ + python3-venv \ + $EXTRA_PACKAGES + +# Add entrypoint script +COPY packaging/docker-build/docker-entrypoint-test.sh ${WORKDIR} +ENTRYPOINT ["/usr/src/app/docker-entrypoint-test.sh"] diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index ee2a84f70..3bfc64cd9 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -38,6 +38,16 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts + cassandra-medusa-tester-bullseye: + build: + platforms: + - linux/amd64 + context: ../.. + dockerfile: packaging/docker-build/Dockerfile-debian-11-tester + args: + - BUILD_IMAGE=debian:bullseye + volumes: + - ../../packages:/usr/src/app/packages cassandra-medusa-builder-bookworm: build: platforms: From 13aadc63652c3ea2efcc72052b1af563670d195e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 15:59:18 +0200 Subject: [PATCH 11/15] add tester for focal --- .../docker-build/Dockerfile-ubuntu-tester | 36 +++++++++++++++++++ packaging/docker-build/docker-compose.yml | 10 ++++++ 2 files changed, 46 insertions(+) create mode 100644 packaging/docker-build/Dockerfile-ubuntu-tester diff --git a/packaging/docker-build/Dockerfile-ubuntu-tester b/packaging/docker-build/Dockerfile-ubuntu-tester new file mode 100644 index 000000000..7d2ecbfdd --- /dev/null +++ b/packaging/docker-build/Dockerfile-ubuntu-tester @@ -0,0 +1,36 @@ +# Copyright 2019 The Last Pickle Ltd +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG EXTRA_PACKAGES="python-dev python-pip" +ARG BUILD_IMAGE=ubuntu:18.04 +FROM ${BUILD_IMAGE} + +ARG DEBIAN_FRONTEND=noninteractive +ARG BUILD_IMAGE +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# use a common app path, copied from python-onbuild:latest +ENV WORKDIR /usr/src/app +RUN mkdir -p ${WORKDIR} +WORKDIR ${WORKDIR} + +# install dependencies +RUN apt-get update \ + && apt-get install -y \ + python3 \ + python3-venv \ + $EXTRA_PACKAGES + +# Add entrypoint script +COPY packaging/docker-build/docker-entrypoint-test.sh ${WORKDIR} +ENTRYPOINT ["/usr/src/app/docker-entrypoint-test.sh"] diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 3bfc64cd9..254c96ab6 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -26,6 +26,16 @@ services: - ../..:/usr/src/app/cassandra-medusa - ../../packages:/usr/src/app/packages - ./scripts:/usr/src/app/scripts + cassandra-medusa-tester-focal: + build: + platforms: + - linux/amd64 + context: ../.. + dockerfile: packaging/docker-build/Dockerfile-ubuntu-tester + args: + - BUILD_IMAGE=ubuntu:20.04 + volumes: + - ../../packages:/usr/src/app/packages cassandra-medusa-builder-bullseye: build: platforms: From ef0f603b520994dea7661fcde01fe41cd66f2849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 16:02:06 +0200 Subject: [PATCH 12/15] use tester container in ci --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e92524a1..cd828fe6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,12 +55,14 @@ jobs: # Build debian packages strategy: matrix: - suite: [focal, bullseye] + suite: [focal, bullseye, bookworm] include: - suite: focal os-version: ubuntu-20.04 - suite: bullseye os-version: ubuntu-22.04 + - suite: bookworm + os-version: ubuntu-22.04 fail-fast: false runs-on: ${{ matrix.os-version }} steps: @@ -90,9 +92,8 @@ jobs: - name: Install Debian Package and run Medusa run: | version=$(cat VERSION) - cd packages - sudo dpkg -i cassandra-medusa_${version}-0~${{ matrix.suite }}0_amd64.deb - medusa + docker-compose build cassandra-medusa-tester-${{ matrix.suite }} + docker-compose run cassandra-medusa-tester-${{ matrix.suite }} cassandra-medusa_${version}-0~${{ matrix.suite }}0_amd64.deb exit $? integration-tests: From e27396261622ddcdb0f0ef7f33b2efb4a9b8301f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 16:08:24 +0200 Subject: [PATCH 13/15] things are called different in different envs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd828fe6f..3a56292cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,8 +92,8 @@ jobs: - name: Install Debian Package and run Medusa run: | version=$(cat VERSION) - docker-compose build cassandra-medusa-tester-${{ matrix.suite }} - docker-compose run cassandra-medusa-tester-${{ matrix.suite }} cassandra-medusa_${version}-0~${{ matrix.suite }}0_amd64.deb + docker compose build cassandra-medusa-tester-${{ matrix.suite }} + docker compose run cassandra-medusa-tester-${{ matrix.suite }} cassandra-medusa_${version}-0~${{ matrix.suite }}0_amd64.deb exit $? integration-tests: From 43b7a3c71448b60c3c05a5ef886ae18de5eb01c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 16:15:17 +0200 Subject: [PATCH 14/15] no config file there --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a56292cf..550536d59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,7 @@ jobs: - name: Install Debian Package and run Medusa run: | version=$(cat VERSION) + cd packaging/docker-build docker compose build cassandra-medusa-tester-${{ matrix.suite }} docker compose run cassandra-medusa-tester-${{ matrix.suite }} cassandra-medusa_${version}-0~${{ matrix.suite }}0_amd64.deb exit $? From ee83764fcca134dfd298097a9b0f95a59e8bb111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tibor=20R=C3=A9p=C3=A1si?= Date: Thu, 3 Oct 2024 17:00:58 +0200 Subject: [PATCH 15/15] consolidate tester's Dockerfile --- .../docker-build/Dockerfile-debian-11-tester | 36 ------------------- .../docker-build/Dockerfile-debian-12-tester | 36 ------------------- ...erfile-ubuntu-tester => Dockerfile-tester} | 1 - packaging/docker-build/docker-compose.yml | 6 ++-- 4 files changed, 3 insertions(+), 76 deletions(-) delete mode 100644 packaging/docker-build/Dockerfile-debian-11-tester delete mode 100644 packaging/docker-build/Dockerfile-debian-12-tester rename packaging/docker-build/{Dockerfile-ubuntu-tester => Dockerfile-tester} (96%) diff --git a/packaging/docker-build/Dockerfile-debian-11-tester b/packaging/docker-build/Dockerfile-debian-11-tester deleted file mode 100644 index 8b8c39953..000000000 --- a/packaging/docker-build/Dockerfile-debian-11-tester +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2019 The Last Pickle Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#ARG EXTRA_PACKAGES="python-dev python-pip" -ARG BUILD_IMAGE=ubuntu:18.04 -FROM ${BUILD_IMAGE} - -ARG DEBIAN_FRONTEND=noninteractive -ARG BUILD_IMAGE -ENV TZ=Europe/Paris -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -# use a common app path, copied from python-onbuild:latest -ENV WORKDIR /usr/src/app -RUN mkdir -p ${WORKDIR} -WORKDIR ${WORKDIR} - -# # install dependencies -RUN apt-get update \ - && apt-get install -y \ - python3 \ - python3-venv \ - $EXTRA_PACKAGES - -# Add entrypoint script -COPY packaging/docker-build/docker-entrypoint-test.sh ${WORKDIR} -ENTRYPOINT ["/usr/src/app/docker-entrypoint-test.sh"] diff --git a/packaging/docker-build/Dockerfile-debian-12-tester b/packaging/docker-build/Dockerfile-debian-12-tester deleted file mode 100644 index 8b8c39953..000000000 --- a/packaging/docker-build/Dockerfile-debian-12-tester +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2019 The Last Pickle Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#ARG EXTRA_PACKAGES="python-dev python-pip" -ARG BUILD_IMAGE=ubuntu:18.04 -FROM ${BUILD_IMAGE} - -ARG DEBIAN_FRONTEND=noninteractive -ARG BUILD_IMAGE -ENV TZ=Europe/Paris -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -# use a common app path, copied from python-onbuild:latest -ENV WORKDIR /usr/src/app -RUN mkdir -p ${WORKDIR} -WORKDIR ${WORKDIR} - -# # install dependencies -RUN apt-get update \ - && apt-get install -y \ - python3 \ - python3-venv \ - $EXTRA_PACKAGES - -# Add entrypoint script -COPY packaging/docker-build/docker-entrypoint-test.sh ${WORKDIR} -ENTRYPOINT ["/usr/src/app/docker-entrypoint-test.sh"] diff --git a/packaging/docker-build/Dockerfile-ubuntu-tester b/packaging/docker-build/Dockerfile-tester similarity index 96% rename from packaging/docker-build/Dockerfile-ubuntu-tester rename to packaging/docker-build/Dockerfile-tester index 7d2ecbfdd..688cfcbd8 100644 --- a/packaging/docker-build/Dockerfile-ubuntu-tester +++ b/packaging/docker-build/Dockerfile-tester @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -ARG EXTRA_PACKAGES="python-dev python-pip" ARG BUILD_IMAGE=ubuntu:18.04 FROM ${BUILD_IMAGE} diff --git a/packaging/docker-build/docker-compose.yml b/packaging/docker-build/docker-compose.yml index 254c96ab6..6e9337634 100644 --- a/packaging/docker-build/docker-compose.yml +++ b/packaging/docker-build/docker-compose.yml @@ -31,7 +31,7 @@ services: platforms: - linux/amd64 context: ../.. - dockerfile: packaging/docker-build/Dockerfile-ubuntu-tester + dockerfile: packaging/docker-build/Dockerfile-tester args: - BUILD_IMAGE=ubuntu:20.04 volumes: @@ -53,7 +53,7 @@ services: platforms: - linux/amd64 context: ../.. - dockerfile: packaging/docker-build/Dockerfile-debian-11-tester + dockerfile: packaging/docker-build/Dockerfile-tester args: - BUILD_IMAGE=debian:bullseye volumes: @@ -75,7 +75,7 @@ services: platforms: - linux/amd64 context: ../.. - dockerfile: packaging/docker-build/Dockerfile-debian-12-tester + dockerfile: packaging/docker-build/Dockerfile-tester args: - BUILD_IMAGE=debian:bookworm volumes: