From 4d3bdfbf3c491e8753796e7acad093267a436be5 Mon Sep 17 00:00:00 2001 From: Joe Zuntz Date: Tue, 3 Sep 2024 12:07:43 +0100 Subject: [PATCH] add way to generate min failing image --- .github/workflows/build-min-image.yml | 40 +++++++++++++++++++++++++++ txpipe-min-failing/Dockerfile | 33 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/build-min-image.yml create mode 100644 txpipe-min-failing/Dockerfile diff --git a/.github/workflows/build-min-image.yml b/.github/workflows/build-min-image.yml new file mode 100644 index 0000000..5ca2caf --- /dev/null +++ b/.github/workflows/build-min-image.yml @@ -0,0 +1,40 @@ +name: Build Minimum Failing Image + +on: workflow_dispatch + +jobs: + build: + name: Build Image + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + + - name: Build & Push Docker image + uses: docker/build-push-action@v5 + with: + context: ./txpipe-min-failing + file: ./txpipe-min-failing/Dockerfile + push: true + tags: ghcr.io/lsstdesc/mpi4py-min-failing + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/txpipe-min-failing/Dockerfile b/txpipe-min-failing/Dockerfile new file mode 100644 index 0000000..3ebb58e --- /dev/null +++ b/txpipe-min-failing/Dockerfile @@ -0,0 +1,33 @@ +FROM condaforge/mambaforge:24.3.0-0 + +# This is matching what the NERSC docs use +ENV MPI_VERSION=4.0.2 + +# Show some linux version info +RUN cat /etc/*-release + +# Install make +RUN apt-get update -y \ + && DEBIAN_FRONTEND="noninteractive" apt-get install -y make \ + && apt-get clean all + +# We need a C compiler temporarily to install MPICH. +# Then we install following instructions at +# https://docs.nersc.gov/development/containers/shifter/how-to-use/#using-mpi-in-shifter +RUN apt-get update -y \ + && DEBIAN_FRONTEND="noninteractive" apt-get install -y gcc gfortran \ + && mkdir /opt/mpich \ + && cd /opt/mpich \ + && wget http://www.mpich.org/static/downloads/${MPI_VERSION}/mpich-${MPI_VERSION}.tar.gz \ + && tar xvzf mpich-${MPI_VERSION}.tar.gz \ + && cd mpich-${MPI_VERSION} \ + && ./configure --disable-wrapper-rpath --disable-cxx --with-device=ch3 && make \ + && make install \ + && rm -rf /opt/mpich \ + && apt-get remove --purge -y gcc gfortran + +RUN /sbin/ldconfig + +# check we are using the conda python +RUN which python3 +RUN python3 -m pip install mpi4py