You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2024/12/08 04:06:41 UTC

(couchdb-ci) 01/01: add ubuntu noble numbat

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch ubuntu-noble-rebased
in repository https://gitbox.apache.org/repos/asf/couchdb-ci.git

commit 649b8d937cc4210016eac65bcdda54bc2c0ddb0a
Author: Robert Newson <Ro...@ibm.com>
AuthorDate: Mon Sep 2 09:05:26 2024 +0100

    add ubuntu noble numbat
---
 bin/apt-dependencies.sh    | 72 ++++++++++++++++++++++++++--------------------
 build.sh                   |  2 +-
 dockerfiles/ubuntu-noble   | 66 ++++++++++++++++++++++++++++++++++++++++++
 pull-all-couchdbdev-docker |  1 +
 4 files changed, 109 insertions(+), 32 deletions(-)

diff --git a/bin/apt-dependencies.sh b/bin/apt-dependencies.sh
index c50ef08..d79d53d 100755
--- a/bin/apt-dependencies.sh
+++ b/bin/apt-dependencies.sh
@@ -43,7 +43,7 @@ SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 . ${SCRIPTPATH}/detect-arch.sh >/dev/null
 . ${SCRIPTPATH}/detect-os.sh >/dev/null
 debians='(bullseye|bookworm)'
-ubuntus='(focal|jammy)'
+ubuntus='(focal|jammy|noble)'
 echo "Detected Ubuntu/Debian version: ${VERSION_CODENAME}   arch: ${ARCH}"
 
 # ubuntu docker image seems to be missing /etc/timezone...
@@ -74,7 +74,7 @@ apt-get install --no-install-recommends -y apt-transport-https curl git pkg-conf
 
 
 # createrepo_c or createrepo, depending on packaging support
