Docker Image CI #431
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
setup: | |
runs-on: ubuntu-22.04 | |
outputs: | |
branch: ${{ steps.determine_branch.outputs.branch }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Determine branch | |
id: determine_branch | |
run: | | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT | |
else | |
echo "branch=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
fi | |
- name: free disk space | |
run: | | |
docker system prune --volumes -af | |
gnu_debug: | |
runs-on: ubuntu-22.04 | |
needs: setup | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Build Docker image with debug PETSc | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: false | |
file: ./dockerfiles/Dockerfile | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-c-debug | |
gnu_opt: | |
runs-on: ubuntu-22.04 | |
needs: [setup] | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Docker image for pull requests | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
file: ./dockerfiles/Dockerfile | |
tags: stevendargaville/pflare:latest | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-c-opt | |
gnu_opt_64_bit: | |
runs-on: ubuntu-22.04 | |
needs: [setup] | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Docker image for pull requests with 64-bit PETSc | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
file: ./dockerfiles/Dockerfile_64_bit | |
tags: stevendargaville/pflare_64_bit:latest | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-c-opt | |
gnu_opt_kokkos: | |
runs-on: ubuntu-22.04 | |
needs: [setup] | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Build Docker image with KOKKOS and PETSc | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: false | |
file: ./dockerfiles/Dockerfile_kokkos | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-c-opt | |
gnu_opt_64_bit_kokkos: | |
runs-on: ubuntu-22.04 | |
needs: [setup] | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Build Docker image with KOKKOS and 64-bit PETSc | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: false | |
file: ./dockerfiles/Dockerfile_kokkos | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-c-opt-64bit | |
# Currently nvidia fortran compiler breaks on petsc 3.23 | |
# nvidia_opt: | |
# runs-on: ubuntu-22.04 | |
# needs: [setup] | |
# env: | |
# BRANCH: ${{ needs.setup.outputs.branch }} | |
# steps: | |
# - name: Build Docker image with PETSc and NVIDIA compilers | |
# uses: docker/build-push-action@v2 | |
# with: | |
# platforms: linux/amd64 | |
# push: false | |
# file: ./dockerfiles/Dockerfile_nvidia | |
# build-args: | | |
# BRANCH=${{ env.BRANCH }} | |
# ARCH=arch-linux-nvidia | |
intel_opt_serial_test: | |
runs-on: ubuntu-22.04 | |
needs: [setup] | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
- name: Build Docker image with PETSc and Intel | |
uses: docker/build-push-action@v2 | |
with: | |
platforms: linux/amd64 | |
push: false | |
file: ./dockerfiles/Dockerfile_intel | |
build-args: | | |
BRANCH=${{ env.BRANCH }} | |
ARCH=arch-linux-intel | |
# GPU testing | |
# Have to build the entirity of the stack given the petsc configure | |
# needs to detect the gpu | |
gnu_debug_gpu: | |
runs-on: ubicloud-gpu | |
needs: [setup] | |
# This conditional ensures the job only runs when manually triggered | |
if: github.event_name == 'workflow_dispatch' | |
# Specify the protected environment to ensure gpu builds are only triggered | |
# by the correct people | |
environment: protected-manual-builds | |
env: | |
BRANCH: ${{ needs.setup.outputs.branch }} | |
steps: | |
# Run our tests on GPU | |
- name: Test GPU | |
run: | | |
export BRANCH="${{ env.BRANCH }}" && | |
echo "Using branch: $BRANCH" && | |
set -e && | |
echo '=== GPU Information ===' && | |
nvidia-smi && | |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \ | |
autoconf \ | |
automake \ | |
bash-completion \ | |
ca-certificates \ | |
chrpath \ | |
cmake \ | |
curl \ | |
g++ \ | |
gcc \ | |
gfortran \ | |
git \ | |
less \ | |
libblis-serial-dev \ | |
liblapack-dev \ | |
libtool \ | |
locales \ | |
m4 \ | |
make \ | |
openssl \ | |
pkg-config \ | |
ripgrep \ | |
zlib1g-dev \ | |
python3-virtualenv \ | |
python3-venv \ | |
python3-dev \ | |
wget \ | |
valgrind \ | |
vim && | |
export PETSC_DIR=`pwd`/petsc && export PETSC_ARCH=arch-linux-c-debug && | |
git clone --depth=1 --branch=release https://gitlab.com/petsc/petsc.git && \ | |
cd petsc && \ | |
python3 configure \ | |
--with-debugging=1 \ | |
--download-metis \ | |
--download-parmetis \ | |
--download-fblaslapack \ | |
--with-cuda \ | |
--download-kokkos \ | |
--download-kokkos-kernels \ | |
--with-cuda-arch=89 \ | |
--download-mpich \ | |
&& \ | |
make && make PETSC_DIR=/home/runner/work/PFLARE/PFLARE/petsc PETSC_ARCH=arch-linux-c-debug check && | |
git clone -b "$BRANCH" https://github.com/PFLAREProject/PFLARE.git && | |
cd PFLARE && | |
export PFLARE_KOKKOS_DEBUG=1 && | |
export PETSC_OPTIONS='-on_error_abort -mat_type aijkokkos -vec_type kokkos -dm_mat_type aijkokkos -dm_vec_type kokkos' && | |
make && make build_tests && make tests |