This is an automated email from the ASF dual-hosted git repository. vatamane pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/couchdb-ci.git
The following commit(s) were added to refs/heads/main by this push: new 0065863 Add Debian Bookworm CI image 0065863 is described below commit 0065863d262358246503709783a0bdb37923c176 Author: Ronny Berndt <ro...@apache.org> AuthorDate: Wed Nov 1 14:33:33 2023 +0100 Add Debian Bookworm CI image and small refactorings --- bin/apt-dependencies.sh | 35 ++++++++++++++----------- build.sh | 2 +- dockerfiles/debian-bookworm | 63 +++++++++++++++++++++++++++++++++++++++++++++ pull-all-couchdbdev-docker | 16 ++++++------ 4 files changed, 92 insertions(+), 24 deletions(-) diff --git a/bin/apt-dependencies.sh b/bin/apt-dependencies.sh index a3ebccb..c5c0d9d 100755 --- a/bin/apt-dependencies.sh +++ b/bin/apt-dependencies.sh @@ -42,7 +42,7 @@ apt-get update && apt-get install --no-install-recommends -y lsb-release SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" . ${SCRIPTPATH}/detect-arch.sh >/dev/null . ${SCRIPTPATH}/detect-os.sh >/dev/null -debians='(jessie|buster)' +debians='(buster|bullseye|bookworm)' ubuntus='(bionic|focal|jammy)' echo "Detected Ubuntu/Debian version: ${VERSION_CODENAME} arch: ${ARCH}" @@ -67,18 +67,17 @@ apt-get install --no-install-recommends -y apt-transport-https curl git pkg-conf sudo wget zip unzip \ build-essential ca-certificates libcurl4-openssl-dev \ libicu-dev libnspr4-dev \ - help2man python3-sphinx \ - curl debhelper devscripts dh-exec dh-python equivs \ + help2man curl debhelper devscripts dh-exec dh-python equivs \ dialog equivs lintian libwww-perl quilt \ reprepro rsync \ vim-tiny screen procps dirmngr ssh-client # createrepo_c or createrepo, depending on packaging support -if [ ${VERSION_CODENAME} == "bullseye" ]; then +if [ "${VERSION_CODENAME}" == "bullseye" ] || [ "${VERSION_CODENAME}" == "bookworm" ]; then apt-get install --no-install-recommends -y createrepo-c || true else - # python 2 based; gone from focal / bullseye. look for createrepo_c eventually + # python 2 based; gone from focal / bullseye / bookworm. look for createrepo_c eventually # hopefully via: https://github.com/rpm-software-management/createrepo_c/issues/145 apt-get install --no-install-recommends -y createrepo || true fi @@ -94,7 +93,7 @@ rm setup_${NODEVERSION}.x if [ -z "$(which node)" ]; then apt-get purge -y nodejs || true # extracting the right version to dl is a pain :( - if [ ${ARCH} == "x86_64" ]; then + if [ "${ARCH}" == "x86_64" ]; then NODEARCH=x64 else NODEARCH=${ARCH} @@ -119,20 +118,19 @@ EOF fi # rest of python dependencies -pip3 --default-timeout=10000 install --upgrade sphinx_rtd_theme nose requests hypothesis==3.79.0 +if [ "${VERSION_CODENAME}" == "bookworm" ]; then + # On Debian bookworm, need the --break-system-package to into to default system location + pip3 --default-timeout=10000 install --break-system-packages --upgrade sphinx_rtd_theme nose requests hypothesis==3.79.0 +else + pip3 --default-timeout=10000 install --upgrade sphinx_rtd_theme nose requests hypothesis==3.79.0 +fi # relaxed lintian rules for CouchDB mkdir -p /usr/share/lintian/profiles/couchdb chmod 0755 /usr/share/lintian/profiles/couchdb if [[ ${VERSION_CODENAME} =~ ${debians} ]]; then cp ${SCRIPTPATH}/../files/debian.profile /usr/share/lintian/profiles/couchdb/main.profile - if [ ${VERSION_CODENAME} == "jessie" ]; then - # remove unknown lintian rule privacy-breach-uses-embedded-file - sed -i -e 's/, privacy-breach-uses-embedded-file//' /usr/share/lintian/profiles/couchdb/main.profile - # add rule to suppress python-script-but-no-python-dep - sed -i -e 's/Disable-Tags: /Disable-Tags: python-script-but-no-python-dep, /' /usr/share/lintian/profiles/couchdb/main.profile - fi -elif [[ ${VERSION_CODENAME} =~ ${ubuntus} ]]; then +elif [[ "${VERSION_CODENAME}" =~ ${ubuntus} ]]; then cp ${SCRIPTPATH}/../files/ubuntu.profile /usr/share/lintian/profiles/couchdb/main.profile else echo "Unrecognized Debian-like release: ${VERSION_CODENAME}! Skipping lintian work." @@ -146,7 +144,11 @@ fi # js packages, as long as we're not told to skip them if [ "$1" != "nojs" ]; then # older releases don't have libmozjs60+, and we provide 1.8.5 - if [ "${VERSION_CODENAME}" != "jammy" -a "${VERSION_CODENAME}" != "focal" -a "${VERSION_CODENAME}" != "bullseye" -a "${ARCH}" != "s390x" ]; then + if [ "${VERSION_CODENAME}" != "jammy" ] && \ + [ "${VERSION_CODENAME}" != "focal" ] && \ + [ "${VERSION_CODENAME}" != "bullseye" ] && \ + [ "${VERSION_CODENAME}" != "bookworm" ] && \ + [ "${ARCH}" != "s390x" ]; then curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1 source /etc/os-release echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" \ @@ -167,6 +169,9 @@ if [ "$1" != "nojs" ]; then if [ "${VERSION_CODENAME}" == "bullseye" ]; then apt-get install --no-install-recommends -y libmozjs-78-dev fi + if [ "${VERSION_CODENAME}" == "bookworm" ]; then + apt-get install --no-install-recommends -y libmozjs-78-dev + fi else # install js build-time dependencies only # we can't add the CouchDB repo here because the plat may not exist yet diff --git a/build.sh b/build.sh index 5c3245e..eb04906 100755 --- a/build.sh +++ b/build.sh @@ -46,7 +46,7 @@ SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # When updating the images, consider updating pull-all-couchdbdev-docker # script as well # -DEBIANS="debian-buster debian-bullseye" +DEBIANS="debian-buster debian-bullseye debian-bookworm" UBUNTUS="ubuntu-bionic ubuntu-focal ubuntu-jammy" CENTOSES="centos-7 almalinux-8 almalinux-9" XPLAT_BASE="debian-bullseye" diff --git a/dockerfiles/debian-bookworm b/dockerfiles/debian-bookworm new file mode 100644 index 0000000..fd6c82f --- /dev/null +++ b/dockerfiles/debian-bookworm @@ -0,0 +1,63 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 + +# NOTE: These are intended to be built using the arguments as +# described in ../build.sh. See that script for more details. + +ARG repository=debian + +FROM $repository:bookworm + +# Install Java +ENV JAVA_HOME=/opt/java/openjdk +COPY --from=eclipse-temurin:11 $JAVA_HOME $JAVA_HOME +ENV PATH="${JAVA_HOME}/bin:${PATH}" + +# Choose whether to install SpiderMonkey 1.8.5, default yes +ARG js=js +# Choose whether to install Erlang, default yes +ARG erlang=erlang +# Select version of Node, Erlang and Elixir +ARG erlangversion=24.3.4.14 +ARG elixirversion=v1.15.7 +ARG nodeversion=14 + +# Create Jenkins user and group +RUN groupadd --gid 910 jenkins; \ + useradd --uid 910 --gid jenkins --create-home jenkins + +# Copy couchdb-ci repo into root's home directory +ADD --chown=root:root bin /root/couchdb-ci/bin/ +ADD --chown=root:root files /root/couchdb-ci/files/ + +# Jenkins builds in /usr/src/couchdb. +RUN mkdir -p /usr/src/couchdb; \ + chown -R jenkins:jenkins /usr/src/couchdb + +# Install all dependencies, and optionally SM 1.8.5 +# This allows us to use the same Dockerfile for building SM +RUN ERLANGVERSION=$erlangversion \ + ELIXIRVERSION=$elixirversion \ + NODEVERSION=$nodeversion \ + /root/couchdb-ci/bin/install-dependencies.sh $js $erlang + +# Allow Jenkins to sudo +RUN echo "jenkins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jenkins + +USER jenkins + +# overwrite this with 'CMD []' in a dependent Dockerfile +CMD ["/bin/bash"] diff --git a/pull-all-couchdbdev-docker b/pull-all-couchdbdev-docker index 59d9076..6bb3035 100644 --- a/pull-all-couchdbdev-docker +++ b/pull-all-couchdbdev-docker @@ -5,14 +5,14 @@ DOCKER_ORG="apache" # These are the images that are currently being used, so don't `docker rmi` them on cleanup. KEEP_IMAGES=( couchdbci-debian:bullseye-erlang-25.3 -couchdbci-debian:buster-erlang-24.3.4.10 -couchdbci-debian:bullseye-erlang-24.3.4.10 -couchdbci-centos:9-erlang-24.3.4.10 -couchdbci-centos:8-erlang-24.3.4.10 -couchdbci-centos:7-erlang-24.3.4.10 -couchdbci-ubuntu:bionic-erlang-24.3.4.10 -couchdbci-ubuntu:jammy-erlang-24.3.4.10 -couchdbci-ubuntu:focal-erlang-24.3.4.10 +couchdbci-debian:buster-erlang-24.3.4.14 +couchdbci-debian:bullseye-erlang-24.3.4.14 +couchdbci-centos:9-erlang-24.3.4.14 +couchdbci-centos:8-erlang-24.3.4.14 +couchdbci-centos:7-erlang-24.3.4.14 +couchdbci-ubuntu:bionic-erlang-24.3.4.14 +couchdbci-ubuntu:jammy-erlang-24.3.4.14 +couchdbci-ubuntu:focal-erlang-24.3.4.14 ) for image in ${KEEP_IMAGES[*]}