From ac27c2f61542d0d5a4c2a212da3d9fd4b2819c8c Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Wed, 1 May 2024 12:23:25 -0400 Subject: [PATCH] 21363: Add ubuntu2404 packages Arvados-DCO-1.1-Signed-off-by: Brett Smith --- build/package-build-dockerfiles/Makefile | 5 ++ .../ubuntu2404/Dockerfile | 84 +++++++++++++++++++ .../ubuntu2404/ports.list | 8 ++ .../ubuntu2404/Dockerfile | 16 ++++ .../test-packages-ubuntu2404.sh | 1 + build/rails-package-scripts/postinst.sh | 12 ++- build/run-library.sh | 1 + 7 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 build/package-build-dockerfiles/ubuntu2404/Dockerfile create mode 100644 build/package-build-dockerfiles/ubuntu2404/ports.list create mode 100644 build/package-test-dockerfiles/ubuntu2404/Dockerfile create mode 120000 build/package-testing/test-packages-ubuntu2404.sh diff --git a/build/package-build-dockerfiles/Makefile b/build/package-build-dockerfiles/Makefile index 920d626483..58ba04f386 100644 --- a/build/package-build-dockerfiles/Makefile +++ b/build/package-build-dockerfiles/Makefile @@ -29,6 +29,11 @@ ubuntu2204/generated: common-generated-all test -d ubuntu2204/generated || mkdir ubuntu2204/generated cp -f -rlt ubuntu2204/generated common-generated/* +all: ubuntu2404/generated +ubuntu2404/generated: common-generated-all + test -d ubuntu2404/generated || mkdir ubuntu2404/generated + cp -f -rlt ubuntu2404/generated common-generated/* + GOTARBALL_=DOES_NOT_EXIST NODETARBALL_=DOES_NOT_EXIST GOVERSION=$(shell grep 'const goversion =' ../../lib/install/deps.go |awk -F'"' '{print $$2}') diff --git a/build/package-build-dockerfiles/ubuntu2404/Dockerfile b/build/package-build-dockerfiles/ubuntu2404/Dockerfile new file mode 100644 index 0000000000..9d5adea4b7 --- /dev/null +++ b/build/package-build-dockerfiles/ubuntu2404/Dockerfile @@ -0,0 +1,84 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +ARG HOSTTYPE +ARG BRANCH +ARG GOVERSION + +FROM ubuntu:noble as build_x86_64 +ONBUILD ARG BRANCH +# Install go +ONBUILD ARG GOVERSION +ONBUILD ADD generated/go${GOVERSION}.linux-amd64.tar.gz /usr/local/ +ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/ +# Install nodejs and npm +ONBUILD ADD generated/node-v12.22.12-linux-x64.tar.xz /usr/local/ +ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-x64/bin ./node npm install -g yarn +ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-x64/bin/* /usr/local/bin/ +# On x86, we want some cross-compilation support for arm64 +# Add gcc-aarch64-linux-gnu to compile go binaries for arm64 +ONBUILD COPY ports.list /etc/apt/sources.list.d/ +# We also need libpam compiled for arm64, and that requires some sources.list mangling +ONBUILD RUN sed -i '/^Signed-By: / i Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources \ + && dpkg --add-architecture arm64 \ + && apt-get update \ + && apt-get install -o APT::Immediate-Configure=0 -q -y gcc-aarch64-linux-gnu libpam0g-dev:arm64 libfuse-dev:arm64 + +FROM ubuntu:noble as build_aarch64 +ONBUILD ARG BRANCH +# Install go +ONBUILD ARG GOVERSION +ONBUILD ADD generated/go${GOVERSION}.linux-arm64.tar.gz /usr/local/ +ONBUILD RUN ln -s /usr/local/go/bin/go /usr/local/bin/ +# Install nodejs and npm +ONBUILD ADD generated/node-v12.22.12-linux-arm64.tar.xz /usr/local/ +ONBUILD RUN env -C /usr/local/node-v12.22.12-linux-arm64/bin ./node npm install -g yarn +ONBUILD RUN ln -sf /usr/local/node-v12.22.12-linux-arm64/bin/* /usr/local/bin/ + +FROM build_${HOSTTYPE} + +LABEL org.opencontainers.image.authors="Arvados Package Maintainers " + +ENV DEBIAN_FRONTEND noninteractive + +SHELL ["/bin/bash", "-c"] +# Install dependencies. +RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y \ + build-essential \ + curl \ + equivs \ + git \ + libattr1-dev \ + libcurl4-gnutls-dev \ + libfuse-dev \ + libgnutls28-dev \ + libpam-dev \ + libpq-dev \ + pkgconf \ + python3 \ + python3-dev \ + python3-venv \ + ruby \ + ruby-dev \ + shared-mime-info \ + tzdata \ + unzip + +RUN echo "gem: --no-document" >> ~/.gemrc && \ + gem install --conservative --version '>= 2.4.0' bundler && \ + gem install fpm --version 1.15.1 && \ + ln -s /usr/bin/bundler3.2 /usr/local/bin/bundle && \ + bundle config --global jobs $(let a=$(grep -c processor /proc/cpuinfo )-1; echo $a) + +# Cf. https://build.betterup.com/one-weird-trick-that-will-speed-up-your-bundle-install/ +ENV MAKE "make --jobs 8" + +# Preseed the go module cache. +RUN git clone git://git.arvados.org/arvados.git /tmp/arvados && \ + cd /tmp/arvados && \ + if [[ -n "${BRANCH}" ]]; then git checkout ${BRANCH}; fi && \ + go mod download + +ENV WORKSPACE /arvados +CMD ["bash", "/jenkins/run-build-packages.sh", "--target", "ubuntu2404"] diff --git a/build/package-build-dockerfiles/ubuntu2404/ports.list b/build/package-build-dockerfiles/ubuntu2404/ports.list new file mode 100644 index 0000000000..b2d42ce288 --- /dev/null +++ b/build/package-build-dockerfiles/ubuntu2404/ports.list @@ -0,0 +1,8 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe multiverse +deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe multiverse +deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ noble-backports main restricted universe multiverse +deb [arch=arm64,armhf,ppc64el,s390x] http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe multiverse diff --git a/build/package-test-dockerfiles/ubuntu2404/Dockerfile b/build/package-test-dockerfiles/ubuntu2404/Dockerfile new file mode 100644 index 0000000000..deccdf6be1 --- /dev/null +++ b/build/package-test-dockerfiles/ubuntu2404/Dockerfile @@ -0,0 +1,16 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +FROM ubuntu:noble +LABEL org.opencontainers.image.authors="Arvados Package Maintainers " + +ENV DEBIAN_FRONTEND noninteractive + +# Install dependencies +RUN apt-get update && \ + apt-get -y install --no-install-recommends curl ca-certificates gnupg2 ruby ruby-dev && \ + gem install --conservative --version '>= 2.4.0' bundler && \ + ln -s /usr/bin/bundler3.2 /usr/local/bin/bundle && \ + mkdir -p /etc/udev/disabled && \ + echo "deb [trusted=yes] file:///arvados/packages/ubuntu2404/ /" >>/etc/apt/sources.list diff --git a/build/package-testing/test-packages-ubuntu2404.sh b/build/package-testing/test-packages-ubuntu2404.sh new file mode 120000 index 0000000000..54ce94c357 --- /dev/null +++ b/build/package-testing/test-packages-ubuntu2404.sh @@ -0,0 +1 @@ +deb-common-test-packages.sh \ No newline at end of file diff --git a/build/rails-package-scripts/postinst.sh b/build/rails-package-scripts/postinst.sh index b5f78f988c..a0b2513b07 100644 --- a/build/rails-package-scripts/postinst.sh +++ b/build/rails-package-scripts/postinst.sh @@ -193,10 +193,16 @@ configure_version() { export RAILS_ENV=production run_and_report "Installing bundler" gem install --conservative --version '~> 2.4.0' bundler - local bundle="$(gem contents --version '~> 2.4.0' bundler | grep '/exe/bundle$' | tail -n1)" + local bundle="$(gem contents --version '~> 2.4.0' bundler | grep -E '/(bin|exe)/bundle$' | tail -n1)" if ! [ -x "$bundle" ]; then - echo "Error: failed to find \`bundle\` command after installing bundler gem" >&2 - return 1 + # Some distros (at least Ubuntu 24.04) append the Ruby version to the + # executable name, but that isn't reflected in the output of + # `gem contents`. Check for that version. + bundle="$bundle$(ruby -e 'puts RUBY_VERSION.split(".")[..1].join(".")')" + if ! [ -x "$bundle" ]; then + echo "Error: failed to find \`bundle\` command after installing bundler gem" >&2 + return 1 + fi fi local bundle_path="$SHARED_PATH/vendor_bundle" diff --git a/build/run-library.sh b/build/run-library.sh index bebd5b8cbf..6bbfa36cde 100755 --- a/build/run-library.sh +++ b/build/run-library.sh @@ -457,6 +457,7 @@ test_package_presence() { debian12) codename=bookworm ;; ubuntu2004) codename=focal ;; ubuntu2204) codename=jammy ;; + ubuntu2404) codename=noble ;; *) echo "FIXME: Don't know deb URL path for $TARGET, building" return 0 -- 2.30.2