Skip to content

Commit

Permalink
Upgrade Ubuntu from 22.04 to 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jul 25, 2024
1 parent b1e9d05 commit dec82bc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ branches['CI'] = {
}
}

def buildImage = env.CHANGE_ID && pullRequest.labels.contains('build-image')

for (int i = 0; i < splits.size(); i++) {
int index = i
axes.values().combinations {
Expand All @@ -123,9 +125,10 @@ for (int i = 0; i < splits.size(); i++) {
retryCounts = retryCounts + 1 // increment the retry count before allocating a node in case it fails
node(nodeLabel) {
checkout scm
def image = buildImage ? docker.build('jenkins/ath', '--build-arg uid="$(id -u)" --build-arg gid="$(id -g)" ./src/main/resources/ath-container/') : docker.image('jenkins/ath')
sh 'mkdir -p target/ath-reports && chmod a+rwx target/ath-reports'
def cwd = pwd()
docker.image('jenkins/ath').inside("-v /var/run/docker.sock:/var/run/docker.sock -v '${cwd}/target/ath-reports:/reports:rw' --shm-size 2g") {
image.inside("-v /var/run/docker.sock:/var/run/docker.sock -v '${cwd}/target/ath-reports:/reports:rw' --shm-size 2g") {
def exclusions = splits.get(index).join('\n')
writeFile file: 'excludes.txt', text: exclusions
infra.withArtifactCachingProxy {
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The harness provides a variety of ways to configure the execution including:
* [Selecting how to launch Jenkins](docs/CONTROLLER.md)
* [Obtaining a report of plugins that were exercised](docs/EXERCISEDPLUGINSREPORTER.md)
* [Running tests in container](docs/DOCKER.md)
* [Running tests on Java 11 (WIP)](docs/JAVA11.md)
* [Debugging tests in container](docs/DOCKER.md#debugging-tests-in-a-docker-container)
* [Capture a support bundle](docs/SUPPORT-BUNDLE.md)
* Selecting tests based on plugins they cover (TODO)
Expand Down
22 changes: 6 additions & 16 deletions src/main/resources/ath-container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# see docs/DOCKER.md for usage

FROM ubuntu:22.04
FROM ubuntu:24.04

# hadolint ignore=DL3008
RUN apt-get update && \
Expand All @@ -29,30 +29,19 @@ RUN apt-get update && \
iptables \
unzip \
tightvncserver \
openjdk-11-jdk \
openjdk-17-jdk \
openjdk-21-jdk \
xfonts-base \
openssh-client \
jq \
&& \
apt-get clean all && rm -rf /var/cache/apt

# JDK21 https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21%2B35/OpenJDK21U-jdk_aarch64_linux_hotspot_21_35.tar.gz
ARG JDK21_VERSION=21+35
RUN curl -sSLo /tmp/jdk21.tar.gz "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-$(echo "$JDK21_VERSION" | jq "@uri" -jRr)/OpenJDK21U-jdk_$(arch | sed -e 's/x86_64/x64/')_linux_hotspot_${JDK21_VERSION/+/_}.tar.gz" \
&& mkdir "/usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)" \
&& tar -C "/usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)" -xzf /tmp/jdk21.tar.gz --strip-components=1 \
&& rm -fv /tmp/jdk21.tar.gz
RUN update-alternatives --install /usr/bin/java java "/usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)/bin/java" 21 \
&& update-alternatives --install /usr/bin/javac javac "/usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)/bin/javac" 21 \
&& update-alternatives --set java "/usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture)/bin/java" \
&& update-alternatives --set javac "/usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture)/bin/javac"

# Install a fixed firefox version that is known to work with the current selenium version, copied from https://hub.docker.com/r/selenium/node-firefox/dockerfile
ARG FIREFOX_VERSION=108.0.2
# hadolint: Do not pin packages as they are requirements only for firefox installation (and not ofr the rest of the ATH) and the effort required to track each version would be too huge
# hadolint ignore=DL3008
RUN apt-get update && apt-get -y --no-install-recommends install libgtk-3-0 libasound2 libdbus-glib-1-2 libx11-xcb-dev libpci-dev libgl1-mesa-glx wget bzip2 \
RUN apt-get update && apt-get -y --no-install-recommends install libgtk-3-0 libasound2t64 libdbus-glib-1-2 libegl1 libpci3 libx11-xcb1 wget bzip2 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& curl --silent https://download-installer.cdn.mozilla.net/pub/firefox/releases/${FIREFOX_VERSION}/linux-x86_64/en-US/firefox-${FIREFOX_VERSION}.tar.bz2 --output /tmp/firefox.tar.bz2 \
&& rm -rf /opt/firefox \
Expand Down Expand Up @@ -91,7 +80,7 @@ RUN echo \

# Ensure that version is fixed
ARG DOCKER_VERSION=27.0.3
ARG DOCKER_BUILDX_VERSION=0.10.2
ARG DOCKER_BUILDX_VERSION=0.16.1
RUN apt-get update --quiet \
&& apt-get install --yes --no-install-recommends \
docker-ce="5:${DOCKER_VERSION}*" \
Expand All @@ -110,7 +99,8 @@ ENV gid $gid

EXPOSE 5942

RUN groupadd ath-user -g $gid && \
RUN deluser ubuntu && \
groupadd ath-user -g $gid && \
useradd ath-user -l -u $uid -g $gid -m -d /home/ath-user && \
# Give permission to modify the alternatives links to change the java version in use
chown ath-user:ath-user /etc/alternatives
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/ath-container/set-java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -uo pipefail
trap 's=$?; echo >&2 "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR

# The selection used by update-alternatives for each java version
if [[ $1 == '11' ]]; then
selection='11-openjdk'
elif [[ $1 == '17' ]]; then
if [[ $1 == '17' ]]; then
selection='17-openjdk'
elif [[ $1 == '21' ]]; then
selection='21-openjdk'
Expand Down

0 comments on commit dec82bc

Please sign in to comment.