From 85a3714079bfc06f3ed4ffb5a66007a8b87d450b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Wed, 10 Apr 2024 13:34:57 +0200 Subject: [PATCH 1/2] Install Kokkos dependency --- docker/Dockerfile-ubuntu-22.04 | 11 +++++++---- docker/install-kokkos.sh | 15 +++++++++++++++ docker/install-pfft.sh | 2 +- docker/install-scafacos.sh | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 docker/install-kokkos.sh diff --git a/docker/Dockerfile-ubuntu-22.04 b/docker/Dockerfile-ubuntu-22.04 index 24191d8..548fb74 100644 --- a/docker/Dockerfile-ubuntu-22.04 +++ b/docker/Dockerfile-ubuntu-22.04 @@ -1,6 +1,4 @@ FROM ubuntu:jammy -COPY install-pfft.sh /tmp -COPY install-scafacos.sh /tmp RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ apt-utils \ @@ -62,8 +60,13 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -RUN bash /tmp/install-pfft.sh && rm /tmp/install-pfft.sh && \ - bash /tmp/install-scafacos.sh && rm /tmp/install-scafacos.sh && \ +COPY install-pfft.sh /tmp +COPY install-scafacos.sh /tmp +COPY install-kokkos.sh /tmp + +RUN sh /tmp/install-pfft.sh && rm /tmp/install-pfft.sh && \ + sh /tmp/install-scafacos.sh && rm /tmp/install-scafacos.sh && \ + sh /tmp/install-kokkos.sh && rm /tmp/install-kokkos.sh && \ ldconfig ENV NVIDIA_VISIBLE_DEVICES all diff --git a/docker/install-kokkos.sh b/docker/install-kokkos.sh new file mode 100644 index 0000000..7774017 --- /dev/null +++ b/docker/install-kokkos.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e + +cd /tmp + +git clone -b 4.3.00 https://github.com/kokkos/kokkos +cd kokkos/ +mkdir build +cd build/ +cmake .. -D Kokkos_ENABLE_CUDA=OFF -DKokkos_ENABLE_OPENMP=ON +make -j $(nproc) install +cd +rm -r /tmp/kokkos +ldconfig diff --git a/docker/install-pfft.sh b/docker/install-pfft.sh index 2a1186e..99950e8 100755 --- a/docker/install-pfft.sh +++ b/docker/install-pfft.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e diff --git a/docker/install-scafacos.sh b/docker/install-scafacos.sh index 60a51b8..39ec66a 100755 --- a/docker/install-scafacos.sh +++ b/docker/install-scafacos.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -e From 2fc0deed2f665cdaf330d310bf52820db700d1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Thu, 18 Apr 2024 22:16:51 +0200 Subject: [PATCH 2/2] Bump all operating systems --- .github/workflows/build.yml | 6 +- docker/Dockerfile-debian | 17 +-- docker/Dockerfile-fedora | 5 +- docker/Dockerfile-ubuntu | 126 +++++++++++++++++++++++ docker/Dockerfile-ubuntu-22.04 | 87 ---------------- docker/Dockerfile-ubuntu-wo-dependencies | 11 +- docker/jupyter_nbconvert_config.json | 7 ++ 7 files changed, 160 insertions(+), 99 deletions(-) create mode 100644 docker/Dockerfile-ubuntu delete mode 100644 docker/Dockerfile-ubuntu-22.04 create mode 100644 docker/jupyter_nbconvert_config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9882656..2a19b73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - image: ['debian', 'fedora', 'ubuntu-22.04', 'ubuntu-wo-dependencies'] + image: + - debian + - fedora + - ubuntu + - ubuntu-wo-dependencies steps: - uses: actions/checkout@main - name: Build and deploy diff --git a/docker/Dockerfile-debian b/docker/Dockerfile-debian index 4bd19e2..80e9ee6 100644 --- a/docker/Dockerfile-debian +++ b/docker/Dockerfile-debian @@ -1,15 +1,19 @@ -FROM debian:bullseye AS image_base -RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list && \ - apt-get update && \ +FROM debian:bookworm AS image_base +RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ apt-utils \ build-essential \ - curl \ + cmake \ ccache \ + curl \ cython3 \ gdb \ git \ - libboost-dev libboost-serialization-dev libboost-mpi-dev libboost-filesystem-dev libboost-test-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-mpi-dev \ + libboost-serialization-dev \ + libboost-test-dev \ libfftw3-dev \ libhdf5-openmpi-dev \ libpython3-dev \ @@ -17,13 +21,12 @@ RUN echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/ python3 \ python3-h5py \ python3-numpy \ + python3-packaging \ python3-pip \ python3-scipy \ python3-setuptools \ python3-vtk9 \ vim && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --target-release bullseye-backports \ - cmake && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/Dockerfile-fedora b/docker/Dockerfile-fedora index 601a918..b4dee54 100644 --- a/docker/Dockerfile-fedora +++ b/docker/Dockerfile-fedora @@ -1,4 +1,4 @@ -FROM fedora:36 +FROM fedora:40 RUN dnf -y install \ blas-devel \ boost-devel \ @@ -7,6 +7,7 @@ RUN dnf -y install \ cmake \ environment-modules \ fftw-devel \ + fftw-mpich-devel \ gcc \ gcc-c++ \ gdb \ @@ -18,8 +19,10 @@ RUN dnf -y install \ python3 \ python3-devel \ python3-Cython \ + python3-lxml \ python3-numpy \ python3-scipy \ + python3-packaging \ python3-pip \ python3-setuptools \ python3-h5py \ diff --git a/docker/Dockerfile-ubuntu b/docker/Dockerfile-ubuntu new file mode 100644 index 0000000..2ac3dcb --- /dev/null +++ b/docker/Dockerfile-ubuntu @@ -0,0 +1,126 @@ +FROM ubuntu:noble +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ + apt-utils \ + autoconf \ + automake \ + build-essential \ + ccache \ + clang-18 clang-tidy-18 clang-format-18 llvm-18 libclang-rt-18-dev \ + cmake \ + cmake-format \ + curl \ + cython3 \ + doxygen \ + ffmpeg \ + gcc-12 g++-12 \ + gcc-13 g++-13 \ + gdb \ + gfortran \ + git \ + gnupg \ + graphviz \ + ipython3 \ + jq \ + jupyter-client \ + jupyter-core \ + jupyter-nbconvert \ + lcov \ + libblas-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-mpi-dev \ + libboost-serialization-dev \ + libboost-test-dev \ + libdigest-sha-perl \ + libfftw3-dev \ + libfftw3-mpi-dev \ + libgsl-dev \ + libhdf5-openmpi-dev \ + liblapack-dev \ + libopenmpi-dev \ + libthrust-dev \ + libtool \ + nvidia-cuda-toolkit \ + openmpi-bin \ + openssh-client \ + perl \ + pkg-config \ + pre-commit \ + python3 \ + python3-dev \ + pylint \ + python3-coverage \ + python3-dev \ + python3-h5py \ + python3-ipykernel \ + python3-jinja2 \ + python3-lxml \ + python3-matplotlib \ + python3-nbconvert \ + python3-numpy \ + python3-numpydoc \ + python3-pint \ + python3-pip \ + python3-packaging \ + python3-requests \ + python3-scipy \ + python3-setuptools \ + python3-sympy \ + python3-sphinx \ + python3-sphinxcontrib.bibtex \ + python3-tqdm \ + python3-venv \ + python3-vtk9 \ + rsync \ + texlive-base \ + vim && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +COPY install-pfft.sh /tmp +COPY install-scafacos.sh /tmp +COPY install-kokkos.sh /tmp + +RUN sh /tmp/install-pfft.sh && rm /tmp/install-pfft.sh && \ + sh /tmp/install-scafacos.sh && rm /tmp/install-scafacos.sh && \ + sh /tmp/install-kokkos.sh && rm /tmp/install-kokkos.sh && \ + ldconfig + +ENV NVIDIA_VISIBLE_DEVICES all +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV JUPYTER_PLATFORM_DIRS 1 + +COPY --chown=1000:1000 jupyter_nbconvert_config.json /tmp + +RUN userdel ubuntu && rm -rf /home/ubuntu && useradd -u 1000 -m espresso +ENV HOME="/home/espresso" +RUN echo | cpan && \ + echo | cpan JSON::XS && \ + chown -R espresso:espresso /home/espresso/.cpan/ +USER espresso +ENV VIRTUAL_ENV "$HOME/venv" +ENV PATH "$HOME/.local/bin:$VIRTUAL_ENV/bin:$PATH" +RUN cd "${HOME}" && \ + python3 -m venv --system-site-packages venv && \ + . venv/bin/activate && \ + python3 -m pip install --no-cache \ + jupyterlab==4.0.13 \ + pep8==1.7.1 \ + autopep8==2.1.0 \ + pycodestyle==2.11.1 \ + sphinx-toggleprompt==0.5.2 && \ + jupyter_config_root=$(jupyter --paths --json | jq ".config[0]") && \ + jupyter_config_root=${jupyter_config_root#\"} && \ + jupyter_config_root=${jupyter_config_root%\"} && \ + jupyter_kernels_root=$(jupyter --paths --json | jq ".data[0]")/kernels && \ + jupyter_kernels_root=${jupyter_kernels_root#\"} && \ + jupyter_kernels_root=${jupyter_kernels_root%\"} && \ + mkdir -p "${jupyter_config_root}" "${jupyter_kernels_root}" && \ + mv "/tmp/jupyter_nbconvert_config.json" "${jupyter_config_root}/" && \ + ln -s "${VIRTUAL_ENV}/share/jupyter/kernels/python3" "${jupyter_kernels_root}/python3" && \ + deactivate && \ + mkdir -p "${HOME}/.local/bin" && \ + mkdir -p "${HOME}/.local/etc/alternatives" && \ + mkdir -p "${HOME}/.local/var/lib/alternatives" +WORKDIR /home/espresso diff --git a/docker/Dockerfile-ubuntu-22.04 b/docker/Dockerfile-ubuntu-22.04 deleted file mode 100644 index 548fb74..0000000 --- a/docker/Dockerfile-ubuntu-22.04 +++ /dev/null @@ -1,87 +0,0 @@ -FROM ubuntu:jammy -RUN apt-get update && \ - DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ - apt-utils \ - autoconf \ - automake \ - build-essential \ - ccache \ - cmake \ - cmake-format \ - clang-14 clang-tidy-14 clang-format-14 llvm-14 \ - curl \ - cython3 \ - doxygen \ - ffmpeg \ - gcc-10 g++-10 \ - gdb \ - gfortran \ - git \ - gnupg \ - graphviz \ - jq \ - lcov \ - libblas-dev \ - libboost-dev libboost-serialization-dev libboost-mpi-dev libboost-filesystem-dev libboost-test-dev \ - libdigest-sha-perl \ - libfftw3-dev \ - libfftw3-mpi-dev \ - libgsl-dev \ - libhdf5-openmpi-dev \ - liblapack-dev \ - libopenmpi-dev \ - libthrust-dev \ - libtool \ - npm \ - nvidia-cuda-toolkit \ - openmpi-bin \ - openssh-client \ - pkg-config \ - python3 \ - pylint \ - python3-autopep8 \ - python3-coverage \ - python3-dev \ - python3-h5py \ - python3-lxml \ - python3-numpy \ - python3-matplotlib \ - python3-pint \ - python3-pip \ - python3-pycodestyle \ - python3-requests \ - python3-scipy \ - python3-setuptools \ - python3-tqdm \ - python3-vtk9 \ - rsync \ - texlive-base \ - vim && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -COPY install-pfft.sh /tmp -COPY install-scafacos.sh /tmp -COPY install-kokkos.sh /tmp - -RUN sh /tmp/install-pfft.sh && rm /tmp/install-pfft.sh && \ - sh /tmp/install-scafacos.sh && rm /tmp/install-scafacos.sh && \ - sh /tmp/install-kokkos.sh && rm /tmp/install-kokkos.sh && \ - ldconfig - -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility - -RUN useradd -m espresso -USER espresso -ENV HOME="/home/espresso" -ENV PATH="${HOME}/.local/bin${PATH:+:$PATH}" -RUN pip3 install --no-cache --user \ - pre-commit==2.17.0 \ - jupyterlab==4.0.9 \ - nbconvert==6.5.1 \ - sphinx==4.5.0 \ - sphinx-toggleprompt==0.4.0 \ - sphinxcontrib-bibtex==2.6.1 \ - numpydoc==1.5.0 -WORKDIR /home/espresso diff --git a/docker/Dockerfile-ubuntu-wo-dependencies b/docker/Dockerfile-ubuntu-wo-dependencies index 2c3f8d7..90a3c2d 100644 --- a/docker/Dockerfile-ubuntu-wo-dependencies +++ b/docker/Dockerfile-ubuntu-wo-dependencies @@ -1,4 +1,4 @@ -FROM ubuntu:jammy AS image_base +FROM ubuntu:noble AS image_base RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ apt-utils \ @@ -7,10 +7,14 @@ RUN apt-get update && \ ccache \ cmake \ cython3 \ - gcc-11 g++-11 \ + gcc-13 g++-13 \ gdb \ git \ - libboost-dev libboost-serialization-dev libboost-mpi-dev libboost-filesystem-dev libboost-test-dev \ + libboost-dev \ + libboost-filesystem-dev \ + libboost-mpi-dev \ + libboost-serialization-dev \ + libboost-test-dev \ libopenmpi-dev \ openssh-client \ openmpi-bin \ @@ -19,6 +23,7 @@ RUN apt-get update && \ python3-h5py \ python3-lxml \ python3-numpy \ + python3-packaging \ python3-pip \ python3-scipy \ python3-setuptools \ diff --git a/docker/jupyter_nbconvert_config.json b/docker/jupyter_nbconvert_config.json new file mode 100644 index 0000000..51d0ec3 --- /dev/null +++ b/docker/jupyter_nbconvert_config.json @@ -0,0 +1,7 @@ +{ + "version": 1, + "Exporter": { + "require_js_url": "https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js", + "mathjax_url": "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS_CHTML-full,Safe" + } +}