From db6f2daec29f209195fa688c61ed447834eac94b Mon Sep 17 00:00:00 2001 From: Clemens Beck Date: Thu, 18 Jan 2024 10:20:04 +0000 Subject: [PATCH] Add Debian Bookworm images --- .gitlab/ci/definitions.yml | 2 +- .gitlab/ci/e2e.images.yml | 8 ++++---- .gitlab/ci/gitaly.images.yml | 2 +- .gitlab/ci/gitlab.images.yml | 19 +++++++++---------- Dockerfile.cache-chrome | 2 +- README.md | 2 +- scripts/install-chrome | 2 +- scripts/install-essentials | 17 +++++++++++++++-- scripts/install-ruby | 19 +++++++++++++++++++ scripts/lib/custom-docker-build | 6 +++--- 10 files changed, 55 insertions(+), 24 deletions(-) diff --git a/.gitlab/ci/definitions.yml b/.gitlab/ci/definitions.yml index 6457919..48a777f 100644 --- a/.gitlab/ci/definitions.yml +++ b/.gitlab/ci/definitions.yml @@ -70,7 +70,7 @@ parallel: matrix: - BUILD_OS: debian - OS_VERSION: bullseye + OS_VERSION: [bullseye, bookworm] NOTIFY_VERSION_UPDATE: "true" before_script: - !reference [.install-qemu, before_script] diff --git a/.gitlab/ci/e2e.images.yml b/.gitlab/ci/e2e.images.yml index 5b6a62d..97341ae 100644 --- a/.gitlab/ci/e2e.images.yml +++ b/.gitlab/ci/e2e.images.yml @@ -20,11 +20,10 @@ e2e: extends: - .e2e - variables: - OS: "debian:bullseye" parallel: matrix: - - RUBY: ['3.0', '3.1', '3.2'] + - OS: ["debian:bullseye", "debian:bookworm"] + RUBY: ['3.0', '3.1', '3.2'] BUNDLER: ['2.4', '2.5'] # Image with ruby, bundler and docker @@ -40,7 +39,8 @@ e2e-chrome: - e2e-docker parallel: matrix: - - RUBY: ['3.0', '3.1', '3.2'] + - OS: ["debian:bullseye", "debian:bookworm"] + RUBY: ['3.0', '3.1', '3.2'] BUNDLER: ['2.4', '2.5'] CHROME: ['119', '120'] diff --git a/.gitlab/ci/gitaly.images.yml b/.gitlab/ci/gitaly.images.yml index ed2cbc0..ef6c39a 100644 --- a/.gitlab/ci/gitaly.images.yml +++ b/.gitlab/ci/gitaly.images.yml @@ -17,7 +17,7 @@ gitaly: stage: gitaly parallel: matrix: - - OS: ['debian:bullseye'] + - OS: ['debian:bullseye', 'debian:bookworm'] GOLANG: ['1.19', '1.20', '1.21'] RUST: ['1.73'] GIT: ['2.36'] diff --git a/.gitlab/ci/gitlab.images.yml b/.gitlab/ci/gitlab.images.yml index f41d53b..f532de3 100644 --- a/.gitlab/ci/gitlab.images.yml +++ b/.gitlab/ci/gitlab.images.yml @@ -36,15 +36,15 @@ gitlab: YARN: '1.22' GRAPHICSMAGICK: '1.3.36' ARCH: linux/amd64,linux/arm64 + GIT: '2.36' + RUST: '1.73' + NODE: '18.17' parallel: matrix: - - OS: ['debian:bullseye', 'debian:bullseye-slim'] + - OS: ['debian:bullseye', 'debian:bullseye-slim', 'debian:bookworm', 'debian:bookworm-slim'] RUBY: ['3.0.patched', '3.1.patched', '3.2.patched'] - GIT: ['2.36'] - POSTGRESQL: ['12', '13', '14', '15'] - GOLANG: ['1.19', '1.20', '1.21'] - RUST: ['1.73'] - NODE: ['18.17'] + POSTGRESQL: ['13', '14', '15'] + GOLANG: ['1.20', '1.21'] CHROME: ['119', '120'] # Used by GitLab's compile-production-assets and compile-test-assets jobs @@ -60,7 +60,7 @@ gitlab-assets: ARCH: amd64,arm64 parallel: matrix: - - OS: ['debian:bullseye'] + - OS: ['debian:bullseye', 'debian:bookworm'] RUBY: ['3.0', '3.1', '3.2'] GIT: ['2.33'] NODE: ['18.17'] @@ -81,11 +81,10 @@ gitlab-slim-ruby: extends: - .gitlab stage: gitlab - variables: - OS: 'debian:bullseye-slim' parallel: matrix: - RUBY: ['3.0', '3.1', '3.2'] + OS: ['debian:bullseye-slim', 'debian:bookworm-slim'] # Used by GitLab's workhorse tests gitlab-workhorse: @@ -98,7 +97,7 @@ gitlab-workhorse: RUBYGEMS: '3.4' parallel: matrix: - - OS: ['debian:bullseye'] + - OS: ['debian:bullseye', 'debian:bookworm'] RUBY: ['3.0', '3.1', '3.2'] GOLANG: ['1.19', '1.20', '1.21'] RUST: ['1.73'] diff --git a/Dockerfile.cache-chrome b/Dockerfile.cache-chrome index 9af1e38..6a4a353 100644 --- a/Dockerfile.cache-chrome +++ b/Dockerfile.cache-chrome @@ -1,6 +1,6 @@ # Save amd64 chrome and arm64 .deb files to package registry ARG BUILD_OS=debian -ARG OS_VERSION=bullseye +ARG OS_VERSION=bookworm FROM ${BUILD_OS}:${OS_VERSION} ARG TARGETARCH diff --git a/README.md b/README.md index 8357015..bbabcef 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ new_image: extends: - .build_dynamic_image variables: - OS: 'debian:bullseye' + OS: 'debian:bookworm' RUBY: '3.0' GOLANG: '1.15' RUST: '1.73.0' diff --git a/scripts/install-chrome b/scripts/install-chrome index 244e9cf..be05745 100755 --- a/scripts/install-chrome +++ b/scripts/install-chrome @@ -75,7 +75,7 @@ function build_ubi() { } BUILD_OS=${BUILD_OS:-debian} -OS_VERSION=${OS_VERSION:-bullseye} +OS_VERSION=${OS_VERSION:-bookworm} # When using a -slim version, actually use the non-slim OS version. # diff --git a/scripts/install-essentials b/scripts/install-essentials index feba899..cef1724 100755 --- a/scripts/install-essentials +++ b/scripts/install-essentials @@ -18,6 +18,18 @@ function install_debian_bullseye_deps() { libre2-dev libevent-dev gettext rsync git-core lsb-release } +function install_debian_bookworm_deps() { + apt-get install -y \ + curl wget build-essential apt-utils clang locales openssh-client \ + libclang-dev libssl-dev libyaml-dev libreadline-dev llvm-dev zlib1g-dev \ + libncurses5-dev libffi-dev ca-certificates libxml2-dev \ + libxslt1-dev libcurl4-openssl-dev libicu-dev \ + logrotate python3-docutils pkg-config cmake \ + libkrb5-dev postgresql-client unzip \ + libsqlite3-dev libpq-dev libpng-dev libjpeg-dev libzstd-dev \ + libre2-dev libevent-dev gettext rsync git-core lsb-release +} + function prepare_debian_environment() { export DEBIAN_FRONTEND=noninteractive @@ -27,8 +39,9 @@ function prepare_debian_environment() { case "$VERSION" in 11) - install_debian_bullseye_deps - ;; + install_debian_bullseye_deps;; + 12) + install_debian_bookworm_deps;; esac # Set UTF-8 diff --git a/scripts/install-ruby b/scripts/install-ruby index eef6293..026548f 100755 --- a/scripts/install-ruby +++ b/scripts/install-ruby @@ -16,6 +16,10 @@ JEMALLOC_DOWNLOAD_URL="https://github.com/jemalloc/jemalloc/releases/download/${ BUNDLER_VERSION=${3:-""} RUBYGEMS_VERSION=${4:-""} +# only installed for Ruby 3.0 on debian bookworm +CUSTOM_OPENSSL_VERSION=1.1.1w +CUSTOM_OPENSSL_DIR=/usr/local/openssl_ruby + function build_common() { # Download jemalloc mkdir -p /usr/src/jemalloc @@ -90,6 +94,7 @@ function build_debian() { apt-get update apt-get install -y --no-install-recommends bison dpkg-dev libgdbm-dev autoconf + install_custom_openssl_if_needed build_common apt-get purge -y --auto-remove ruby @@ -115,6 +120,20 @@ function build_ubi() { [ "$(command -v ruby)" = '/usr/local/bin/ruby' ] } +function install_custom_openssl_if_needed() { + if [[ $RUBY_VERSION =~ "3.0" ]] && [[ $OS_VERSION =~ "bookworm" ]]; then + apt-get install -y --no-install-recommends perl make gcc + curl -fsSL "https://www.openssl.org/source/openssl-${CUSTOM_OPENSSL_VERSION}.tar.gz" | tar -xzC /tmp + cd /tmp/openssl-${CUSTOM_OPENSSL_VERSION} + ./config --prefix="$CUSTOM_OPENSSL_DIR" --openssldir="$CUSTOM_OPENSSL_DIR" shared zlib + make + make install + rm -rf /tmp/openssl-${CUSTOM_OPENSSL_VERSION} + # set CONFIGURE_ARGS for ruby builds + export CONFIGURE_ARGS="${CONFIGURE_ARGS:-} --with-openssl-dir=$CUSTOM_OPENSSL_DIR" + fi +} + BUILD_OS=${BUILD_OS:-debian} if [[ $BUILD_OS =~ debian ]]; then diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index 47faa5e..8192089 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -93,8 +93,8 @@ function print_chrome_args() { CHROMIUM_VERSION=119.0.6045.159-1 ;; 120|120.0) - CHROME_VERSION=120.0.6099.199-1 - CHROMIUM_VERSION=120.0.6099.199-1 + CHROME_VERSION=120.0.6099.216-1 + CHROMIUM_VERSION=120.0.6099.216-1 ;; *) fail "Unknown chrome version $1" ;; esac @@ -417,7 +417,7 @@ if [[ -n "$OS" ]]; then elif [[ -n "$UBI" ]]; then unset DEBIAN else - DEBIAN=${DEBIAN:-bullseye} + DEBIAN=${DEBIAN:-bookworm} fi build_custom_if_needed $@