Skip to content

Commit 1936173

Browse files
authored
Merge pull request QMCPACK#5680 from williamfgc/ci-nitrogen2-amdclang
Add Nitrogen2 CI configuration
2 parents b87b5be + 3998644 commit 1936173

2 files changed

Lines changed: 178 additions & 0 deletions

File tree

.github/workflows/ci-github-actions-self-hosted.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,3 +293,100 @@ jobs:
293293
state: ${{job.status}}
294294
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
295295
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
296+
297+
nitrogen2-amdclang:
298+
if: |
299+
github.repository_owner == 'QMCPACK' &&
300+
github.event.issue.pull_request &&
301+
( startsWith(github.event.comment.body, 'Test this please') ||
302+
startsWith(github.event.comment.body, 'Start testing in-house') )
303+
304+
runs-on: [self-hosted, Linux, X64, ornl-nitrogen2]
305+
306+
env:
307+
GH_JOBNAME: ${{matrix.jobname}}
308+
GH_OS: Linux
309+
strategy:
310+
fail-fast: false
311+
matrix:
312+
jobname:
313+
[
314+
MI210-AMDClang-NoMPI-Offload-Real-Mixed,
315+
MI210-AMDClang-NoMPI-Offload-Real,
316+
MI210-AMDClang-NoMPI-Offload-Real-Mixed,
317+
MI210-AMDClang-NoMPI-Offload-Real,
318+
]
319+
320+
steps:
321+
- name: Verify actor
322+
# Only trigger for certain "actors" (those commenting the PR, not the PR originator)
323+
# this is in-line with the current workflow
324+
env:
325+
ACTOR_TOKEN: ${{secrets.TOKENIZER}}${{github.actor}}${{secrets.TOKENIZER}}
326+
SECRET_ACTORS: ${{secrets.CI_GPU_ACTORS}}
327+
if: contains(env.SECRET_ACTORS, env.ACTOR_TOKEN)
328+
id: check
329+
run: |
330+
echo "triggered=true" >> $GITHUB_OUTPUT
331+
332+
# Request repo info, required since issue_comment doesn't point at PR commit, but develop
333+
- name: GitHub API Request
334+
if: steps.check.outputs.triggered == 'true'
335+
id: request
336+
uses: octokit/request-action@v2.1.7
337+
with:
338+
route: ${{github.event.issue.pull_request.url}}
339+
env:
340+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
341+
342+
# Create a separate PR status pointing at GitHub Actions tab URL
343+
# just like any other third-party service
344+
- name: Create PR status
345+
if: steps.check.outputs.triggered == 'true'
346+
uses: guibranco/github-status-action-v2@v1.1.7
347+
with:
348+
authToken: ${{secrets.GITHUB_TOKEN}}
349+
context: "ornl-nitrogen CI ${{matrix.jobname}}"
350+
state: "pending"
351+
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
352+
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
353+
354+
- name: Get PR information
355+
if: steps.check.outputs.triggered == 'true'
356+
id: pr_data
357+
run: |
358+
echo "branch=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT
359+
echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT
360+
echo "repo_clone_url=${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" >> $GITHUB_OUTPUT
361+
echo "repo_ssh_url=${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}" >> $GITHUB_OUTPUT
362+
363+
- name: Checkout PR branch
364+
if: steps.check.outputs.triggered == 'true'
365+
uses: actions/checkout@v4
366+
with:
367+
token: ${{secrets.GITHUB_TOKEN}}
368+
repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}}
369+
ref: ${{steps.pr_data.outputs.branch}}
370+
371+
- name: Configure
372+
if: steps.check.outputs.triggered == 'true'
373+
run: tests/test_automation/github-actions/ci/run_step_ornl-nitrogen2.sh configure
374+
375+
- name: Build
376+
if: steps.check.outputs.triggered == 'true'
377+
run: tests/test_automation/github-actions/ci/run_step_ornl-nitrogen2.sh build
378+
379+
- name: Test
380+
if: steps.check.outputs.triggered == 'true'
381+
run: tests/test_automation/github-actions/ci/run_step_ornl-nitrogen2.sh test
382+
383+
- name: Report PR status
384+
if: always() && steps.check.outputs.triggered == 'true'
385+
uses: guibranco/github-status-action-v2@v1.1.7
386+
with:
387+
authToken: ${{secrets.GITHUB_TOKEN}}
388+
context: "ornl-nitrogen CI ${{matrix.jobname}}"
389+
state: ${{job.status}}
390+
sha: ${{fromJson(steps.request.outputs.data).head.sha}}
391+
target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
392+
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
3+
# Executes pipeline steps for the nitrogen2 CI jobs
4+
5+
set -x
6+
HOST_NAME=$(hostname -s)
7+
8+
case "$1" in
9+
10+
configure)
11+
12+
# Make current environment variables available to subsequent steps, ctest
13+
echo "PATH=$PATH" >> $GITHUB_ENV
14+
15+
QMC_DATA_DIR=/scratch/pk7/QMC_DATA_FULL
16+
17+
if [ -d ${GITHUB_WORKSPACE}/../qmcpack-build ]
18+
then
19+
echo "Found existing out-of-source build directory ${GITHUB_WORKSPACE}/../qmcpack-build, removing"
20+
rm -fr ${GITHUB_WORKSPACE}/../qmcpack-build
21+
fi
22+
23+
echo "Creating new out-of-source build directory ${GITHUB_WORKSPACE}/../qmcpack-build"
24+
cd ${GITHUB_WORKSPACE}/.. && mkdir qmcpack-build && cd qmcpack-build
25+
26+
# Build variants
27+
# Real or Complex configuration
28+
case "${GH_JOBNAME}" in
29+
*"Real"*)
30+
echo 'Configure for real build -DQMC_COMPLEX=0'
31+
IS_COMPLEX=0
32+
;;
33+
*"Complex"*)
34+
echo 'Configure for complex build -DQMC_COMPLEX=1'
35+
IS_COMPLEX=1
36+
;;
37+
esac
38+
39+
# Mixed or Non-Mixed (default, full) precision, used with GPU code
40+
case "${GH_JOBNAME}" in
41+
*"Mixed"*)
42+
echo 'Configure for mixed precision build -DQMC_MIXED_PRECISION=1'
43+
IS_MIXED_PRECISION=1
44+
;;
45+
*)
46+
IS_MIXED_PRECISION=0
47+
;;
48+
esac
49+
50+
# check the GPU architecture in use
51+
whoami
52+
groups
53+
amdgpu-arch
54+
55+
echo 'Configure for building OpenMP Offload with AMDClang compilers'
56+
cmake -GNinja \
57+
-DCMAKE_C_COMPILER=amdclang \
58+
-DCMAKE_CXX_COMPILER=amdclang++ \
59+
-DQMC_MPI=0 \
60+
-DQMC_GPU_ARCHS=gfx90a \
61+
-DQMC_COMPLEX=$IS_COMPLEX \
62+
-DQMC_MIXED_PRECISION=$IS_MIXED_PRECISION \
63+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
64+
-DQMC_DATA=$QMC_DATA_DIR \
65+
${GITHUB_WORKSPACE}
66+
67+
;;
68+
69+
build)
70+
cd ${GITHUB_WORKSPACE}/../qmcpack-build
71+
ninja
72+
;;
73+
74+
test)
75+
echo "Running deterministic tests"
76+
amd-smi version
77+
cd ${GITHUB_WORKSPACE}/../qmcpack-build
78+
ctest --output-on-failure -L deterministic -j 32 --timeout 120 --repeat after-timeout:4
79+
;;
80+
81+
esac

0 commit comments

Comments
 (0)