Skip to content

Commit

Permalink
docker: transition bionic to jammy
Browse files Browse the repository at this point in the history
The bionic LTS release of ubuntu is falling out of standard support.

Update all references to bionic from the leaving LTS release to the
current LTS release.  Builds of the fluxrm/testenv for arm64 and amd64
are already on dockerhub based on these changes.
  • Loading branch information
trws committed Aug 4, 2023
1 parent f2fda90 commit 58f6ac3
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/test/create-kvs-dumpfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ DUMPFILE=flux-${TAG}.tar.bz2
printf "Creating dumpfile in ${OUTPUTDIR}/${DUMPFILE}\n"
docker run -i --rm -u $(id -u) \
--mount type=bind,source=${OUTPUTDIR},target=/data \
fluxrm/flux-core:bionic-${TAG} \
fluxrm/flux-core:jammy-${TAG} \
flux start sh -c "/data/workload.sh; flux dump /data/${DUMPFILE}"

rm ${OUTPUTDIR}/workload.sh
Expand Down
4 changes: 2 additions & 2 deletions src/test/docker-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ echo $DOCKER_PASSWORD | docker login -u "$DOCKER_USERNAME" --password-stdin
log "docker push ${DOCKER_TAG}"
docker push ${DOCKER_TAG}

# If this is the bionic build, then also tag without image name:
if echo "$DOCKER_TAG" | grep -q "bionic"; then
# If this is the jammy build, then also tag without image name:
if echo "$DOCKER_TAG" | grep -q "jammy"; then
t="${DOCKER_REPO}:${GITHUB_TAG:-latest}"
log "docker push ${t}"
docker tag "$DOCKER_TAG" ${t} && docker push ${t}
Expand Down
16 changes: 8 additions & 8 deletions src/test/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ or a tagged version of flux-core.

#### fluxrm/testenv Docker images

The Dockerfiles `bionic/Dockerfile`, `focal/Dockerfile`,
The Dockerfiles `jammy/Dockerfile`, `focal/Dockerfile`,
`el7/Dockerfile`, and `el8/Dockerfile` describe the images built
under the `fluxrm/testenv:bionic`, `fluxrm/testenv:focal`,
under the `fluxrm/testenv:jammy`, `fluxrm/testenv:focal`,
`fluxrm/testenv:el7`, and `fluxrm/testenv:el8` respectively, and
include the base dependencies required to build flux-core. These images
are updated manually by flux-core maintainers, but the Dockerfiles should
Expand All @@ -41,9 +41,9 @@ result in a temporary docker image being created during testing of the
PR with the dependency installed.

Later, a flux-core maintainer can move the dependency into the `testenv`
Docker images `bionic/Dockerfile` and `el7/Dockerfile`.
Docker images `jammy/Dockerfile` and `el7/Dockerfile`.
These docker images should then be built by hand and manually
pushed to DockerHub at `fluxrm/testenv:bionic` and
pushed to DockerHub at `fluxrm/testenv:jammy` and
`fluxrm/testenv:el7`. Be sure to test that the `docker-run-test.sh`
script still runs against the new `testenv` images, e.g.:

Expand All @@ -56,24 +56,24 @@ $ for i in focal el7 el8 fedora33 fedora34 fedora35 fedora38; do
done
```

#### Bionic multiarch images
#### Jammy multiarch images

Building the bionic images for linux/amd64 and linux/386 requires the
Building the jammy images for linux/amd64 and linux/386 requires the
Docker buildx extensions, see

https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

and run
```
$ docker buildx build --push --platform=linux/386,linux/amd64 --tag fluxrm/testenv:bionic src/test/docker/bionic
$ docker buildx build --push --platform=linux/386,linux/amd64 --tag fluxrm/testenv:jammy src/test/docker/jammy
```

to build and push images to docker hub.

#### Local Testing

Developers can test the docker images themselves. If new dependencies are needed,
they can update the `$image` Dockerfiles manually (where `$image` is one of bionic, el7, el8, or focal).
they can update the `$image` Dockerfiles manually (where `$image` is one of jammy, el7, el8, or focal).
To create a local Docker image, run the command:

```
Expand Down
148 changes: 148 additions & 0 deletions src/test/docker/bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
FROM debian:bookworm

LABEL maintainer="Tom Scogland <[email protected]>"

