From d4f2a1696971365c1616236f16512e343549d23e Mon Sep 17 00:00:00 2001 From: twsearle <14909402+twsearle@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:37:32 +0100 Subject: [PATCH 1/2] add ci docker file --- .github/workflows/build_ci_image.yml | 78 +++++ ci/Dockerfile.almalinux9 | 412 +++++++++++++++++++++++++++ 2 files changed, 490 insertions(+) create mode 100644 .github/workflows/build_ci_image.yml create mode 100644 ci/Dockerfile.almalinux9 diff --git a/.github/workflows/build_ci_image.yml b/.github/workflows/build_ci_image.yml new file mode 100644 index 0000000..5455247 --- /dev/null +++ b/.github/workflows/build_ci_image.yml @@ -0,0 +1,78 @@ +name: Create and publish the CI docker image + +# Configures this workflow to run when triggered. +on: + workflow_dispatch: + +# Defines two custom environment variables for the workflow. These are used for +# the Container registry domain, and a name for the Docker image that this +# workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: orca-jedi-ci + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + attestations: write + id-token: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container + # registry registry using the account and password that will publish the + # packages. Once published, the packages are scoped to the account + # defined here. + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + token: ${{ secrets.GH_PAT }} + # This step uses + # [docker/metadata-action](https://github.com/docker/metadata-action#about) + # to extract tags and labels that will be applied to the specified image. + # The `id` "meta" allows the output of this step to be referenced in a + # subsequent step. The `images` value provides the base name for the tags + # and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the + # image, based on your repository's `Dockerfile`. If the build succeeds, + # it pushes the image to GitHub Packages. It uses the `context` + # parameter to define the build's context as the set of files located in + # the specified path. For more information, see + # "[Usage](https://github.com/docker/build-push-action#usage)" in the + # README of the `docker/build-push-action` repository. It uses the + # `tags` and `labels` parameters to tag and label the image with the + # output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + push: true + file: ./ci/Dockerfile.almalinux9 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # This step generates an artifact attestation for the image, which is an + # unforgeable statement about where and how it was built. It increases + # supply chain security for people who consume the image. For more + # information, see + # "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true + diff --git a/ci/Dockerfile.almalinux9 b/ci/Dockerfile.almalinux9 new file mode 100644 index 0000000..6f4698e --- /dev/null +++ b/ci/Dockerfile.almalinux9 @@ -0,0 +1,412 @@ +FROM almalinux:9 AS build + +RUN dnf install -y 'dnf-command(config-manager)' && \ + dnf config-manager -y --set-enabled crb + +RUN yum install -y epel-release && \ + yum install -y \ + bison \ + bzip2 \ + clang-tools-extra \ + eigen3-devel \ + expat-devel \ + flex \ + gcc \ + gcc-c++ \ + gcc-gfortran \ + git \ + git-lfs \ + gmp-devel \ + gnupg2 \ + graphviz \ + jq \ + lcov \ + less \ + libX11-devel \ + libaec-devel \ + libcurl-devel \ + libxml2-devel \ + libzstd-devel \ + lz4-devel \ + mpfr-devel \ + ncurses-devel \ + ninja-build \ + openssh-server \ + openssl-devel \ + patch \ + pkgconfig \ + pybind11-devel \ + python3-devel \ + python3-pip \ + python3-pytest \ + python3-pyyaml \ + rsync \ + time \ + unzip \ + vim-minimal \ + wget \ + xz \ + zlib-devel \ + zstd && \ + rm -rf /var/cache/yum/* + +# CMake version 3.30.0 +RUN yum install -y \ + make \ + wget && \ + rm -rf /var/cache/yum/* +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/Kitware/CMake/releases/download/v3.30.0/cmake-3.30.0-linux-x86_64.sh && \ + mkdir -p /usr/local && \ + /bin/sh /var/tmp/cmake-3.30.0-linux-x86_64.sh --prefix=/usr/local --skip-license && \ + rm -rf /var/tmp/cmake-3.30.0-linux-x86_64.sh +ENV PATH=/usr/local/bin:$PATH + +# https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.11.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.11.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v3.11.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/lapack-3.11.0/build && cd /var/tmp/lapack-3.11.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON /var/tmp/lapack-3.11.0 && \ + cmake --build /var/tmp/lapack-3.11.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/lapack-3.11.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/lapack-3.11.0 /var/tmp/v3.11.0.tar.gz + +# Boost version 1.85.0 +RUN yum install -y \ + bzip2 \ + bzip2-devel \ + tar \ + wget \ + which \ + zlib-devel && \ + rm -rf /var/cache/yum/* +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://boostorg.jfrog.io/artifactory/main/release/1.85.0/source/boost_1_85_0.tar.bz2 && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/boost_1_85_0.tar.bz2 -C /var/tmp -j && \ + cd /var/tmp/boost_1_85_0 && ./bootstrap.sh --prefix=/usr/local --with-libraries=chrono,date_time,filesystem,program_options,regex,serialization,system,thread && \ + ./b2 toolset=gcc cxxflags="-std=c++17" -j$(nproc) -q install && \ + rm -rf /var/tmp/boost_1_85_0.tar.bz2 /var/tmp/boost_1_85_0 +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + +# OpenMPI version 4.1.5 +RUN yum install -y \ + bzip2 \ + file \ + hwloc \ + make \ + numactl-devel \ + openssh-clients \ + perl \ + tar \ + wget && \ + rm -rf /var/cache/yum/* +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://www.open-mpi.org/software/ompi/v4.1/downloads/openmpi-4.1.5.tar.bz2 && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/openmpi-4.1.5.tar.bz2 -C /var/tmp -j && \ + cd /var/tmp/openmpi-4.1.5 && ./configure --prefix=/usr/local --enable-mpi-cxx --enable-mpi-fortran --without-cuda --without-verbs && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/openmpi-4.1.5 /var/tmp/openmpi-4.1.5.tar.bz2 +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \ + PATH=/usr/local/bin:$PATH + +# HDF5 version 1.14.2 +RUN yum install -y \ + bzip2 \ + file \ + make \ + wget \ + zlib-devel && \ + rm -rf /var/cache/yum/* +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.2/src/hdf5-1.14.2.tar.bz2 && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/hdf5-1.14.2.tar.bz2 -C /var/tmp -j && \ + cd /var/tmp/hdf5-1.14.2 && CC=mpicc CXX=mpicxx F77=mpif77 F90=mpif90 FC=mpifort ./configure --prefix=/usr/local --enable-build-mode=production --enable-cxx --enable-fortran --enable-parallel --enable-threadsafe --enable-unsupported --with-szlib=/usr/local --with-zlib=/usr/local && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/hdf5-1.14.2 /var/tmp/hdf5-1.14.2.tar.bz2 +ENV CPATH=/usr/local/include:$CPATH \ + HDF5_DIR=/usr/local \ + LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \ + LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH \ + PATH=/usr/local/bin:$PATH + +RUN sed -i "s|-I/var/tmp/hdf5-$1.14.2/src/H5FDsubfiling||g" "/usr/local/bin/h5pcc" + +ENV H5DIR=/usr/local \ + LIBS=-ldl + +# NetCDF version 4.9.2, NetCDF C++ version 4.3.1, NetCDF Fortran +# version 4.6.1 +RUN yum install -y \ + ca-certificates \ + file \ + libcurl-devel \ + m4 \ + make \ + wget \ + zlib-devel && \ + rm -rf /var/cache/yum/* +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/Unidata/netcdf-c/archive/v4.9.2.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v4.9.2.tar.gz -C /var/tmp -z && \ + cd /var/tmp/netcdf-c-4.9.2 && CC=mpicc CXX=mpicxx F77=mpif77 F90=mpif90 FC=mpifort ./configure --prefix=/usr/local --disable-zstandard-plugin --enable-netcdf-4 --enable-shared && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/netcdf-c-4.9.2 /var/tmp/v4.9.2.tar.gz +ENV CPATH=/usr/local/include:$CPATH \ + LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \ + LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH \ + PATH=/usr/local/bin:$PATH +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/Unidata/netcdf-cxx4/archive/v4.3.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v4.3.1.tar.gz -C /var/tmp -z && \ + cd /var/tmp/netcdf-cxx4-4.3.1 && CC=mpicc CXX=mpicxx F77=mpif77 F90=mpif90 FC=mpifort ./configure --prefix=/usr/local --disable-zstandard-plugin --enable-netcdf-4 --enable-shared && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/netcdf-cxx4-4.3.1 /var/tmp/v4.3.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/Unidata/netcdf-fortran/archive/v4.6.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v4.6.1.tar.gz -C /var/tmp -z && \ + cd /var/tmp/netcdf-fortran-4.6.1 && CC=mpicc CXX=mpicxx F77=mpif77 F90=mpif90 FC=mpifort ./configure --prefix=/usr/local --disable-zstandard-plugin --enable-netcdf-4 --enable-shared && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/netcdf-fortran-4.6.1 /var/tmp/v4.6.1.tar.gz + +ENV NETCDF_DIR=/usr/local \ + NetCDF_ROOT=/usr/local + +# https://gitlab.com/remikz/nccmp/-/archive/1.9.1.0/nccmp-1.9.1.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://gitlab.com/remikz/nccmp/-/archive/1.9.1.0/nccmp-1.9.1.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/nccmp-1.9.1.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/nccmp-1.9.1.0/build && cd /var/tmp/nccmp-1.9.1.0/build && CC=mpicc CXX=mpicxx F77=mpif77 F90=mpif90 FC=mpifort cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON /var/tmp/nccmp-1.9.1.0 && \ + cmake --build /var/tmp/nccmp-1.9.1.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/nccmp-1.9.1.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/nccmp-1.9.1.0 /var/tmp/nccmp-1.9.1.0.tar.gz + +# https://downloads.unidata.ucar.edu/udunits/2.2.28/udunits-2.2.28.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://downloads.unidata.ucar.edu/udunits/2.2.28/udunits-2.2.28.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/udunits-2.2.28.tar.gz -C /var/tmp -z && \ + cd /var/tmp/udunits-2.2.28 && ./configure --prefix=/usr/local --enable-shared=yes && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/udunits-2.2.28 /var/tmp/udunits-2.2.28.tar.gz + +# https://github.com/gsl-lite/gsl-lite/archive/refs/tags/v0.41.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/gsl-lite/gsl-lite/archive/refs/tags/v0.41.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v0.41.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/gsl-lite-0.41.0/build && cd /var/tmp/gsl-lite-0.41.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release /var/tmp/gsl-lite-0.41.0 && \ + cmake --build /var/tmp/gsl-lite-0.41.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/gsl-lite-0.41.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/gsl-lite-0.41.0 /var/tmp/v0.41.0.tar.gz + +# https://github.com/blitzpp/blitz/archive/refs/tags/1.0.2.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/blitzpp/blitz/archive/refs/tags/1.0.2.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/1.0.2.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/blitz-1.0.2/build && cd /var/tmp/blitz-1.0.2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON /var/tmp/blitz-1.0.2 && \ + cmake --build /var/tmp/blitz-1.0.2/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/blitz-1.0.2/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/blitz-1.0.2 /var/tmp/1.0.2.tar.gz + +# https://github.com/nlohmann/json/archive/refs/tags/v3.9.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/nlohmann/json/archive/refs/tags/v3.9.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v3.9.1.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/json-3.9.1/build && cd /var/tmp/json-3.9.1/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DJSON_BuildTests=OFF /var/tmp/json-3.9.1 && \ + cmake --build /var/tmp/json-3.9.1/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/json-3.9.1/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/json-3.9.1 /var/tmp/v3.9.1.tar.gz + +# https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.0.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.0.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v12.0.1.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/NCEPLIBS-bufr-12.0.1/build && cd /var/tmp/NCEPLIBS-bufr-12.0.1/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF /var/tmp/NCEPLIBS-bufr-12.0.1 && \ + cmake --build /var/tmp/NCEPLIBS-bufr-12.0.1/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/NCEPLIBS-bufr-12.0.1/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/NCEPLIBS-bufr-12.0.1 /var/tmp/v12.0.1.tar.gz + +# https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.3.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.3.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/2.3.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/json-schema-validator-2.3.0/build && cd /var/tmp/json-schema-validator-2.3.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_EXAMPLES=OFF /var/tmp/json-schema-validator-2.3.0 && \ + cmake --build /var/tmp/json-schema-validator-2.3.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/json-schema-validator-2.3.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/json-schema-validator-2.3.0 /var/tmp/2.3.0.tar.gz + +# https://github.com/ecmwf/ecbuild/archive/refs/tags/3.8.5.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/ecbuild/archive/refs/tags/3.8.5.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/3.8.5.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/ecbuild-3.8.5/build && cd /var/tmp/ecbuild-3.8.5/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/ecbuild-3.8.5 && \ + cmake --build /var/tmp/ecbuild-3.8.5/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/ecbuild-3.8.5/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/ecbuild-3.8.5 /var/tmp/3.8.5.tar.gz + +# https://github.com/ecmwf/eckit/archive/refs/tags/1.26.2.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/eckit/archive/refs/tags/1.26.2.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/1.26.2.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/eckit-1.26.2/build && cd /var/tmp/eckit-1.26.2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/eckit-1.26.2 && \ + cmake --build /var/tmp/eckit-1.26.2/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/eckit-1.26.2/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/eckit-1.26.2 /var/tmp/1.26.2.tar.gz + +# https://github.com/ecmwf/fckit/archive/refs/tags/0.13.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/fckit/archive/refs/tags/0.13.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/0.13.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/fckit-0.13.0/build && cd /var/tmp/fckit-0.13.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/fckit-0.13.0 && \ + cmake --build /var/tmp/fckit-0.13.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/fckit-0.13.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/fckit-0.13.0 /var/tmp/0.13.0.tar.gz + +# https://github.com/ecmwf/odc/archive/refs/tags/1.5.2.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/odc/archive/refs/tags/1.5.2.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/1.5.2.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/odc-1.5.2/build && cd /var/tmp/odc-1.5.2/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/odc-1.5.2 && \ + cmake --build /var/tmp/odc-1.5.2/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/odc-1.5.2/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/odc-1.5.2 /var/tmp/1.5.2.tar.gz + +# https://github.com/ecmwf-ifs/fiat/archive/refs/tags/1.4.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf-ifs/fiat/archive/refs/tags/1.4.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/1.4.1.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/fiat-1.4.1/build && cd /var/tmp/fiat-1.4.1/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/fiat-1.4.1 && \ + cmake --build /var/tmp/fiat-1.4.1/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/fiat-1.4.1/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/fiat-1.4.1 /var/tmp/1.4.1.tar.gz + +# https://github.com/ecmwf-ifs/ectrans/archive/refs/tags/1.2.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf-ifs/ectrans/archive/refs/tags/1.2.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/1.2.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/ectrans-1.2.0/build && cd /var/tmp/ectrans-1.2.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/ectrans-1.2.0 && \ + cmake --build /var/tmp/ectrans-1.2.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/ectrans-1.2.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/ectrans-1.2.0 /var/tmp/1.2.0.tar.gz + +# https://github.com/ecmwf/atlas/archive/refs/tags/0.37.0.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/atlas/archive/refs/tags/0.37.0.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/0.37.0.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/atlas-0.37.0/build && cd /var/tmp/atlas-0.37.0/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/atlas-0.37.0 && \ + cmake --build /var/tmp/atlas-0.37.0/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/atlas-0.37.0/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/atlas-0.37.0 /var/tmp/0.37.0.tar.gz + +# https://github.com/ecmwf/atlas-orca/archive/refs/tags/0.3.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/atlas-orca/archive/refs/tags/0.3.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/0.3.1.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/atlas-orca-0.3.1/build && cd /var/tmp/atlas-orca-0.3.1/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/atlas-orca-0.3.1 && \ + cmake --build /var/tmp/atlas-orca-0.3.1/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/atlas-orca-0.3.1/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/atlas-orca-0.3.1 /var/tmp/0.3.1.tar.gz + +# https://github.com/ecmwf/eccodes/archive/refs/tags/2.30.1.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/ecmwf/eccodes/archive/refs/tags/2.30.1.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/2.30.1.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/eccodes-2.30.1/build && cd /var/tmp/eccodes-2.30.1/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/eccodes-2.30.1 && \ + cmake --build /var/tmp/eccodes-2.30.1/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/eccodes-2.30.1/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/eccodes-2.30.1 /var/tmp/2.30.1.tar.gz + +# https://github.com/NOAA-EMC/bufr-query +RUN mkdir -p /var/tmp && cd /var/tmp && git clone https://github.com/NOAA-EMC/bufr-query bufr-query && cd - && cd /var/tmp/bufr-query && git checkout 65193ee3066f3f9977079e420be769926cb86342 && cd - && \ + mkdir -p /var/tmp/bufr-query/build && cd /var/tmp/bufr-query/build && LDFLAGS=-lnetcdf cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/bufr-query && \ + cmake --build /var/tmp/bufr-query/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/bufr-query/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/bufr-query + +# https://github.com/JCSDA-internal/GSW-Fortran/archive/refs/tags/v3.07.tar.gz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://github.com/JCSDA-internal/GSW-Fortran/archive/refs/tags/v3.07.tar.gz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/v3.07.tar.gz -C /var/tmp -z && \ + mkdir -p /var/tmp/GSW-Fortran-3.07/build && cd /var/tmp/GSW-Fortran-3.07/build && cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DMPI=ON -DOMP=ON /var/tmp/GSW-Fortran-3.07 && \ + cmake --build /var/tmp/GSW-Fortran-3.07/build --target all -- -j$(nproc) && \ + cmake --build /var/tmp/GSW-Fortran-3.07/build --target install -- -j$(nproc) && \ + rm -rf /var/tmp/GSW-Fortran-3.07 /var/tmp/v3.07.tar.gz + +# https://swprojects.dkrz.de/redmine/attachments/download/528/yaxt-0.10.0.tar.xz +RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://swprojects.dkrz.de/redmine/attachments/download/528/yaxt-0.10.0.tar.xz && \ + mkdir -p /var/tmp && tar -x -f /var/tmp/yaxt-0.10.0.tar.xz -C /var/tmp -J && \ + cd /var/tmp/yaxt-0.10.0 && ./configure --prefix=/usr/local --with-idxtype=long --without-regard-for-quality && \ + make -j$(nproc) && \ + make -j$(nproc) install && \ + rm -rf /var/tmp/yaxt-0.10.0 /var/tmp/yaxt-0.10.0.tar.xz + +RUN yum install -y \ + perl \ + perl-URI \ + perl-core \ + subversion && \ + rm -rf /var/cache/yum/* + +COPY ctx/bin/jedi-*-build /usr/local/bin/ + +COPY ctx/src/* /usr/local/src/ + +# pip +RUN yum install -y \ + python3-pip && \ + rm -rf /var/cache/yum/* +RUN pip3 --no-cache-dir install fparser==0.1.4 Jinja2 PSyclone==2.5.0 pycodestyle==2.10 numpy==1.26.4 netcdf4==1.6.5 + +FROM almalinux:9 + +# JEDI development image with GNU and OpenMPI + +LABEL Maintainer=darth@metoffice.gov.uk \ + Species=NextGen \ + Version=v0.1 + +RUN dnf install -y 'dnf-command(config-manager)' && \ + dnf config-manager -y --set-enabled crb + +RUN yum install -y epel-release && \ + yum install -y \ + bison \ + bzip2 \ + clang-tools-extra \ + eigen3-devel \ + expat-devel \ + flex \ + gcc \ + gcc-c++ \ + gcc-gfortran \ + git \ + git-lfs \ + gmp-devel \ + gnupg2 \ + graphviz \ + jq \ + lcov \ + less \ + libX11-devel \ + libaec-devel \ + libcurl-devel \ + libxml2-devel \ + libzstd-devel \ + lz4-devel \ + mpfr-devel \ + ncurses-devel \ + ninja-build \ + openssh-server \ + openssl-devel \ + patch \ + pkgconfig \ + pybind11-devel \ + python3-devel \ + python3-pip \ + python3-pytest \ + python3-pyyaml \ + rsync \ + time \ + unzip \ + vim-minimal \ + wget \ + xz \ + zlib-devel \ + zstd && \ + rm -rf /var/cache/yum/* + +# pip +RUN yum install -y \ + python3-pip && \ + rm -rf /var/cache/yum/* +RUN pip3 --no-cache-dir install cpplint yamlprocessor + +COPY --from=build /usr/local /usr/local + +RUN ln -sfT python3 /usr/bin/python + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:$LD_LIBRARY_PATH \ + PATH=/usr/local/bin:$PATH + +ENTRYPOINT ["/usr/local/bin/jedi-bundle-build"] + +WORKDIR /var/tmp From faa3df764e9885d1851438b2cfd24de62e8957a0 Mon Sep 17 00:00:00 2001 From: twsearle <14909402+twsearle@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:34:36 +0100 Subject: [PATCH 2/2] change image name --- .github/workflows/build_ci_image.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_ci_image.yml b/.github/workflows/build_ci_image.yml index 5455247..78967d7 100644 --- a/.github/workflows/build_ci_image.yml +++ b/.github/workflows/build_ci_image.yml @@ -2,6 +2,9 @@ name: Create and publish the CI docker image # Configures this workflow to run when triggered. on: + push: + tags: + - v** workflow_dispatch: # Defines two custom environment variables for the workflow. These are used for @@ -9,7 +12,7 @@ on: # workflow builds. env: REGISTRY: ghcr.io - IMAGE_NAME: orca-jedi-ci + IMAGE_NAME: orca-jedi/ci-almalinux9 jobs: build-and-push-image: