-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve CI #44
Merged
Merged
Improve CI #44
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5cbbb4a
Rename images and explicitly specify them
pzehner c65afe4
Increase ctest verbosity
pzehner 95a19cd
Fix CI
pzehner cc52e58
Fix CI
pzehner ebf6e16
Build base images on push on main
pzehner 4c7f2a9
Use tags for base images
pzehner a44d017
Output failed tests only
pzehner 40a68f5
Fix incorrect image tag hash value
pzehner 57db45f
Mutualize check Docker files
pzehner 417cad6
Fix CI
pzehner 6fe88fe
Fix list of changed Docker files
pzehner 37c6091
Use latest ROCM image on Ubuntu 20.04
pzehner 05e6626
Fix wrong display of changed images
pzehner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Check if Docker images have changed. In that case, proposes images suffix and | ||
# tag. | ||
|
||
name: Check Docker files | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
event_name: | ||
description: "Event name of the calling workflow" | ||
required: true | ||
type: string | ||
|
||
outputs: | ||
docker_files_have_changed: | ||
description: "True if any Docker file was modified" | ||
value: ${{ jobs.check_docker_files.outputs.docker_files_have_changed }} | ||
image_suffix: | ||
description: "Suffix of the images" | ||
value: ${{ jobs.check_docker_files.outputs.image_suffix }} | ||
image_tag: | ||
description: "Tag of the images" | ||
value: ${{ jobs.check_docker_files.outputs.image_tag }} | ||
|
||
jobs: | ||
check_docker_files: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
# true if any Docker file was modified in the PR (PR mode) or since last pushed commit (push mode) | ||
docker_files_have_changed: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} | ||
# use "pr" as image name suffix if on PR mode and if any Docker file was modified, otherwise use "main"; | ||
# this is intended to avoid a PR to alter Docker images for other PRs or for the main branch | ||
image_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && inputs.event_name == 'pull_request' && 'pr' || 'main' }} | ||
# use "<hash>" as image name tag if on PR mode and if any Docker file was modified, otherwise use "latest"; | ||
# this is intended to distinguish PR images from each other | ||
image_tag: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && inputs.event_name == 'pull_request' && github.sha || 'latest' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get changed Docker files | ||
id: get_changed_docker_files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: docker/**/Dockerfile | ||
|
||
- name: List changed Docker files | ||
if: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.get_changed_docker_files.outputs.all_changed_files }} | ||
run: | | ||
for file in $ALL_CHANGED_FILES; do | ||
echo "$file was changed" | ||
done |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,34 +29,10 @@ jobs: | |
clangFormatVersion: 12 | ||
|
||
check_docker_files: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
# true if any Docker file was modified in the PR (PR mode) or since last pushed commit (push mode) | ||
docker_files_have_changed: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' }} | ||
# use "pr" as image name suffix if on PR mode and if any Docker file was modified, otherwise use "main" | ||
# this is intended to avoid a PR test to alter Docker images for other PRs or for the main branch | ||
image_name_suffix: ${{ steps.get_changed_docker_files.outputs.any_changed == 'true' && github.event_name == 'pull_request' && 'pr' || 'main' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
uses: ./.github/workflows/__check_docker_files.yaml | ||
|
||
- name: Get changed Dockerfiles | ||
id: get_changed_docker_files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: docker/**/Dockerfile | ||
|
||
- name: List changed Dockerfiles | ||
if: ${{ steps.docker_files_have_changed.outputs.any_changed == 'true' }} | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.docker_files_have_changed.outputs.all_changed_files }} | ||
run: | | ||
for file in "$ALL_CHANGED_FILES"; do | ||
echo "$file was changed" | ||
done | ||
with: | ||
event_name: ${{ github.event_name }} | ||
|
||
build_base: | ||
needs: check_docker_files | ||
|
@@ -66,7 +42,8 @@ jobs: | |
uses: ./.github/workflows/__build_base.yaml | ||
|
||
with: | ||
image_name_suffix: ${{ needs.check_docker_files.outputs.image_name_suffix }} | ||
image_suffix: ${{ needs.check_docker_files.outputs.image_suffix }} | ||
image_tag: ${{ needs.check_docker_files.outputs.image_tag }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -82,18 +59,22 @@ jobs: | |
matrix: | ||
backend: | ||
- name: openmp | ||
image: gcc | ||
c_compiler: gcc | ||
cxx_compiler: g++ | ||
cmake_flags: -DKokkos_ENABLE_OPENMP=ON | ||
- name: cuda | ||
image: nvcc | ||
c_compiler: gcc | ||
cxx_compiler: g++ | ||
cmake_flags: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON | ||
- name: hip | ||
image: rocm | ||
c_compiler: hipcc | ||
cxx_compiler: hipcc | ||
cmake_flags: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON | ||
- name: sycl | ||
image: intel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As well, better to call this image |
||
c_compiler: icx | ||
cxx_compiler: icpx | ||
# building for Intel PVC was unsuccessful without the proper device | ||
|
@@ -124,7 +105,7 @@ jobs: | |
|
||
- name: Configure | ||
run: | | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
cmake -B build \ | ||
-DCMAKE_INSTALL_PREFIX=/work/install \ | ||
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | ||
|
@@ -139,7 +120,7 @@ jobs: | |
|
||
- name: Build | ||
run: | | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
cmake --build build -j $(( $(nproc) * 2 + 1 )) | ||
|
||
- name: Prepare artifacts | ||
|
@@ -157,21 +138,21 @@ jobs: | |
|
||
- name: Install | ||
run: | | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
cmake --install build | ||
|
||
- name: Configure and build test code | ||
# Use the built and installed Kokkos FFT library to build a test code | ||
run: | | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
cmake -B build_test \ | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | ||
-DCMAKE_C_COMPILER=${{ matrix.backend.c_compiler }} \ | ||
-DCMAKE_CXX_COMPILER=${{ matrix.backend.cxx_compiler }} \ | ||
-DCMAKE_CXX_STANDARD=17 \ | ||
-DCMAKE_PREFIX_PATH=/work/install \ | ||
install_test | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
docker run -v ${{ github.workspace }}:/work ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
cmake --build build_test -j $(( $(nproc) * 2 + 1 )) | ||
|
||
test: | ||
|
@@ -189,9 +170,11 @@ jobs: | |
backend: | ||
# run CUDA tests on Ruche supercomputer | ||
- name: cuda | ||
image: nvcc | ||
runner: [self-hosted, cuda] | ||
# run OpenMP tests on Azure server | ||
- name: openmp | ||
image: gcc | ||
runner: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -206,18 +189,18 @@ jobs: | |
|
||
- name: Pull Singularity image | ||
# pulling the image in advance seems necessary as sometimes invoking `singularity run` on the image URL fails because it cannot find ghcr.io | ||
run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}:latest | ||
run: singularity pull oras://ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_singularity_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} | ||
if: ${{ matrix.backend.name == 'cuda' }} | ||
|
||
- name: Run CUDA tests within Slurm job and Singularity image | ||
run: | | ||
srun --nodes=1 --time=01:00:00 -p gpua100 --gres=gpu:1 \ | ||
singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.name }}_singularity_${{ needs.check_docker_files.outputs.image_name_suffix }}_latest.sif \ | ||
ctest | ||
singularity run --nv --bind $PWD/build:/work/build -H /work/build base_${{ matrix.backend.image }}_singularity_${{ needs.check_docker_files.outputs.image_suffix }}_${{ needs.check_docker_files.outputs.image_tag }}.sif \ | ||
ctest --output-on-failure | ||
if: ${{ matrix.backend.name == 'cuda' }} | ||
|
||
- name: Run OpenMP tests within Docker image | ||
run: | | ||
docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.name }}_${{ needs.check_docker_files.outputs.image_name_suffix }} \ | ||
ctest | ||
docker run -v $PWD/build:/work/build -w /work/build ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ | ||
ctest --output-on-failure | ||
if: ${{ matrix.backend.name == 'openmp' }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
# Recreate the base images inconditionnaly on a regural basis. This is to | ||
# ensure that anybody using the Docker files for local development does not | ||
# encounter weird bugs unnoticed by the CI, because the images would be too | ||
# old. | ||
# Recreate the base images inconditionnaly on a regural basis and on push on | ||
# the main branch. This is to ensure that anybody using the Docker files for | ||
# local development does not encounter weird bugs unnoticed by the CI, because | ||
# the images would be too old. | ||
|
||
name: Pre-build base images | ||
|
||
on: | ||
schedule: | ||
- cron: "0 1 2,16 * *" # every 2nd and 16th of the month at 1am UTC | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check_docker_files: | ||
uses: ./.github/workflows/__check_docker_files.yaml | ||
|
||
with: | ||
event_name: ${{ github.event_name }} | ||
|
||
build_base: | ||
needs: check_docker_files | ||
|
||
# run inconditionnaly on schedule mode or if Docker files changed on other modes | ||
if: ${{ github.event_name == 'schedule' || needs.check_docker_files.outputs.docker_files_have_changed == 'true' }} | ||
|
||
uses: ./.github/workflows/__build_base.yaml |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG BASE=rocm/dev-ubuntu-20.04:5.4 | ||
ARG BASE=rocm/dev-ubuntu-20.04 | ||
FROM $BASE | ||
|
||
ARG ADDITIONAL_PACKAGES | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may prefer to call this image
hipcc
.