# Update pkg caches, install latest pkg utils and basics:
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
apt-utils \
wget \
&& rm -rf /var/lib/apt/lists/*

# Utilities
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
locales \
ca-certificates \
wget \
man \
git \
flex \
ssh \
sudo \
vim \
luarocks \
munge \
lcov \
ccache \
lua5.2 \
mpich \
valgrind \
jq \
&& rm -rf /var/lib/apt/lists/*

# Compilers, autotools
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
build-essential \
pkg-config \
autotools-dev \
libtool \
autoconf \
automake \
make \
cmake \
clang-15 \
clang-tools-15 \
gcc-12 \
g++-12 \
&& rm -rf /var/lib/apt/lists/*

# Python
# NOTE: sudo pip install is necessary to get differentiated installations of
# python binary components for multiple python3 variants, --ignore-installed
# makes it ignore local versions of the packages if your home directory is
# mapped into the container and contains the same libraries
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
libffi-dev \
python3-dev \
python3.11-dev \
python3-pip \
python3-setuptools \
python3-wheel \
&& rm -rf /var/lib/apt/lists/*

RUN for PY in python3.10 python3.11 ; do \
sudo $PY -m pip install --upgrade --ignore-installed \
"markupsafe==2.0.0" \
coverage cffi ply six pyyaml "jsonschema>=2.6,<4.0" \
sphinx sphinx-rtd-theme sphinxcontrib-spelling; \
sudo mkdir -p /usr/lib/${PY}/dist-packages; \
echo ../site-packages >/tmp/site-packages.pth; \
sudo mv /tmp/site-packages.pth /usr/lib/${PY}/dist-packages; \
done ; \
apt-get -qq purge -y python3-pip \
&& apt-get -qq autoremove -y

# Other deps
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
libsodium-dev \
libzmq3-dev \
libczmq-dev \
libjansson-dev \
libmunge-dev \
libncursesw5-dev \
liblua5.2-dev \
liblz4-dev \
libsqlite3-dev \
uuid-dev \
libhwloc-dev \
libmpich-dev \
libs3-dev \
libevent-dev \
libarchive-dev \
libpam-dev \
&& rm -rf /var/lib/apt/lists/*

# Testing utils and libs
RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
faketime \
libfaketime \
pylint \
cppcheck \
enchant-2 \
aspell \
aspell-en \
&& rm -rf /var/lib/apt/lists/*

RUN locale-gen en_US.UTF-8

# NOTE: luaposix installed by rocks due to Ubuntu bug: #1752082 https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
RUN luarocks install luaposix

# Install caliper by hand for now:
RUN mkdir caliper \
&& cd caliper \
&& wget -O - https://github.com/LLNL/Caliper/archive/v1.7.0.tar.gz | tar xvz --strip-components 1 \
&& mkdir build \
&& cd build \
&& CC=gcc CXX=g++ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_GOTCHA=Off \
&& make -j 4 \
&& make install \
&& cd ../.. \
&& rm -rf caliper

# Install openpmix, prrte
RUN mkdir prrte \
&& cd prrte \
&& git clone https://github.com/openpmix/openpmix.git \
&& git clone https://github.com/openpmix/prrte.git \
&& ls -l \
&& set -x \
&& cd openpmix \
&& git checkout fefaed568f33bf86f28afb6e45237f1ec5e4de93 \
&& ./autogen.pl \
&& ./configure --prefix=/usr --disable-static && make -j 4 install \
&& ldconfig \
&& cd .. \
&& cd prrte \
&& git checkout 477894f4720d822b15cab56eee7665107832921c \
&& ./autogen.pl \
&& ./configure --prefix=/usr && make -j 4 install \
&& cd ../.. \
&& rm -rf prrte

ENV LANG=C.UTF-8
6 changes: 3 additions & 3 deletions src/test/docker/checks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ RUN set -x && groupadd fluxuser \

# Make sure user in appropriate group for sudo on different platforms
RUN case $BASE_IMAGE in \
bionic*) adduser $USER sudo && adduser fluxuser sudo ;; \
jammy*) adduser $USER sudo && adduser fluxuser sudo ;; \
focal*) adduser $USER sudo && adduser fluxuser sudo ;; \
el*|fedora*) usermod -G wheel $USER && usermod -G wheel fluxuser ;; \
*) (>&2 echo "Unknown BASE_IMAGE") ;; \
esac

# Install extra dependencies if necessary here.
#
# Do not forget to run `apt update` on Ubuntu/bionic.
# Do not forget to run `apt update` on Ubuntu/jammy.
# Do NOT run `yum upgrade` on RPM systems (this will unnecessarily upgrade
# existing packages)
#
RUN case $BASE_IMAGE in \
bionic*) ;; \
jammy*) ;; \
focal*) ;; \
el*|fedora*) ;; \
*) (>&2 echo "Unknown BASE_IMAGE") ;; \
Expand Down
2 changes: 1 addition & 1 deletion src/test/docker/docker-run-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PROJECT=flux-core
BASE_DOCKER_REPO=fluxrm/testenv

WORKDIR=/usr/src
IMAGE=bionic
IMAGE=jammy
JOBS=2
MOUNT_HOME_ARGS="--volume=$HOME:/home/$USER -e HOME"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:jammy

LABEL maintainer="Tom Scogland <[email protected]>"

Expand Down Expand Up @@ -41,10 +41,10 @@ RUN apt-get update \
automake \
make \
cmake \
clang-6.0 \
clang-tidy \
gcc-8 \
g++-8 \
clang-15 \
clang-tools-15 \
gcc-12 \
g++-12 \
&& rm -rf /var/lib/apt/lists/*

# Python
Expand All @@ -56,14 +56,13 @@ RUN apt-get update \
&& apt-get -qq install -y --no-install-recommends \
libffi-dev \
python3-dev \
python3.7-dev \
python3.8-dev \
python3.11-dev \
python3-pip \
python3-setuptools \
python3-wheel \
&& rm -rf /var/lib/apt/lists/*

RUN for PY in python3.6 python3.7 python3.8 ; do \
RUN for PY in python3.10 python3.11 ; do \
sudo $PY -m pip install --upgrade --ignore-installed \
"markupsafe==2.0.0" \
coverage cffi ply six pyyaml "jsonschema>=2.6,<4.0" \
Expand Down Expand Up @@ -103,7 +102,7 @@ RUN apt-get update \
libfaketime \
pylint \
cppcheck \
enchant \
enchant-2 \
aspell \
aspell-en \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -119,7 +118,7 @@ RUN mkdir caliper \
&& wget -O - https://github.com/LLNL/Caliper/archive/v1.7.0.tar.gz | tar xvz --strip-components 1 \
&& mkdir build \
&& cd build \
&& CC=gcc CXX=g++ cmake .. -DCMAKE_INSTALL_PREFIX=/usr \
&& CC=gcc CXX=g++ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DWITH_GOTCHA=Off \
&& make -j 4 \
&& make install \
&& cd ../.. \
Expand Down
31 changes: 16 additions & 15 deletions src/test/generate-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def env_add_s3(self, args, env):
def add_build(
self,
name=None,
image="bionic",
image="jammy",
args=default_args,
jobs=4,
env=None,
Expand Down Expand Up @@ -137,33 +137,34 @@ def __str__(self):
matrix = BuildMatrix()

# Ubuntu: no args
matrix.add_build(name="bionic")
matrix.add_build(name="jammy")

# Ubuntu: 32b
# Debian: 32b
matrix.add_build(
name="bionic - 32 bit",
name="bookworm - 32 bit",
image="debian:bookworm",
platform="linux/386",
)

# Ubuntu: gcc-8, content-s3, distcheck
# Ubuntu: gcc-12, content-s3, distcheck
matrix.add_build(
name="bionic - gcc-8,content-s3,distcheck",
name="jammy - gcc-12,content-s3,distcheck",
env=dict(
CC="gcc-8",
CXX="g++8",
CC="gcc-12",
CXX="g++12",
DISTCHECK="t",
),
args="--with-flux-security --enable-caliper",
test_s3=True,
)

# Ubuntu: py3.7,clang-6.0
# Ubuntu: py3.11,clang-15
matrix.add_build(
name="bionic - py3.7,clang-6.0",
name="jammy - py3.11,clang-15",
env=dict(
CC="clang-6.0",
CXX="clang++-6.0",
PYTHON_VERSION="3.7",
CC="clang-15",
CXX="clang++-15",
PYTHON_VERSION="3.11",
chain_lint="t",
),
args="--with-flux-security",
Expand All @@ -182,7 +183,7 @@ def __str__(self):

# Ubuntu: TEST_INSTALL
matrix.add_build(
name="bionic - test-install",
name="jammy - test-install",
env=dict(
TEST_INSTALL="t",
),
Expand Down Expand Up @@ -269,7 +270,7 @@ def __str__(self):
# inception
matrix.add_build(
name="inception",
image="bionic",
image="jammy",
command_args="--inception",
)

Expand Down

0 comments on commit 58f6ac3

Please sign in to comment.