21363: Add ubuntu2404 packages 21363-ubuntu2404-package-build
authorBrett Smith <brett.smith@curii.com>
Wed, 1 May 2024 16:23:25 +0000 (12:23 -0400)
committerBrett Smith <brett.smith@curii.com>
Thu, 6 Jun 2024 18:38:39 +0000 (14:38 -0400)
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

build/package-build-dockerfiles/Makefile
build/package-build-dockerfiles/ubuntu2404/Dockerfile [new file with mode: 0644]
build/package-build-dockerfiles/ubuntu2404/ports.list [new file with mode: 0644]
build/package-test-dockerfiles/ubuntu2404/Dockerfile [new file with mode: 0644]
build/package-testing/test-packages-ubuntu2404.sh [new symlink]
build/rails-package-scripts/postinst.sh
build/run-library.sh

index 920d626483d5f68798206025911ed84ece97fa14..58ba04f386908c734c844cd39ef680ac98baa63f 100644 (file)
@@ -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 (file)
index 0000000..9d5adea
--- /dev/null
@@ -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 <packaging@arvados.org>"
+
+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 (file)
index 0000000..b2d42ce
--- /dev/null
@@ -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 (file)
index 0000000..deccdf6
--- /dev/null
@@ -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 <packaging@arvados.org>"
+
+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 (symlink)
index 0000000..54ce94c
--- /dev/null
@@ -0,0 +1 @@
+deb-common-test-packages.sh
\ No newline at end of file
index b5f78f988cda7f7097dc05c526fb58dadd170e7d..a0b2513b07d53fb666534d407a87dac745812ba0 100644 (file)
@@ -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"
index bebd5b8cbff713d26d20cd40d7b6530df28c70df..6bbfa36cdeaf5bd7a128423f881e09eb95186291 100755 (executable)
@@ -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