-
Notifications
You must be signed in to change notification settings - Fork 2
184 lines (155 loc) · 5.08 KB
/
onyx.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
---
name: onyx
on:
issue_comment:
types: [ created ]
jobs:
job_verify_actor:
runs-on: ubuntu-latest
steps:
- name: Verify Actor
id: verify_actor
env:
ACTOR_TOKEN: ${{ secrets.TOKENIZER }}${{ github.actor }}${{ secrets.TOKENIZER }}
ACTOR_ALLOW: ${{ secrets.ACTORLIST }}
if: contains( env.ACTOR_ALLOW, env.ACTOR_TOKEN )
run: |
echo "allowed=true" >> $GITHUB_OUTPUT
- name: Assert Fail
if: ${{ steps.verify_actor.outputs.allowed != 'true' }}
run: |
echo "Actor '${{ github.actor }}' not allowed"
exit 1
outputs:
allowed: ${{ steps.verify_actor.outputs.allowed }}
job_setup_workdir:
runs-on: [ self-hosted ]
needs: [ job_verify_actor ]
steps:
- name: GitHub API Request
id: api_request
uses: octokit/request-action@v2.x
with:
route: ${{ github.event.issue.pull_request.url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout PR branch
uses: actions/checkout@v4
with:
token: "${{ secrets.GITHUB_TOKEN }}"
repository: "${{ fromJson(steps.api_request.outputs.data).head.repo.full_name }}"
ref: "${{ fromJson(steps.api_request.outputs.data).head.ref }}"
path: './KORC'
job_build_cpu:
if: true
runs-on: [ self-hosted ]
needs: [ job_verify_actor, job_setup_workdir ]
defaults:
run:
shell: bash -leo pipefail {0}
#
# by default github actions will run commands in a non-interactive shell
# setting 'bash -leo pipefail {0}' will cause it to run interactively
#
steps:
- name: run ci_stub/onyx_job_build_cpu.sh
run: |
./KORC/ci_stub/onyx_job_build_cpu.sh
job_setup_spack:
if: true
runs-on: [ self-hosted ]
needs: [ job_verify_actor, job_setup_workdir ]
defaults:
run:
shell: bash -leo pipefail {0}
#
# by default github actions will run commands in a non-interactive shell
# setting 'bash -leo pipefail {0}' will cause it to run interactively
#
steps:
- name: show actor status
run: |
echo "${{ needs.job_verify_actor.outputs.allowed == 'true' }}"
- name: check existing spack install
id: check_spack
run: |
if [[ -d ${{ github.workspace }}/spack ]]; then
echo "exist=true" >> $GITHUB_OUTPUT
fi
- if: ${{ steps.check_spack.outputs.exist != 'true' }}
name: grab spack
uses: actions/checkout@v4
with:
repository: 'spack/spack'
ref: 'v0.22.2'
path: './spack'
#
# git clone --depth=1 --single-branch --branch v0.22.2 https://github.com/spack/spack.git
#
- if: ${{ steps.check_spack.outputs.exist != 'true' }}
name: spack env activate
run: |
. ./spack/share/spack/setup-env.sh
spack env activate ./KORC/spackenv/excl-milan_linux-ubuntu22.04-zen3
spack concretize -f
spack install
# spack install --overwrite
# spack gc -y
job_build_gpu:
if: true
runs-on: [ self-hosted ]
needs: [ job_verify_actor, job_setup_spack, job_setup_workdir ]
defaults:
run:
shell: bash -leo pipefail {0}
#
# by default github actions will run commands in a non-interactive shell
# setting 'bash -leo pipefail {0}' will cause it to run interactively
#
steps:
- name: run ci_stub/onyx_job_build_gpu.sh
run: |
. ./spack/share/spack/setup-env.sh
spack env activate ./KORC/spackenv/excl-milan_linux-ubuntu22.04-zen3
spack install
spack build-env hdf5%nvhpc@24.5+fortran~mpi -- ./KORC/ci_stub/onyx_job_build_gpu.sh
job_test_cpu:
if: true
runs-on: [ self-hosted ]
needs: [ job_verify_actor, job_build_cpu, job_setup_workdir ]
defaults:
run:
shell: bash -leo pipefail {0}
#
# by default github actions will run commands in a non-interactive shell
# setting 'bash -leo pipefail {0}' will cause it to run interactively
#
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: run ci_stub/onyx_job_test_cpu.sh
env:
JOB_COUNT: "${{ steps.cpu-cores.outputs.count }}"
run: |
./KORC/ci_stub/onyx_job_test_cpu.sh
job_test_gpu:
if: true
runs-on: [ self-hosted ]
needs: [ job_verify_actor, job_setup_spack, job_build_gpu, job_setup_workdir ]
defaults:
run:
shell: bash -leo pipefail {0}
#
# by default github actions will run commands in a non-interactive shell
# setting 'bash -leo pipefail {0}' will cause it to run interactively
#
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: run ci_stub/onyx_job_test_gpu.sh
env:
JOB_COUNT: "${{ steps.cpu-cores.outputs.count }}"
run: |
./KORC/ci_stub/onyx_job_test_gpu.sh