Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable build for Debian/Bullseye+Bookworm #529

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ jobs:
# Build debian packages
strategy:
matrix:
suite: [focal]
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:
Expand Down Expand Up @@ -88,9 +92,9 @@ 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
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 $?

integration-tests:
Expand Down Expand Up @@ -429,10 +433,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:
Expand Down
5 changes: 3 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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 --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
Expand Down
6 changes: 3 additions & 3 deletions packaging/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
set -e

case $1 in
""|bionic|buster|focal)
""|focal|bullseye|bookworm)
suites=("${1:-bionic}")
;;
all)
suites=(focal bionic buster)
suites=(focal bullseye bookworm)
;;
*)
echo "Unknown distribution suite - allowed values: 'all', 'bionic', 'buster'"
echo "Unknown distribution suite - allowed values: 'all', 'focal', 'bullseye', 'bookworm'"
exit 1
;;
esac
Expand Down
63 changes: 63 additions & 0 deletions packaging/docker-build/Dockerfile-debian-11
Original file line number Diff line number Diff line change
@@ -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"]
62 changes: 62 additions & 0 deletions packaging/docker-build/Dockerfile-debian-12
Original file line number Diff line number Diff line change
@@ -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"]
35 changes: 35 additions & 0 deletions packaging/docker-build/Dockerfile-tester
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 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"]
52 changes: 43 additions & 9 deletions packaging/docker-build/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,74 @@
# See the License for the specific language governing permissions and
# limitations under the License.

version: '2.1'

services:
cassandra-medusa-builder-focal:
build:
platforms:
- linux/amd64
context: ../..
dockerfile: packaging/docker-build/Dockerfile
dockerfile: packaging/docker-build/Dockerfile-ubuntu
args:
- BUILD_IMAGE=ubuntu:20.04
- EXTRA_PACKAGES=""
volumes:
- ../..:/usr/src/app/cassandra-medusa
- ../../packages:/usr/src/app/packages
- ./scripts:/usr/src/app/scripts
cassandra-medusa-builder-bionic:
cassandra-medusa-tester-focal:
build:
platforms:
- linux/amd64
context: ../..
dockerfile: packaging/docker-build/Dockerfile
dockerfile: packaging/docker-build/Dockerfile-tester
args:
- BUILD_IMAGE=ubuntu:18.04
- BUILD_IMAGE=ubuntu:20.04
volumes:
- ../../packages:/usr/src/app/packages
cassandra-medusa-builder-bullseye:
build:
platforms:
- linux/amd64
context: ../..
dockerfile: packaging/docker-build/Dockerfile-debian-11
args:
- BUILD_IMAGE=debian:bullseye
volumes:
- ../..:/usr/src/app/cassandra-medusa
- ../../packages:/usr/src/app/packages
- ./scripts:/usr/src/app/scripts
cassandra-medusa-builder-buster:
cassandra-medusa-tester-bullseye:
build:
platforms:
- linux/amd64
context: ../..
dockerfile: packaging/docker-build/Dockerfile
dockerfile: packaging/docker-build/Dockerfile-tester
args:
- BUILD_IMAGE=debian:buster
- BUILD_IMAGE=debian:bullseye
volumes:
- ../../packages:/usr/src/app/packages
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
cassandra-medusa-tester-bookworm:
build:
platforms:
- linux/amd64
context: ../..
dockerfile: packaging/docker-build/Dockerfile-tester
args:
- BUILD_IMAGE=debian:bookworm
volumes:
- ../../packages:/usr/src/app/packages
release:
build:
context: ../..
Expand Down
23 changes: 23 additions & 0 deletions packaging/docker-build/docker-entrypoint-test.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions packaging/docker-build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Loading