Skip to content

Commit

Permalink
Merge pull request #47 from dealii/cleanup
Browse files Browse the repository at this point in the history
Cleanup and new versions of symengine and CGAL.
  • Loading branch information
luca-heltai authored Feb 28, 2025
2 parents 5310a0f + 80912f4 commit 317d80e
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 183 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
fail-fast: false
matrix:
system:
- ubuntu_version: "focal"
dealii_version: 9.4.0-1ubuntu2~bpo20.04.1~ppa1
tag: focal-v9.5.1
- ubuntu_version: "jammy"
dealii_version: 9.4.0-1ubuntu2~bpo22.04.1~ppa1
tag: jammy-v9.5.1
- ubuntu_version: jammy
dealii_version: 9.6.0-1~ubuntu22.04.1~ppa1
tag: jammy-v9.6.0
- ubuntu_version: noble
dealii_version: 9.6.0-1~ubuntu24.04.1~ppa1
tag: noble-v9.6.0

steps:
- name: Checkout code
Expand All @@ -47,7 +47,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image of dependencies ${{ matrix.system.ubuntu_version }}
- name: Build and push Docker image of dealii/dependencies:${{ matrix.system.ubuntu_version }}
uses: docker/build-push-action@v5
with:
context: ./dependencies/
Expand All @@ -56,8 +56,10 @@ jobs:
build-args: |
IMG=${{ matrix.system.ubuntu_version }}
VERSION=${{ matrix.system.dealii_version}}
REPO=ppa:ginggs/deal.ii-9.6.0-backports
CLANG_VERSION=16
platforms: linux/arm64,linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ matrix.system.tag }}
dealii/dependencies:${{ matrix.tag }}
dealii/dependencies:${{ matrix.system.tag }}
161 changes: 30 additions & 131 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,136 +15,28 @@

# Use no-cache option to force rebuild
# DOCKER_BUILD=docker build --no-cache
DOCKER_BUILD=docker build
DOCKER_BUILD=docker buildx build --push --platform linux/amd64,linux/arm64 --output type=registry
DOCKER_BUILD=docker buildx build --push --platform linux/arm64 --output type=registry

# Repos:
# ppa:ginggs/deal.ii-backports
# ppa:ginggs/deal.ii-9.2.0-backports

# Version 9.1.1
v9.1.1-bionic:
$(DOCKER_BUILD) -t dealii/dealii:v9.1.1-bionic \
--build-arg VERSION=9.1.1-2~ubuntu18.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-backports \
bionic
docker push dealii/dealii:v9.1.1-bionic

# Version 9.2.0 - Change to the correct package when it is available
v9.2.0-bionic:
$(DOCKER_BUILD) -t dealii/dealii:v9.2.0-bionic \
--build-arg VERSION=9.2.0-1~ubuntu18.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.2.0-backports \
bionic
docker push dealii/dealii:v9.2.0-bionic

v9.2.0-focal:
$(DOCKER_BUILD) -t dealii/dealii:v9.2.0-focal \
--build-arg VERSION=9.2.0-1~ubuntu20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.2.0-backports \
--build-arg CLANG_VERSION=6 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.0.0/ \
focal
docker push dealii/dealii:v9.2.0-focal

v9.3.0-focal:
$(DOCKER_BUILD) -t dealii/dealii:v9.3.0-focal \
--build-arg VERSION=9.3.0-1~ubuntu20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.3.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
focal
docker push dealii/dealii:v9.3.0-focal
docker tag dealii/dealii:v9.3.0-focal dealii/dealii:latest
docker push dealii/dealii:latest

v9.4.0-focal:
$(DOCKER_BUILD) -t dealii/dealii:v9.4.0-focal \
--build-arg VERSION=9.4.0-1ubuntu2~bpo20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.4.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
focal
docker push dealii/dealii:v9.4.0-focal
docker tag dealii/dealii:v9.4.0-focal dealii/dealii:latest
docker push dealii/dealii:latest

v9.4.0-jammy:
$(DOCKER_BUILD) -t dealii/dealii:v9.4.0-jammy \
--build-arg VERSION=9.4.0-1ubuntu2~bpo22.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.4.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
jammy
docker push dealii/dealii:v9.4.0-jammy

