Skip to content
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

Update CI images and workflow actions #1136

Merged
merged 22 commits into from
Mar 21, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-full
name: build-docker
on:
workflow_dispatch:
workflow_call:
Expand All @@ -11,59 +11,49 @@ jobs:
# TODO: this currently includes non-GPU builds as well
# and won't actually run on device
gpu:
name: gpu
name: >-
${{format('{0}{1}{2}-{3}-{4}',
matrix.special,
matrix.special && '-' || '',
matrix.geometry,
matrix.buildtype,
matrix.image)}}
strategy:
fail-fast: false
matrix:
special: [null]
geometry: ['orange', 'vecgeom']
buildtype: ['debug', 'ndebug']
image: ['ubuntu-cuda', 'centos-rocm']
geometry: ["orange", "vecgeom"]
buildtype: ["debug", "ndebug"]
image: ["ubuntu-cuda", "centos-rocm"]
exclude:
- geometry: 'vecgeom'
image: 'centos-rocm' # VecGeom not installed on HIP
- buildtype: 'debug'
image: 'centos-rocm' # Debug builds don't work with HIP
- geometry: "vecgeom"
image: "centos-rocm" # VecGeom not installed on HIP
- buildtype: "debug"
image: "centos-rocm" # Debug builds don't work with HIP
include:
- special: 'asan'
geometry: 'orange'
sethrj marked this conversation as resolved.
Show resolved Hide resolved
buildtype: 'reldeb'
image: 'centos-rocm'
- special: 'minimal'
geometry: 'orange'
buildtype: 'debug'
image: 'centos-rocm'
- special: 'float'
geometry: 'orange'
buildtype: 'debug'
image: 'centos-rocm'
- special: 'float'
geometry: 'orange'
buildtype: 'ndebug'
image: 'centos-rocm'
- geometry: 'geant4'
buildtype: 'reldeb'
image: 'centos-rocm'
- geometry: 'vecgeom'
buildtype: 'reldeb'
image: 'ubuntu-cuda'
- special: 'clhep'
geometry: 'vecgeom'
buildtype: 'debug'
image: 'ubuntu-cuda'
- special: "asan"
geometry: "orange"
buildtype: "reldeb"
image: "centos-rocm"
- geometry: "vecgeom"
buildtype: "reldeb"
image: "ubuntu-cuda"
env:
ASAN_OPTIONS: "detect_leaks=0"
CELER_TEST_STRICT: 1
CELER_DISABLE_DEVICE: 1 # IMPORTANT
CMAKE_PRESET: >-
${{matrix.buildtype}}-${{matrix.geometry}}${{matrix.special && '-' || ''}}${{matrix.special}}
${{format('{0}-{1}{2}{3}',
matrix.buildtype,
matrix.geometry,
matrix.special && '-' || '',
matrix.special)}}
runs-on: ubuntu-latest
container:
image: >-
docker.io/celeritas/${{
matrix.image == 'ubuntu-cuda' && 'ci-jammy-cuda11:2023-08-02'
|| matrix.image == 'centos-rocm' && 'ci-centos7-rocm5:2022-12-14.2'
|| null
}}
# See https://github.com/actions/checkout/issues/956
options: --user root
Expand Down Expand Up @@ -108,11 +98,12 @@ jobs:
done
./bin/celer-sim --version
- name: Build examples
# TODO: asan needs -fsanitize=address
# TODO: rocm+ndebug fails to propagate HIP library link
# TODO: ASAN requires flags downstream
if: >-
${{ matrix.special != 'asan'
&& !(matrix.image == 'centos-rocm' && matrix.buildtype == 'ndebug')
${{
!(matrix.image == 'centos-rocm' && matrix.buildtype == 'ndebug')
&& (matrix.special != 'asan')
}}
run: |
. /etc/profile
Expand Down
37 changes: 15 additions & 22 deletions .github/workflows/build-fast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:

jobs:
linux:
name: ${{matrix.runner}}-${{matrix.compiler}}-${{matrix.version}}
name: "${{matrix.runner}}-${{matrix.compiler}}-${{matrix.version}}"
strategy:
matrix:
include:
Expand All @@ -26,16 +26,17 @@ jobs:
- runner: jammy
compiler: clang
version: 15
runs-on: >-
${{ matrix.runner == 'focal' && 'ubuntu-20.04'
|| matrix.runner == 'jammy' && 'ubuntu-22.04'
|| null
}}
env:
GHA_JOB_NAME: "${{matrix.runner}}-${{matrix.compiler}}-${{matrix.version}}"
CCACHE_DIR: "${{github.workspace}}/.ccache"
CCACHE_MAXSIZE: "10G"
CCACHE_MAXSIZE: "100Mi"
CMAKE_PRESET: fast
CC: ${{matrix.compiler}}-${{matrix.version}}
CXX: ${{matrix.compiler == 'gcc' && 'g++' || 'clang++'}}-${{matrix.version}}
runs-on: >-
${{ matrix.runner == 'focal' && 'ubuntu-20.04'
|| matrix.runner == 'jammy' && 'ubuntu-22.04'
}}
steps:
- name: Install dependencies
run: |
Expand All @@ -52,30 +53,22 @@ jobs:
- name: Check out Celeritas
uses: actions/checkout@v4
- name: Cache ccache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ccache-${{matrix.runner}}-${{matrix.compiler}}-${{matrix.version}}-${{github.run_id}}
restore-keys: ccache-${{matrix.runner}}-${{matrix.compiler}}-${{matrix.version}}
key: ccache-${{env.GHA_JOB_NAME}}-${{github.run_id}}
restore-keys: |
ccache-${{env.GHA_JOB_NAME}}
- name: Zero ccache stats
run: |
ccache -z
- name: Configure Celeritas
run: |
mkdir build && cd build
sethrj marked this conversation as resolved.
Show resolved Hide resolved
cmake -GNinja \
ln -fs scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json
cmake --preset=${CMAKE_PRESET} \
-DCeleritas_GIT_DESCRIBE="${{github.event.pull_request
&& format(';-pr.{0};', github.event.pull_request.number)
|| format(';-{0};', github.ref_name)}}" \
-DCELERITAS_BUILD_DEMOS:BOOL=ON \
-DCELERITAS_BUILD_TESTS:BOOL=ON \
-DCELERITAS_USE_SWIG=OFF \
-DCELERITAS_DEBUG:BOOL=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -Wno-error=deprecated-declarations" \
..
|| format(';-{0};', github.ref_name)}}"
- name: Build all
working-directory: build
run: |
Expand Down
93 changes: 59 additions & 34 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,47 @@ env:
SPACK_REF: 968ad02473b12f6305cc1fe19f2a0d706f171154

