diff --git a/.github/workflows/build-basic-nersc-image.yml b/.github/workflows/build-basic-nersc-image.yml new file mode 100644 index 0000000..654e991 --- /dev/null +++ b/.github/workflows/build-basic-nersc-image.yml @@ -0,0 +1,40 @@ +name: Build NERSC Version + +on: workflow_dispatch + +jobs: + build: + name: Build Basic NERSC 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: ./mpi4py-nersc-version + file: ./mpi4py-nersc-version/Dockerfile + push: true + tags: ghcr.io/lsstdesc/mpi4py-nersc-version + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/mpi4py-nersc-version/Dockerfile b/mpi4py-nersc-version/Dockerfile new file mode 100644 index 0000000..7ada9ed --- /dev/null +++ b/mpi4py-nersc-version/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:latest +WORKDIR /opt + +RUN \ + apt-get update && \ + apt-get install --yes \ + build-essential \ + gfortran \ + python3-dev \ + python3-pip \ + wget && \ + apt-get clean all + +ARG mpich=4.0.2 +ARG mpich_prefix=mpich-$mpich + +RUN \ + wget https://www.mpich.org/static/downloads/$mpich/$mpich_prefix.tar.gz && \ + tar xvzf $mpich_prefix.tar.gz && \ + cd $mpich_prefix && \ + ./configure && \ + make -j 4 && \ + make install && \ + make clean && \ + cd .. && \ + rm -rf $mpich_prefix + +RUN /sbin/ldconfig + +RUN python3 -m pip install mpi4py +