Skip to content

Commit db0bd1c

Browse files
author
Lionel Untereiner
committed
ci: split ci into atomic workflows
1 parent 0db85be commit db0bd1c

File tree

5 files changed

+401
-0
lines changed

5 files changed

+401
-0
lines changed

.github/workflows/ci_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,4 @@ jobs:
397397
needs.cuda_builds.result == 'success' &&
398398
needs.run_integrated_tests.result == 'success'
399399
}}
400+

.github/workflows/compliance.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: Compliance Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
workflow_dispatch:
7+
8+
# Cancels in-progress workflows for a PR when updated
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
# Please define `build.args.GEOS_TPL_TAG` in `.devcontainer/devcontainer.json`
14+
15+
jobs:
16+
# Checks if PR title follows conventional semantics
17+
semantic_pull_request:
18+
permissions:
19+
pull-requests: write # for amannn/action-semantic-pull-request to analyze PRs and
20+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
21+
contents: read
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Check if the PR name has conventional semantics
26+
if: github.event_name == 'pull_request'
27+
uses: amannn/[email protected]
28+
id: lint_pr_title
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
wip: true
33+
# Configure that a scope doesn't need to be provided.
34+
requireScope: false
35+
36+
# Jobs will be cancelled if PR is a draft.
37+
# PR status must be "Open" to run CI.
38+
is_not_draft_pull_request:
39+
needs: [semantic_pull_request]
40+
# Everywhere in this workflow, we use the most recent ubuntu distribution available in Github Actions
41+
# to ensure maximum support of google cloud's sdk.
42+
runs-on: ubuntu-22.04
43+
outputs:
44+
DOCKER_IMAGE_TAG: ${{ steps.extract_docker_image_tag.outputs.DOCKER_IMAGE_TAG }}
45+
steps:
46+
- name: Check that the PR is not a draft (cancel rest of jobs otherwise)
47+
id: extract_pr_info
48+
run: |
49+
if [[ ${{github.event_name}} == 'pull_request' ]]; then
50+
# We do not rely on the `github.event.pull_request.labels` information since it's cached at the job.
51+
# Changing labels or assignee in the PR would not allow to simply re-run the job with a different outcome.
52+
pr_json=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }})
53+
54+
# We stop the workflow if the pr is draft
55+
draft_status=$(echo ${pr_json} | jq '.draft')
56+
echo "Draft status of PR is ${draft_status}."
57+
if [[ $draft_status == true ]]; then exit 1 ; fi
58+
fi
59+
60+
61+
# The TPL tag is contained in the codespaces configuration to avoid duplications.
62+
- name: Checkout .devcontainer/devcontainer.json
63+
uses: actions/[email protected]
64+
with:
65+
sparse-checkout: |
66+
.devcontainer/devcontainer.json
67+
sparse-checkout-cone-mode: false
68+
submodules: false
69+
lfs: false
70+
fetch-depth: 1
71+
- name: Extract docker image tag
72+
id: extract_docker_image_tag
73+
run: |
74+
echo "DOCKER_IMAGE_TAG=$(jq '.build.args.GEOS_TPL_TAG' -r .devcontainer/devcontainer.json)" >> "$GITHUB_OUTPUT"
75+
76+
# PR must be assigned to be merged.
77+
# This job will fail if this is not the case.
78+
if_not_unassigned_pull_request:
79+
needs: [is_not_draft_pull_request]
80+
runs-on: ubuntu-22.04
81+
steps:
82+
- name: If this is a PR, Check that it is assigned
83+
run: |
84+
if [[ ${{github.event_name}} != 'pull_request' ]]; then exit 0 ; fi
85+
pr_json=$(curl -H "Accept: application/vnd.github+json" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }})
86+
NUM_ASSIGNEES=$(echo ${pr_json} | jq '.assignees | length')
87+
echo "There are ${NUM_ASSIGNEES} assignees on this PR."
88+
if [[ $NUM_ASSIGNEES == 0 ]]; then exit 1 ; fi
89+
90+
# Validates that the PR is still pointing to the HEAD of the main branch of the submodules repositories.
91+
# (There are exceptions, read the script about those).
92+
are_submodules_in_sync:
93+
needs: [is_not_draft_pull_request]
94+
runs-on: ubuntu-22.04
95+
steps:
96+
# The integrated test submodule repository contains large data (using git lfs).
97+
# To save time (and money) we do not let Github Actions automatically clone all our (lfs) subrepositories and do it by hand.
98+
- name: Checkout Repository
99+
uses: actions/[email protected]
100+
with:
101+
# Let script update submodules; Github Actions submodule history causes error
102+
submodules: false
103+
lfs: false
104+
fetch-depth: 1
105+
- name: Check that submodules are up to date
106+
run: "scripts/test_submodule_updated.sh"
107+
108+
check_code_style_and_documentation:
109+
name: ${{ matrix.name }}
110+
needs: [is_not_draft_pull_request]
111+
strategy:
112+
fail-fast : false
113+
matrix:
114+
include:
115+
# Validates the code-style using uncrustify
116+
- name: Check code style
117+
BUILD_AND_TEST_ARGS: --test-code-style
118+
# Validates that the documentation generated using doxygen has no hole.
119+
- name: Check documentation
120+
BUILD_AND_TEST_ARGS: --test-documentation
121+
uses: ./.github/workflows/build_and_test.yml
122+
with:
123+
BUILD_AND_TEST_CLI_ARGS: ${{ matrix.BUILD_AND_TEST_ARGS }}
124+
CMAKE_BUILD_TYPE: Release
125+
DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }}
126+
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9
127+
RUNS_ON: ubuntu-22.04
128+
USE_SCCACHE: false
129+
130+
baseline_log:
131+
needs: [is_not_draft_pull_request]
132+
runs-on: ubuntu-22.04
133+
steps:
134+
- name: Checkout Repository
135+
uses: actions/[email protected]
136+
with:
137+
submodules: false
138+
lfs: false
139+
fetch-depth: 0
140+
sparse-checkout: |
141+
scripts
142+
- name: Check that the baseline logs are modified if rebaselines are detected
143+
run: "scripts/check_baseline_log.sh"
144+
145+
code_coverage:
146+
needs:
147+
- is_not_draft_pull_request
148+
uses: ./.github/workflows/build_and_test.yml
149+
secrets: inherit
150+
with:
151+
BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests"
152+
CMAKE_BUILD_TYPE: Debug
153+
CODE_COVERAGE: true
154+
DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }}
155+
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11
156+
ENABLE_HYPRE: ON
157+
ENABLE_TRILINOS: OFF
158+
GCP_BUCKET: geosx/ubuntu22.04-gcc11
159+
RUNS_ON: Runner_4core_16GB
160+
161+
162+
163+
# Convenience job - passes when all other jobs have passed (must pass the CUDA jobs).
164+
# check_that_all_jobs_succeeded:
165+
# runs-on: ubuntu-22.04
166+
# needs:
167+
# - if_not_unassigned_pull_request
168+
# - are_submodules_in_sync
169+
# - check_code_style_and_documentation
170+
# - cpu_builds
171+
# - cuda_builds
172+
# - run_integrated_tests
173+
# if: ${{ always() }}
174+
# steps:
175+
# - run: |
176+
# echo "if_not_unassigned_pull_request: ${{needs.if_not_unassigned_pull_request.result}}"
177+
# echo "are_submodules_in_sync: ${{needs.are_submodules_in_sync.result}}"
178+
# echo "check_code_style_and_documentation: ${{needs.check_code_style_and_documentation.result}}"
179+
# echo "cpu_builds: ${{needs.cpu_builds.result}}"
180+
# echo "cuda_builds: ${{needs.cuda_builds.result}}"
181+
# echo "run_integrated_tests: ${{needs.run_integrated_tests.result}} "
182+
# ${{
183+
# needs.if_not_unassigned_pull_request.result == 'success' &&
184+
# needs.are_submodules_in_sync.result == 'success' &&
185+
# needs.check_code_style_and_documentation.result == 'success' &&
186+
# needs.cpu_builds.result == 'success' &&
187+
# needs.cuda_builds.result == 'success' &&
188+
# needs.run_integrated_tests.result == 'success'
189+
# }}