jobs:
linux:
name: jammy-g4-${{matrix.geant}}
spack:
name: >-
${{format('{0}{1}{2}{3}{4}',
matrix.geometry,
matrix.special && '-' || '',
matrix.special,
matrix.geant && '-g4@' || '',
matrix.geant)}}
strategy:
fail-fast: false
matrix:
compiler: [clang]
version: [15]
geometry: ["vecgeom"]
special: [null]
geant: ["10.5", "10.6", "10.7", "11.0", "11.1", "11.2"]
experimental: [false]
continue-on-error: ${{matrix.experimental}}
runs-on: ubuntu-22.04
permissions:
packages: write
include:
- geometry: "orange"
special: "minimal"
geant: null
- geometry: "orange"
special: "float"
geant: "11.0"
- geometry: "vecgeom"
special: "clhep"
geant: "11.0"
- geometry: "geant4"
special: null
geant: "11.0"
env:
CCACHE_DIR: "${{github.workspace}}/.ccache"
CCACHE_MAXSIZE: "1G"
CELERITAS_VERSION: "0.5.0"
CCACHE_MAXSIZE: "100Mi"
CMAKE_PRESET: >-
${{format('reldeb-{0}{1}{2}',
matrix.geometry,
matrix.special && '-' || '',
matrix.special)}}
SPACK_VIEW: "/opt/spack-view"
SPACK_BUILDCACHE: "celer-buildcache" # see spack.yaml
CC: ${{matrix.compiler}}-${{matrix.version}}
CXX: ${{matrix.compiler == 'gcc' && 'g++' || 'clang++'}}-${{matrix.version}}
CC: "clang-15"
CXX: "clang++-15"
runs-on: ubuntu-22.04
continue-on-error: false
steps:
- name: Check out Celeritas
uses: actions/checkout@v4
Expand All @@ -47,8 +68,16 @@ jobs:
- name: Initialize spack environment
run: |
cp scripts/ci/spack.yaml .
spack -e . add geant4@${{matrix.geant}}
spack -e . config add packages:all:require:"'%${{matrix.compiler}}@${{matrix.version}} target=x86_64_v3'"
if [ "${{matrix.geometry}}" == "vecgeom" ]; then
spack -e . add vecgeom
fi
if [ "${{matrix.special}}" != "minimal" ]; then
spack -e . add root
fi
if [ "${{matrix.geant}}" != "" ]; then
spack -e . add geant4@${{matrix.geant}}
fi
spack -e . config add packages:all:require:"'%clang@15 target=x86_64_v3'"
spack -e . compiler find
# Add the spack ref so that updating spack will reconcretize
echo "# Concretized with ${{env.SPACK_REF}}" >> spack.yaml
Expand Down Expand Up @@ -81,36 +110,33 @@ jobs:
uses: actions/cache@v4
with:
path: ${{env.CCACHE_DIR}}
key: ccache-spack-${{matrix.compiler}}-${{matrix.version}}-${{matrix.geant}}-${{github.run_id}}
key: ccache-${{env.CMAKE_PRESET}}-${{matrix.geant}}-${{github.run_id}}
# NOTE: remove ccache-spack-clang-15* in follow-up PR
restore-keys: |
ccache-spack-${{matrix.compiler}}-${{matrix.version}}-${{matrix.geant}}-
ccache-spack-${{matrix.compiler}}-${{matrix.version}}-
ccache-${{env.CMAKE_PRESET}}-${{matrix.geant}}
ccache-${{env.CMAKE_PRESET}}
ccache-spack-clang-15-${{matrix.geant}}-
ccache-spack-clang-15-
- name: Zero ccache stats
run: |
ccache -z
- name: Configure Celeritas
run: |
mkdir build && cd build
cmake -GNinja --log-level=VERBOSE \
-DCELERITAS_BUILD_DEMOS:BOOL=ON \
-DCELERITAS_BUILD_TESTS:BOOL=ON \
-DCELERITAS_USE_SWIG=OFF \
-DCELERITAS_USE_Geant4=ON \
-DCELERITAS_DEBUG:BOOL=ON \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="${{github.workspace}}/install" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -pedantic -Wno-error=deprecated-declarations" \
..

