Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 41 additions & 31 deletions bin/apt-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -74,36 +74,41 @@ 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
# hopefully via: https://github.com/rpm-software-management/createrepo_c/issues/145
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
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s.a.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it, the packages are already available, so no need to break anything

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I meant the pip3 lines, we need those only in Mango and Docs, but they create their own venv iirc…

fi
Expand All @@ -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" ] && \
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not 102 or 115 ready for Spidermonkey...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood, but that's what noble comes with. the work to be compatible with sm 102/115 will happen in couchdb itself, and we'll need a CI image to test it in

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only informational: PR for v102 and v115.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, you want only prepare this already, but don't hook it into Jenkins atm?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible?

fi
if [ "${VERSION_CODENAME}" == "focal" ]; then
apt-get install --no-install-recommends -y libmozjs-68-dev
fi
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
66 changes: 66 additions & 0 deletions dockerfiles/ubuntu-noble
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions pull-all-couchdbdev-docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down