-if [ "${VERSION_CODENAME}" == "bullseye" ] || [ "${VERSION_CODENAME}" == "bookworm" ]; then
+if [ "${VERSION_CODENAME}" == "noble" ] || [ "${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 / bookworm. look for createrepo_c eventually
@@ -82,28 +82,33 @@ else
   apt-get install --no-install-recommends -y createrepo || true
 fi
 
-# Node.js
-wget https://deb.nodesource.com/setup_${NODEVERSION}.x
-if /bin/bash setup_${NODEVERSION}.x; then
-  apt-get install --no-install-recommends -y nodejs
-fi
-rm setup_${NODEVERSION}.x
-
-# maybe install node from scratch if pkg install failed...
-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
-    NODEARCH=x64
-  else
-    NODEARCH=${ARCH}
-  fi
-  node_filename="$(curl -s https://nodejs.org/dist/latest-v${NODEVERSION}.x/SHASUMS256.txt | grep linux-${NODEARCH}.tar.gz | cut -d ' ' -f 3)"
-  wget https://nodejs.org/dist/latest-v${NODEVERSION}.x/${node_filename}
-  tar --directory=/usr --strip-components=1 -xzf ${node_filename}
-  rm ${node_filename}
-  # fake a package install
-  cat << EOF > nodejs-control
+# Node.js (ubuntu noble has version 18, otherwise build a package)
+
+if [ "${VERSION_CODENAME}" == "noble" ] && [ "${NODEVERSION}" == "18" ]; then
+    echo "--- Ubuntu Noble (24.04) has NodeJS 18 so we just install it from there"
+    apt-get install --no-install-recommends -y nodejs
+else
+    wget https://deb.nodesource.com/setup_${NODEVERSION}.x
+    if /bin/bash setup_${NODEVERSION}.x; then
+      apt-get install --no-install-recommends -y nodejs
+    fi
+    rm setup_${NODEVERSION}.x
+
+    # maybe install node from scratch if pkg install failed...
+    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
+        NODEARCH=x64
+      else
+        NODEARCH=${ARCH}
+      fi
+      node_filename="$(curl -s https://nodejs.org/dist/latest-v${NODEVERSION}.x/SHASUMS256.txt | grep linux-${NODEARCH}.tar.gz | cut -d ' ' -f 3)"
+      wget https://nodejs.org/dist/latest-v${NODEVERSION}.x/${node_filename}
+      tar --directory=/usr --strip-components=1 -xzf ${node_filename}
+      rm ${node_filename}
+      # fake a package install
+      cat << EOF > nodejs-control
 Section: misc
 Priority: optional
 Standards-Version: 3.9.2
@@ -112,15 +117,16 @@ Provides: nodejs
 Version: ${NODEVERSION}.99.99
 Description: Fake nodejs package to appease package builder
 EOF
-  equivs-build nodejs-control
-  apt-get install --no-install-recommends -y ./nodejs*.deb
-  rm nodejs-control nodejs*deb
+      equivs-build nodejs-control
+      apt-get install --no-install-recommends -y ./nodejs*.deb
+      rm nodejs-control nodejs*deb
+    fi
 fi
 
 # rest of python dependencies
-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
+if [ "${VERSION_CODENAME}" == "bookworm" -o "${VERSION_CODENAME}" == "noble" ]; then
+    # On Debian bookworm and Ubuntu noble, need the --break-system-package to into to default system location
+    apt-get -y --no-install-recommends install sphinx-rtd-theme-common python3-nose python3-requests python3-hypothesis
 else
     pip3 --default-timeout=10000 install --upgrade sphinx_rtd_theme nose requests hypothesis==3.79.0
 fi
@@ -144,7 +150,8 @@ 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" ] && \
+  if [ "${VERSION_CODENAME}" != "noble" ] && \
+     [ "${VERSION_CODENAME}" != "jammy" ] && \
      [ "${VERSION_CODENAME}" != "focal" ] && \
      [ "${VERSION_CODENAME}" != "bullseye" ] && \
      [ "${VERSION_CODENAME}" != "bookworm" ] && \
@@ -157,6 +164,9 @@ if [ "$1" != "nojs" ]; then
     apt-get install --no-install-recommends -y couch-libmozjs185-dev
   fi
   # newer releases have newer libmozjs
+  if [ "${VERSION_CODENAME}" == "noble" ]; then
+    apt-get install --no-install-recommends -y libmozjs-102-dev libmozjs-115-dev
+  fi
   if [ "${VERSION_CODENAME}" == "focal" ]; then
     apt-get install --no-install-recommends -y libmozjs-68-dev
   fi
diff --git a/build.sh b/build.sh
index 95e07f1..3cdb6df 100755
--- a/build.sh
+++ b/build.sh
@@ -47,7 +47,7 @@ SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 # script as well
 #
 DEBIANS="debian-bullseye debian-bookworm"
-UBUNTUS="ubuntu-focal ubuntu-jammy"
+UBUNTUS="ubuntu-focal ubuntu-jammy ubuntu-noble"
 CENTOSES="almalinux-8 almalinux-9"
 
 PASSED_BUILDARGS="$buildargs"
diff --git a/dockerfiles/ubuntu-noble b/dockerfiles/ubuntu-noble
new file mode 100644
index 0000000..969ea51
--- /dev/null
+++ b/dockerfiles/ubuntu-noble
@@ -0,0 +1,66 @@
+# 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.
+
+FROM ubuntu:noble
+
+# Install Java
+ENV JAVA_HOME=/opt/java/openjdk
+COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
+ENV PATH="${JAVA_HOME}/bin:${PATH}"
+
+# These are needed for the Clouseau integration
+ENV CLOUSEAU_JAVA_HOME=/opt/java/openjdk8
+COPY --from=ibm-semeru-runtimes:open-8-jre /opt/java/openjdk $CLOUSEAU_JAVA_HOME
+ENV PATH=/usr/local/lib/erlang/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 to install
+ARG erlangversion=25.3.2.15
+ARG elixirversion=v1.17.2
+ARG nodeversion=18
+
+# 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 cb0e12f..c17f3e9 100644
--- a/pull-all-couchdbdev-docker
+++ b/pull-all-couchdbdev-docker
@@ -9,6 +9,7 @@ couchdbci-debian:bookworm-erlang-26.2.5.4
 couchdbci-debian:bookworm-erlang:27.1.1
 couchdbci-centos:9-erlang-25.3.2.15
 couchdbci-centos:8-erlang-25.3.2.15
+couchdbci-ubuntu:noble-erlang-25.3.2.15
 couchdbci-ubuntu:jammy-erlang-25.3.2.15
 couchdbci-ubuntu:focal-erlang-25.3.2.15
 )