ln -fs scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json
cmake --preset=${CMAKE_PRESET} --log-level=VERBOSE
- name: Build all
working-directory: build
run: |
ninja -v -k0
- name: Run tests
working-directory: build
continue-on-error: true # TODO: disable or fix failing tests
continue-on-error: ${{matrix.geant != '11.0'}} # TODO: disable or fix failing tests
run: |
if [ "${{matrix.geant}}" == "11.0" ]; then
# TODO: add 11.0.4 and clhep version to tests
#export CELER_TEST_STRICT=1
echo "warning: strict testing is disabled"
fi
ctest --parallel $(nproc) --timeout 15 --output-on-failure \
--test-output-size-passed=32768 --test-output-size-failed=1048576
- name: Install
Expand All @@ -128,11 +154,10 @@ jobs:
- name: Build examples
run: |
. ${SPACK_VIEW}/rc
CMAKE_PRESET=spack-vecgeom ./scripts/ci/test-examples.sh
./scripts/ci/test-examples.sh
- name: Show ccache stats
if: ${{!cancelled()}}
run: |
ccache -s


# vim: set nowrap tw=100:
21 changes: 14 additions & 7 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ jobs:
working-directory: build
run: |
ninja doxygen
- name: Upload pages artifacts
- name: Upload artifacts
if: ${{env.celer_upload_doc}}
id: upload-pages-user
uses: actions/upload-pages-artifact@v2
uses: actions/upload-artifact@v4
with:
path: build/doc/doxygen-html
name: doc-dev
if-no-files-found: error
overwrite: true
retention-days: 7
user:
runs-on: ubuntu-latest
steps:
Expand All @@ -60,7 +63,7 @@ jobs:
sudo apt-get -y update
sudo apt-get -y install \
cmake graphviz ninja-build doxygen gcc
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Check out Celeritas
Expand All @@ -84,12 +87,16 @@ jobs:
working-directory: build
run: |
ninja doc
- name: Upload pages artifacts
- name: Upload artifacts
if: ${{env.celer_upload_doc}}
id: upload-pages-user
uses: actions/upload-pages-artifact@v2
uses: actions/upload-artifact@v4
with:
path: build/doc/html
name: doc-user
if-no-files-found: error
overwrite: true
retention-days: 7

#TODO: deploy with actions/deploy-pages@v2 ?

# vim: set nowrap tw=100:
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
steps:
- name: Success
run: "true"
build-full:
build-docker:
needs: [all-prechecks]
uses: ./.github/workflows/build-full.yml
uses: ./.github/workflows/build-docker.yml
build-spack:
needs: [all-prechecks]
uses: ./.github/workflows/build-spack.yml
Expand All @@ -39,7 +39,7 @@ jobs:
all:
if: ${{always()}}
needs:
- build-full
- build-docker
- build-spack
runs-on: ubuntu-latest
steps:
Expand Down
Loading
Loading