.github/workflows/cpu_builds.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CPU builds
2+
3+
on:
4+
pull_request: # Run workflow on PRs to the develop branch with modification on *.hpp or *.cpp files
5+
branches:
6+
- develop
7+
paths:
8+
- '**.hpp'
9+
- '**.cpp'
10+
push: # Run workflow on push to the develop branch.
11+
branches:
12+
- develop
13+
workflow_dispatch: # Workflow can be run manually
14+
15+
jobs:
16+
# Matrix containing all the CPU build.
17+
# Those are quite fast and can efficiently benefit from the `sccache' tool to make them even faster.
18+
cpu_builds:
19+
name: ${{ matrix.name }}
20+
strategy:
21+
# In-progress jobs will not be cancelled if there is a failure
22+
fail-fast : false
23+
matrix:
24+
include:
25+
- name: Ubuntu (20.04, gcc 9.4.0, open-mpi 4.0.3)
26+
CMAKE_BUILD_TYPE: Release
27+
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9
28+
29+
- name: Ubuntu debug (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces
30+
CMAKE_BUILD_TYPE: Debug
31+
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10
32+
33+
- name: Ubuntu (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces
34+
CMAKE_BUILD_TYPE: Release
35+
DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10
36+
37+
- name: Ubuntu (22.04, gcc 11.4.0, open-mpi 4.1.2)
38+
CMAKE_BUILD_TYPE: Release
39+
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc11
40+
ENABLE_HYPRE: ON
41+
ENABLE_TRILINOS: OFF
42+
GCP_BUCKET: geosx/ubuntu22.04-gcc11
43+
44+
- name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2)
45+
CMAKE_BUILD_TYPE: Release
46+
DOCKER_REPOSITORY: geosx/ubuntu22.04-gcc12
47+
ENABLE_HYPRE: ON
48+
ENABLE_TRILINOS: OFF
49+
50+
- name: Ubuntu (22.04, clang 15.0.7, open-mpi 4.1.2)
51+
CMAKE_BUILD_TYPE: Release
52+
DOCKER_REPOSITORY: geosx/ubuntu22.04-clang15
53+
ENABLE_HYPRE: ON
54+
ENABLE_TRILINOS: OFF
55+
56+
- name: Sherlock CPU (centos 7.9.2009, gcc 10.1.0, open-mpi 4.1.2, openblas 0.3.10)
57+
CMAKE_BUILD_TYPE: Release
58+
DOCKER_REPOSITORY: geosx/sherlock-gcc10.1.0-openmpi4.1.2-openblas0.3.10-zlib1.2.11
59+
ENABLE_HYPRE: ON
60+
ENABLE_TRILINOS: OFF
61+
GCP_BUCKET: geosx/Sherlock-CPU
62+
HOST_CONFIG: host-configs/Stanford/sherlock-gcc10-ompi4.1.2-openblas0.3.10.cmake
63+
64+
uses: ./.github/workflows/build_and_test.yml
65+
with:
66+
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
67+
DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }}
68+
DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }}
69+
ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }}
70+
ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }}
71+
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}
72+
HOST_CONFIG: ${{ matrix.HOST_CONFIG }}
73+
RUNS_ON: ubuntu-22.04
74+
secrets: inherit