dependencies-focal-v9.2.0:
$(DOCKER_BUILD) -t dealii/dependencies:focal-v9.2.0 \
--build-arg IMG=focal \
--build-arg VERSION=9.2.0-1~ubuntu20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.2.0-backports \
--build-arg CLANG_VERSION=6 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.0.0/ \
dependencies
docker push dealii/dependencies:focal-v9.2.0

dependencies-focal-v9.3.0:
$(DOCKER_BUILD) -t dealii/dependencies:focal-v9.3.0 \
--build-arg IMG=focal \
--build-arg VERSION=9.3.0-1~ubuntu20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.3.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
dependencies
docker tag dealii/dependencies:focal dealii/dependencies:focal-v9.3.0
docker push dealii/dependencies:focal-v9.3.0

dependencies-focal:
$(DOCKER_BUILD) -t dealii/dependencies:focal \
--build-arg IMG=focal \
--build-arg VERSION=9.4.0-1ubuntu2~bpo20.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.4.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
dependencies
docker push dealii/dependencies:focal

dependencies-jammy:
$(DOCKER_BUILD) -t dealii/dependencies:jammy \
$(DOCKER_BUILD) \
-t dealii/dependencies:jammy \
-t dealii/dependencies:jammy-v9.6.0 \
--build-arg IMG=jammy \
--build-arg VERSION=9.4.0-1ubuntu2~bpo22.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.4.0-backports \
--build-arg CLANG_VERSION=11 \
--build-arg CLANG_REPO=https://github.com/dealii/dealii/releases/download/v9.3.0/ \
--build-arg VERSION=9.6.0-1~ubuntu22.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.6.0-backports \
dependencies
docker push dealii/dependencies:jammy
docker tag dealii/dependencies:jammy dealii/dependencies:latest
docker tag dealii/dependencies:jammy dealii/dependencies:jammy-v9.4.0
docker push dealii/dependencies:latest
docker push dealii/dependencies:jammy-v9.4.0

v9.4.2-focal:
$(DOCKER_BUILD) -t dealii/dealii:v9.4.2-focal \
--build-arg IMG=focal \
--build-arg VER=v9.4.2 \
--build-arg PROCS=80 \
github
docker push dealii/dealii:v9.4.2-focal

v9.4.2-jammy:
$(DOCKER_BUILD) -t dealii/dealii:v9.4.2-jammy \
--build-arg IMG=jammy \
--build-arg VER=v9.4.2 \
--build-arg PROCS=80 \
github
docker push dealii/dealii:v9.4.2-jammy

v9.5.0-focal:
$(DOCKER_BUILD) -t dealii/dealii:v9.5.0-focal \
--build-arg IMG=focal \
--build-arg VER=v9.5.0 \
--build-arg PROCS=12 \
github
docker push dealii/dealii:v9.5.0-focal
dependencies-noble:
$(DOCKER_BUILD) \
-t dealii/dependencies:noble \
-t dealii/dependencies:noble-v9.6.0 \
-t dealii/dependencies:latest \
--build-arg IMG=noble \
--build-arg VERSION=9.6.0-1~ubuntu24.04.1~ppa1 \
--build-arg REPO=ppa:ginggs/deal.ii-9.6.0-backports \
dependencies

v9.5.0-jammy:
$(DOCKER_BUILD) -t dealii/dealii:v9.5.0-jammy \
Expand All @@ -156,13 +48,20 @@ v9.5.0-jammy:
docker tag dealii/dealii:v9.5.0-jammy dealii/dealii:latest
docker push dealii/dealii:latest

all: dependencies-focal v9.5.0-focal dependencies-jammy v9.5.0-jammy
v9.6.2-noble:
$(DOCKER_BUILD) -t dealii/dealii:v9.6.2-noble \
--build-arg IMG=noble \
--build-arg VER=v9.6.2 \
--build-arg PROCS=12 \
github
docker push dealii/dealii:v9.6.2-noble
docker tag dealii/dealii:v9.6.2-noble dealii/dealii:latest
docker push dealii/dealii:latest

