Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/pytest-petsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ jobs:

- name: Build docker image
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=zoeleibowitz/bases:cpu-${{ matrix.arch }} --build-arg petscinstall=petsc
docker tag devito_img ${{ secrets.DOCKER_USERNAME }}/devito_img:latest
docker build -f docker/Dockerfile.devito --build-arg base=zoeleibowitz/petsc_image:latest --tag zoeleibowitz/petsc_devito_image:latest .

- name: Push Docker image to DockerHub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/devito_img:latest
docker push ${{ secrets.DOCKER_USERNAME }}/petsc_devito_image:latest

- name: Set run prefix
run: |
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun zoeleibowitz/petsc_devito_image:latest" >> $GITHUB_ENV
id: set-run

- name: Set tests
Expand Down
23 changes: 1 addition & 22 deletions docker/Dockerfile.devito
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,8 @@

# Base image with compilers
ARG base=devitocodes/bases:cpu-gcc
ARG petscinstall=""

FROM $base AS copybase

################## Install PETSc ############################################
FROM copybase AS petsccopybase

RUN apt-get update && apt-get install -y git && \
python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir --upgrade pip && \
/venv/bin/pip install --no-cache-dir --no-binary numpy numpy && \
mkdir -p /opt/petsc && \
cd /opt/petsc && \
git clone -b release https://gitlab.com/petsc/petsc.git petsc && \
cd petsc && \
./configure --with-fortran-bindings=0 --with-mpi-dir=/opt/openmpi --with-openblas-include=$(pkg-config --variable=includedir openblas) --with-openblas-lib=$(pkg-config --variable=libdir openblas)/libopenblas.so PETSC_ARCH=devito_build && \
make all

ARG petscinstall=""
FROM ${petscinstall}copybase AS builder
FROM $base AS builder

# User/Group Ids
ARG USER_ID=1000
Expand Down Expand Up @@ -87,9 +69,6 @@ ARG GROUP_ID=1000
ENV HOME=/app
ENV APP_HOME=/app

ENV PETSC_ARCH="devito_build"
ENV PETSC_DIR="/opt/petsc/petsc"

# Create the home directory for the new app user.
# Create an app user so our program doesn't run as root.
# Chown all the files to the app user.
Expand Down
25 changes: 25 additions & 0 deletions docker/Dockerfile.petsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
##############################################################
# Dockerfile.petsc: Installs PETSc
##############################################################

# Base image with compilers
# TODO: to be updated, but made some additions to Dockerfile.cpu so need to
# use the one from my dockerhub
ARG base=zoeleibowitz/bases:cpu-gcc

RUN apt-get update && apt-get install -y git && \
python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir --upgrade pip && \
/venv/bin/pip install --no-cache-dir --no-binary numpy numpy && \
mkdir -p /opt/petsc && \
cd /opt/petsc && \
git clone -b release https://gitlab.com/petsc/petsc.git petsc && \
cd petsc && \
./configure --with-fortran-bindings=0 --with-mpi-dir=/opt/openmpi \
--with-openblas-include=$(pkg-config --variable=includedir openblas) \
--with-openblas-lib=$(pkg-config --variable=libdir openblas)/libopenblas.so \
PETSC_ARCH=devito_build && \
make all

ENV PETSC_DIR="/opt/petsc/petsc"
ENV PETSC_ARCH="devito_build"
Loading