.github/workflows/gpu_builds.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: GPU builds
2+
3+
on:
4+
pull_request: # Run workflow on PRs to the develop branch on labeled event
5+
branches:
6+
- develop
7+
types: [ labeled ]
8+
push: # Run workflow on push to the develop branch.
9+
branches:
10+
- develop
11+
workflow_dispatch: # Workflow can be run manually
12+
13+
jobs:
14+
# If the 'ci: run CUDA builds' PR label is found, the cuda jobs run immediately along side linux jobs.
15+
# Note: CUDA jobs should only be run if PR is ready to merge.
16+
cuda_builds:
17+
# if the current added label is for GPUs
18+
if: "${{ github.event.label.name == 'ci: run CUDA builds' }}"
19+
name: ${{ matrix.name }}
20+
strategy:
21+
# In-progress jobs will not be cancelled if there is a failure
22+
fail-fast : false
23+
matrix:
24+
include:
25+
- name: Ubuntu CUDA debug (20.04, clang 10.0.0 + gcc 9.4.0, open-mpi 4.0.3, cuda-11.8.89)
26+
BUILD_AND_TEST_CLI_ARGS: "--build-exe-only --no-install-schema"
27+
CMAKE_BUILD_TYPE: Debug
28+
DOCKER_REPOSITORY: geosx/ubuntu20.04-clang10.0.0-cuda11.8.89
29+
ENABLE_HYPRE_DEVICE: CUDA
30+
ENABLE_HYPRE: ON
31+
ENABLE_TRILINOS: OFF
32+
RUNS_ON: streak2
33+
NPROC: 8
34+
DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/usr/local/share/ca-certificates/llnl:ro"
35+
DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates"
36+
DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates"
37+
38+
- name: Ubuntu CUDA (20.04, clang 10.0.0 + gcc 9.4.0, open-mpi 4.0.3, cuda-11.8.89)
39+
BUILD_AND_TEST_CLI_ARGS: "--no-install-schema"
40+
CMAKE_BUILD_TYPE: Release
41+
DOCKER_REPOSITORY: geosx/ubuntu20.04-clang10.0.0-cuda11.8.89
42+
ENABLE_HYPRE_DEVICE: CUDA
43+
ENABLE_HYPRE: ON
44+
ENABLE_TRILINOS: OFF
45+
RUNS_ON: streak
46+
NPROC: 8
47+
DOCKER_RUN_ARGS: "--cpus=8 --memory=256g --runtime=nvidia --gpus all -v /etc/pki/ca-trust/source/anchors/:/usr/local/share/ca-certificates/llnl:ro"
48+
DOCKER_CERTS_DIR: "/usr/local/share/ca-certificates"
49+
DOCKER_CERTS_UPDATE_COMMAND: "update-ca-certificates"
50+
51+
# compiler error in ElasticFirstOrderWaveEquationSEMKernel::StressComputation::launch in call to FE_TYPE::computeFirstOrderStiffnessTermX
52+
# - name: Rockylinux (8, clang 17.0.6, cuda 12.5)
53+
# BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema"
54+
# CMAKE_BUILD_TYPE: Release
55+
# DOCKER_REPOSITORY: geosx/rockylinux8-clang17-cuda12.5
56+
# RUNS_ON: streak2
57+
# NPROC: 2
58+
# DOCKER_RUN_ARGS: "--cpus=1 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro"
59+
# DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors"
60+
# DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust"
61+
62+
# compiler error in ElasticFirstOrderWaveEquationSEMKernel::StressComputation::launch in call to FE_TYPE::computeFirstOrderStiffnessTermX
63+
# - name: Rockylinux (8, gcc 8.5, cuda 12.5)
64+
# BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema"
65+
# CMAKE_BUILD_TYPE: Release
66+
# DOCKER_REPOSITORY: geosx/rockylinux8-gcc8-cuda12.5
67+
# RUNS_ON: streak2
68+
# NPROC: 2
69+
# DOCKER_RUN_ARGS: "--cpus=1 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro"
70+
# DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors"
71+
# DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust"
72+
73+
# Below this line, jobs that deploy to Google Cloud.
74+
- name: Sherlock GPU (centos 7.9.2009, gcc 10.1.0, open-mpi 4.1.2, openblas 0.3.10, cuda 11.7.1,)
75+
BUILD_AND_TEST_CLI_ARGS: "--no-run-unit-tests --no-install-schema"
76+
CMAKE_BUILD_TYPE: Release
77+
DOCKER_REPOSITORY: geosx/sherlock-gcc10.1.0-openmpi4.1.2-cuda11.7.1-openblas0.3.10-zlib1.2.11
78+
ENABLE_HYPRE_DEVICE: CUDA
79+
ENABLE_HYPRE: ON
80+
ENABLE_TRILINOS: OFF
81+
GCP_BUCKET: geosx/Sherlock-GPU
82+
HOST_CONFIG: host-configs/Stanford/sherlock-gcc10-ompi4.1.2-openblas0.3.10-cuda11.7.1-sm70.cmake
83+
RUNS_ON: streak2
84+
NPROC: 8
85+
DOCKER_RUN_ARGS: "--cpus=8 --memory=128g --runtime=nvidia -v /etc/pki/ca-trust/source/anchors/:/etc/pki/ca-trust/source/anchors/llnl:ro"
86+
DOCKER_CERTS_DIR: "/etc/pki/ca-trust/source/anchors"
87+
DOCKER_CERTS_UPDATE_COMMAND: "update-ca-trust"
88+
89+
uses: ./.github/workflows/build_and_test.yml
90+
with:
91+
BUILD_AND_TEST_CLI_ARGS: ${{ matrix.BUILD_AND_TEST_CLI_ARGS }}
92+
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
93+
DOCKER_CERTS_DIR: ${{ matrix.DOCKER_CERTS_DIR }}
94+
DOCKER_CERTS_UPDATE_COMMAND: ${{ matrix.DOCKER_CERTS_UPDATE_COMMAND }}
95+
DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }}
96+
DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }}
97+
DOCKER_RUN_ARGS: ${{ matrix.DOCKER_RUN_ARGS }}
98+
ENABLE_HYPRE_DEVICE: ${{ matrix.ENABLE_HYPRE_DEVICE }}
99+
ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }}
100+
ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }}
101+
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}
102+
HOST_CONFIG: ${{ matrix.HOST_CONFIG }}
103+
NPROC: ${{ matrix.NPROC }}
104+
RUNS_ON: ${{ matrix.RUNS_ON }}
105+
REQUIRED_LABEL: "ci: run CUDA builds"
106+
secrets: inherit

0 commit comments

Comments
 (0)