all: dependencies-noble v9.6.2-noble

.PHONY: all \
v9.1.1-bionic v9.2.0-bionic \
v9.2.0-focal v9.3.0-focal v9.4.0-focal v9.4.1-focal v9.4.2-focal \
v9.5.0-focal \
v9.4.0-jammy v9.4.1-jammy v9.4.2-jammy \
dependencies-jammy \
dependencies-noble \
v9.5.0-jammy \
dependencies-focal-v9.2.0 dependencies-focal-v9.3.0 dependencies-focal \
dependencies-jammy
v9.6.2-noble
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ Images are tagged with the ubuntu distribution they are based on.

You can pull any of the images from dockerhub using (for example)

docker pull dealii/dealii:v9.5.0-jammy
docker pull dealii/dealii:v9.6.0-noble

after which you could run an interactive shell in it:

docker run -i -t dealii/dealii:v9.5.0-jammy
docker run -i -t dealii/dealii:v9.6.0-noble

This will drop you in an isolated environment where you can experiment with deal.II.

Versions of interest:
- ``dealii/dealii:v9.5.0-jammy`` - deal.II v9.5.0, Ubuntu 22.04
- ``dealii/dealii:v9.5.0-focal`` - deal.II v9.5.0, Ubuntu 20.04
- ``dealii/dealii:v9.4.2-jammy`` - deal.II v9.4.2, Ubuntu 22.04
- ``dealii/dealii:v9.4.2-focal`` - deal.II v9.4.2, Ubuntu 20.04

A list of all available images is here:
- ``dealii/dealii:v9.6.0-noble`` - deal.II v9.6.0, Ubuntu 24.04
- ``dealii/dealii:v9.6.0-jammy`` - deal.II v9.6.0, Ubuntu 22.04

https://hub.docker.com/r/dealii/dealii/tags/
A list of all available images is here:

<https://hub.docker.com/r/dealii/dealii/tags/>

In addition there are images that only contain the deal.II dependencies, but
not the library itself. These images are helpful to compile your own version
of deal.II. All images containing only deal.II dependencies can be found at:

https://hub.docker.com/r/dealii/dependencies/tags/
<https://hub.docker.com/r/dealii/dependencies/tags/>

# For developers

If you want to update the dependencies image, open a pull request with the
updated Dockerfile in the `dependencies` directory. The CI will build the image
and push it to dockerhub. Notice that the image is built for all supported
Ubuntu versions and tagged accordingly. The CI needs to be run manually.
69 changes: 35 additions & 34 deletions dependencies/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
ARG IMG=jammy
ARG IMG=noble

FROM ubuntu:$IMG

LABEL maintainer="luca.heltai@gmail.com"

ARG VERSION=9.4.0-1ubuntu2~bpo22.04.1~ppa1
ARG REPO=ppa:ginggs/deal.ii-9.4.0-backports
ARG CLANG_VERSION=11
ARG VERSION=9.6.0-1~ubuntu24.04.1~ppa1
ARG REPO=ppa:ginggs/deal.ii-9.6.0-backports

USER root
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -15,7 +12,6 @@ RUN apt-get update && apt-get install -y software-properties-common \
&& add-apt-repository $REPO \
&& apt-get update && \
apt-get install -y \
clang-format-${CLANG_VERSION} \
git \
libboost-dev \
libboost-python-dev \
Expand All @@ -42,8 +38,14 @@ RUN apt-get update && apt-get install -y software-properties-common \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

RUN wget https://raw.githubusercontent.com/dealii/dealii/refs/heads/master/contrib/utilities/download_clang_format \
&& chmod +x download_clang_format \
&& ./download_clang_format \
&& mv programs/clang-16/bin/clang-format /usr/local/bin/ \
&& rm -rf download_clang_format programs

# Symengine
RUN cd /usr/src && \
Expand All @@ -56,7 +58,6 @@ RUN cd /usr/src && \
-DBUILD_TESTS=off \
-DINTEGER_CLASS=flint \
-DWITH_BOOST=on \
-DWITH_GMP=on \
-DWITH_LLVM=on \
-DWITH_MPC=on \
-DWITH_MPFR=on \
Expand All @@ -67,10 +68,10 @@ RUN cd /usr/src && \

