Skip to content

Commit

Permalink
WIP: dummay tags for action debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 12, 2023
1 parent dcd6464 commit e8d7685
Show file tree
Hide file tree
Showing 13 changed files with 250 additions and 162 deletions.
112 changes: 72 additions & 40 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build base compilers docker images

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
paths:
Expand All @@ -16,11 +20,11 @@ on:

jobs:
#######################################################
################### CPU ###############################
############## Basic gcc CPU ##########################
#######################################################
deploy-cpu-bases:
name: ${{ matrix.tag }}
runs-on: ${{ matrix.runner }}
name: "cpu-base"
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"

Expand All @@ -46,35 +50,66 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: GCC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=gcc'
tags: 'devitocodes/bases:cpu-gcc'
target: 'gcc'
build-args: 'arch=gcc'
tags: 'devitocodes/test-bases:cpu-gcc'

#######################################################
############## Intel OneApi CPU #######################
#######################################################
deploy-oneapi-bases:
name: "oneapi-base"
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Check event name
run: echo ${{ github.event_name }}

- name: Docker image
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: cleanup
run: docker system prune -a -f

- name: ICX image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=icx'
tags: 'devitocodes/bases:cpu-icx'
target: 'icx'
build-args: 'arch=icx'
tags: 'devitocodes/test-bases:cpu-icx'

- name: Docker image
- name: ICC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.cpu'
push: true
build-args: |
'arch=icc'
tags: 'devitocodes/bases:cpu-icc'
target: 'icc'
build-args: 'arch=icc'
tags: 'devitocodes/test-bases:cpu-icc'

#######################################################
################### Nvidia nvhpc ######################
Expand Down Expand Up @@ -107,42 +142,38 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: NVC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvc'
tags: 'devitocodes/bases:nvidia-nvc'
target: 'nvc'
build-args: 'arch=nvc'
tags: 'devitocodes/test-bases:nvidia-nvc'

- name: Docker image
- name: NVCC image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvcc'
tags: 'devitocodes/bases:nvidia-nvcc'
target: 'nvcc'
build-args: 'arch=nvcc'
tags: 'devitocodes/test-bases:nvidia-nvcc'

- name: Docker image
- name: NVC host image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=nvc-host'
tags: 'devitocodes/bases:cpu-nvc'
target: 'nvc-host'
build-args: 'arch=nvc-host'
tags: 'devitocodes/test-bases:cpu-nvc'

#######################################################
################### Nvidia clang ######################
# # clang is only officialy supporting cuda<11.5. The latest nvidia sdk with cuda 11.5 is 21.11 (last of 2021)
# # We cannot use newer ones such as 22-1 because the package manager automatically installs the latest 2022
# # that re-install the latest (11.7) version on top of it.
# # For more info check https://llvm.org/docs/CompileCudaWithLLVM.html and the Prerequisites
#######################################################
deploy-nvidia-clang-base:
name: "nvidia-clang-base"
Expand Down Expand Up @@ -172,16 +203,15 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: Nvidia clang image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.nvidia'
push: true
build-args: |
'arch=clang'
'ver=nvhpc-21-11'
tags: 'devitocodes/bases:nvidia-clang'
target: 'clang'
build-args: 'arch=clang'
tags: 'devitocodes/test-bases:nvidia-clang'

#######################################################
##################### AMD #############################
Expand Down Expand Up @@ -214,20 +244,22 @@ jobs:
- name: cleanup
run: docker system prune -a -f

- name: Docker image
- name: AMD image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.amd'
push: true
tags: devitocodes/bases:amd
target: 'aomp'
tags: devitocodes/test-bases:amd

- name: Docker image
- name: AMD HIP image
uses: docker/build-push-action@v3
with:
context: .
file: './docker/Dockerfile.amd'
push: true
target: 'hip'
build-args: |
arch=hip
tags: devitocodes/bases:amd-hip
tags: devitocodes/test-bases:amd-hip
26 changes: 13 additions & 13 deletions .github/workflows/docker-devito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,38 @@ jobs:
fail-fast: false
matrix:
include:
- base: 'bases:nvidia-nvc'
- base: 'test-bases:nvidia-nvc'
tag: 'nvidia-nvc'
flag: '--gpus all'
test: 'tests/test_gpu_openacc.py tests/test_gpu_common.py'
runner: ["self-hosted", "nvidiagpu"]