# CGAL
RUN cd /usr/src && \
wget https://github.com/CGAL/cgal/releases/download/v5.5.2/CGAL-5.5.2.tar.xz && \
tar xvf CGAL-5.5.2.tar.xz && \
rm -rf CGAL-5.5.2.tar.xz && \
cd CGAL-5.5.2/ && \
wget https://github.com/CGAL/cgal/releases/download/v5.6.2/CGAL-5.6.2.tar.xz && \
tar xvf CGAL-5.6.2.tar.xz && \
rm -rf CGAL-5.6.2.tar.xz && \
cd CGAL-5.6.2/ && \
mkdir build && cd build && \
cmake -GNinja .. -DCMAKE_INSTALL_PREFIX=/usr/ && \
ninja install && cd ../ && rm -rf build
Expand All @@ -83,28 +84,28 @@ RUN cd /usr/src && \
cd vtk-v9.4.0/ && \
mkdir build && cd build && \
cmake -GNinja .. \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DVTK_EXTRA_COMPILER_WARNINGS=OFF \
-DVTK_GROUP_ENABLE_Imaging=DONT_WANT \
-DVTK_GROUP_ENABLE_MPI=DONT_WANT \
-DVTK_GROUP_ENABLE_Qt=DONT_WANT \
-DVTK_GROUP_ENABLE_Rendering=DONT_WANT \
-DVTK_GROUP_ENABLE_StandAlone=WANT \
-DVTK_GROUP_ENABLE_Views=DONT_WANT \
-DVTK_GROUP_ENABLE_Web=DONT_WANT \
-DVTK_USE_MPI=OFF \
-DVTK_WRAP_JAVA=OFF \
-DVTK_WRAP_PYTHON=OFF && \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DVTK_EXTRA_COMPILER_WARNINGS=OFF \
-DVTK_GROUP_ENABLE_Imaging=DONT_WANT \
-DVTK_GROUP_ENABLE_MPI=DONT_WANT \
-DVTK_GROUP_ENABLE_Qt=DONT_WANT \
-DVTK_GROUP_ENABLE_Rendering=DONT_WANT \
-DVTK_GROUP_ENABLE_StandAlone=WANT \
-DVTK_GROUP_ENABLE_Views=DONT_WANT \
-DVTK_GROUP_ENABLE_Web=DONT_WANT \
-DVTK_USE_MPI=OFF \
-DVTK_WRAP_JAVA=OFF \
-DVTK_WRAP_PYTHON=OFF && \
ninja install && cd ../ && rm -rf build

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANG=en_US.UTF-8

RUN ldconfig
ENV PYTHONPATH "/usr/local/lib/python3.8/site-packages/"
ENV PYTHONPATH="/usr/local/lib/python3.8/site-packages/"

# add and enable the default user
ARG USER=dealii
Expand All @@ -115,7 +116,7 @@ RUN adduser $USER sudo; echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# make sure everything is in place
RUN chown -R $USER:$USER /home/$USER
USER $USER
ENV HOME /home/$USER
ENV USER $USER
ENV OMPI_MCA_btl "^vader"
ENV HOME=/home/$USER
ENV USER=$USER
ENV OMPI_MCA_btl="^vader"
WORKDIR $HOME
1 change: 0 additions & 1 deletion github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ RUN cd /usr/src \
&& cmake -GNinja \
-DCMAKE_PREFIX_PATH="/usr/lib/x86_64-linux-gnu/hdf5/openmpi;/usr/include/hdf5/openmpi" \
-DDEAL_II_ALLOW_AUTODETECTION=OFF \
-DDEAL_II_COMPILE_EXAMPLES=OFF \
-DDEAL_II_COMPONENT_PYTHON_BINDINGS=ON \
-DCMAKE_CXX_FLAGS="-std=c++17" \
-DDEAL_II_WITH_64BIT_INDICES=OFF \
Expand Down

0 comments on commit 317d80e

Please sign in to comment.