- base: 'bases:nvidia-clang'
- base: 'test-bases:nvidia-clang'
tag: 'nvidia-clang'
flag: '--gpus all'
test: 'tests/test_gpu_openmp.py tests/test_gpu_common.py'
runner: ["self-hosted", "nvidiagpu"]

# Runtime gpu flags from https://hub.docker.com/r/rocm/tensorflow/
- base: 'bases:amd'
- base: 'test-bases:amd'
tag: 'amd'
flag: '--network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add 109 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined'
test: 'tests/test_gpu_openmp.py'
runner: ["self-hosted", "amdgpu"]

- base: 'bases:cpu-gcc'
- base: 'test-bases:cpu-gcc'
tag: "gcc"
flag: ''
test: 'tests/test_operator.py'
runner: ubuntu-latest

- base: 'bases:cpu-icc'
- base: 'test-bases:cpu-icc'
tag: "icc"
flag: ''
test: 'tests/test_operator.py'
runner: ubuntu-latest

- base: 'bases:cpu-icx'
- base: 'test-bases:cpu-icx'
tag: "icx"
flag: ''
test: 'tests/test_operator.py'
Expand Down Expand Up @@ -90,16 +90,16 @@ jobs:
tags: |
type=raw,value=${{ matrix.tag }}-dev
type=raw,value=${{ matrix.tag }}-latest,enable=${{ github.event_name == 'release' }}
type=raw,value=latest,enable=${{ matrix.base == 'bases:cpu-gcc' }}
type=raw,value=latest,enable=${{ matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=${{ matrix.tag }}-,enable=${{ github.event_name == 'release' }}
# Legacy "gpu" tag
type=raw,value=gpu-dev,enable=${{ matrix.base == 'bases:nvidia-nvc' }}
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:nvidia-nvc' }}
type=raw,value=gpu-dev,enable=${{ matrix.base == 'test-bases:nvidia-nvc' }}
type=semver,pattern={{raw}},prefix=gpu-,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:nvidia-nvc' }}
type=semver,pattern={{raw}},value=gpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:nvidia-nvc' }}
# Legacy "cpu" tag
type=raw,value=cpu-dev,enable=${{ matrix.base == 'bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'bases:cpu-gcc' }}
type=raw,value=cpu-dev,enable=${{ matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},prefix=cpu-,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:cpu-gcc' }}
type=semver,pattern={{raw}},value=cpu-latest,enable=${{ github.event_name == 'release' && matrix.base == 'test-bases:cpu-gcc' }}
- name: Check tags
run: echo "${{ steps.meta.outputs.tags }}"
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/pytest-core-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- master

jobs:
build:
test-mpi-basic:
name: pytest-mpi
runs-on: ubuntu-20.04
strategy:
Expand Down Expand Up @@ -52,3 +52,22 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: pytest-mpi

test-mpi-docker:
name: pytest-mpi
runs-on: ubuntu-latest
strategy:
matrix:
arch: [gcc, icc, icx]

steps:
- name: Checkout devito
uses: actions/checkout@v3

- name: Build docker image
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/test-bases:cpu-${{ matrix.arch }}
- name: Test with pytest
run: |
docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img pytest tests/test_mpi.py
4 changes: 2 additions & 2 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ jobs:
- name: Build docker image
if: contains(matrix.name, 'docker')
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/bases:cpu-${{ matrix.arch }}
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/test-bases:cpu-${{ matrix.arch }}
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e DEVITO_ARCH=${{ matrix.arch }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ jobs:
include:
- name: pytest-gpu-omp-nvidia
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
base: "devitocodes/bases:nvidia-clang"
base: "devitocodes/test-bases:nvidia-clang"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm --name testrun-clang-nvidia'

- name: pytest-gpu-acc-nvidia
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openacc.py"
base: "devitocodes/bases:nvidia-nvc"
base: "devitocodes/test-bases:nvidia-nvc"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm --name testrun-nvc'

- name: pytest-gpu-omp-amd
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
tags: ["self-hosted", "amdgpu"]
base: "devitocodes/bases:amd"
base: "devitocodes/test-bases:amd"
test_drive_cmd: "rocm-smi"
# Attach the AMD GPU devices `/dev` and add user to video and render (109 on wampa) group
# Options from https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html
Expand Down
Loading

0 comments on commit e8d7685

Please sign in to comment.