-
Notifications
You must be signed in to change notification settings - Fork 10
386 lines (383 loc) · 13.5 KB
/
multiple_actions.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
name: nwchem_docker
on:
push:
pull_request:
release:
schedule:
- cron: '59 15 * * FRI'
repository_dispatch:
types: [backend_automation]
workflow_dispatch:
jobs:
changes:
if: |
!contains(github.event.head_commit.message, 'ci skip') && (github.event_name != 'workflow_dispatch') && (github.event_name != 'schedule')
runs-on: ubuntu-22.04
outputs:
# Expose matched filters as job 'folders' output variable
folders: ${{ steps.filter.outputs.changes }}
change: ${{ steps.env_change.outputs.change }}
steps:
- uses: actions/checkout@v4
- name: choose_dockerfile_filter
uses: dorny/paths-filter@v3
id: filter
with:
base: ${{ github.ref }}
filters: |
nwchem-dev: 'nwchem-dev/*'
builddebs.buster: 'builddebs.buster/*'
- name: Echo change to env
id: env_change
run: |
echo " steps.filter.outputs.changes " ${{ steps.filter.outputs.changes }}
if [[ ${{ steps.filter.outputs.changes }} == '[]' ]]; then
echo "no change detected"
echo "change=no" >> $GITHUB_OUTPUT
else
echo "change detected"
echo "change=yes" >> $GITHUB_OUTPUT
fi
- name: echo_change
run: |
echo " env change is" `cat $GITHUB_OUTPUT `
echo " steps.env_change.outputs.change is ${{ steps.env_change.outputs.change }}"
docker_filter:
needs: [changes]
if: ( needs.changes.outputs.change == 'yes')
strategy:
fail-fast: false
matrix:
folder: ["${{ fromJSON(needs.changes.outputs.folders) }}"]
archs: [linux/amd64, linux/arm64, linux/ppc64le, linux/arm/v7, linux/riscv64]
fc: [ gfortran, nvfortran]
branch: [ master, release-7-2-0]
exclude:
- {folder: nwchem-dev, archs: linux/riscv64, fc: nvfortran}
- {folder: nwchem-dev, archs: linux/ppc64le, fc: nvfortran}
- {folder: nwchem-dev, archs: linux/arm/v7, fc: nvfortran}
runs-on: ubuntu-latest
timeout-minutes: 420
outputs:
tag: ${{ steps.env_tag.outputs.tag }}
tag_noarch: ${{ steps.env_tag_noarch.outputs.tag_noarch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache
id: setup-cache
uses: actions/cache@v4
with:
path: |
~/cache
key: ${{ matrix.folder}}-${{ matrix.fc}}/${{ matrix.archs}}-nwchemdockercache-v018
- name: Qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v6.0.0-10
platforms: ${{ matrix.archs }}
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:v0.11.6
network=host
buildkitd-flags: --debug
- name: Login to GitHub Container Registry
if: ${{ github.actor == github.repository_owner }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Arch
id: get-arch
run: |
echo "arch=$(echo ${{matrix.archs }} | sed 's/linux//'|sed 's/\///g' )" >> $GITHUB_ENV
shell: bash
- name: FC tag
id: fc-tag
run: |
if [[ ${{ matrix.fc }} == 'gfortran' ]]; then
echo "fc=" >> $GITHUB_ENV
else
echo "fc=$(echo -${{matrix.fc }} )" >> $GITHUB_ENV
fi
shell: bash
- name: fetch cache
if: (steps.setup-cache.outputs.cache-hit == 'true')
run: |
cd ${{ matrix.folder }}
ls -lrta
if [[ -f ~/cache/libext.tar.bz2 ]]; then \
echo "libext cache present" ; \
mkdir -p cache|| true ; \
rsync -av ~/cache/libext* cache/. ; \
echo "libext cache fetched" ; \
if [[ -f ~/cache/simint.tar.bz2 ]]; then \
echo "simint cache present" ; \
mkdir -p cache|| true ; \
rsync -av ~/cache/simint* cache/. ; \
echo "simint cache fetched" ; \
fi
ls -l cache/ ; \
echo "======" ; \
fi
echo "cache_hit=Y" >> $GITHUB_ENV
- name: negative-cache-hit-reporter
if: (steps.setup-cache.outputs.cache-hit != 'true')
run: |
echo "cache_hit=N" >> $GITHUB_ENV
- name: nwchem version tag
run: |
if [[ ${{ matrix.branch }} == master ]]; then
echo "nwversion=dev" >> $GITHUB_ENV
elif [[ ${{ matrix.branch }} == release-7-2-0 ]]; then
echo "nwversion=720" >> $GITHUB_ENV
else
echo "nwversion=unknown" >> $GITHUB_ENV
fi
shell: bash
- name: docker tag noarch
run: |
echo "tag_noarch=ghcr.io/${{ github.actor }}/nwchem-${{ env.nwversion }}${{ env.fc }}" >> $GITHUB_ENV
shell: bash
- name: docker tag
run: |
echo "tag=${{ env.tag_noarch }}:${{ env.arch }}" >> $GITHUB_ENV
shell: bash
- name: echo docker tag to env
id: env_tag
run:
echo "tag=${{ env.tag }}" >> $GITHUB_OUTPUT
- name: echo docker tag_noarch to env
id: env_tag_noarch
run:
echo "tag_noarch=${{ env.tag_noarch }}" >> $GITHUB_OUTPUT
- name: build date
id: build-date
run: |
echo "date=$(TZ=America/Los_Angeles date +%Y%m%d_%H%M%S)" >> $GITHUB_ENV
- name: build_filter
uses: docker/build-push-action@v6
with:
push: ${{ github.actor == github.repository_owner }}
provenance: false
context: ${{ matrix.folder }}
shm-size: 256m
platforms: ${{ matrix.archs }}
tags: |
${{ env.tag }}
${{ env.tag }}-${{ env.date }}
build-args: |
FC=${{ matrix.fc }}
NWCHEM_BRANCH=${{ matrix.branch }}
CACHE_HIT=${{ env.cache_hit }}
GITHUB_REPOSITORY_OWNER=${{ github.repository_owner }}
- name: load and test image
if: ( github.actor == github.repository_owner )
run: |
sleep 30s
docker pull ${{ env.tag }}
cd /tmp
umask u=rwx,g=rwx,o=rwx
umask -S
git clone --no-checkout https://github.com/nwchemgit/nwchem
cd nwchem
git sparse-checkout init --cone
git sparse-checkout set QA
git checkout
cd QA
if [[ ${{ matrix.archs }} != 'linux/arm/v7' && ${{ matrix.fc }} != 'nvfortran' ]]; then \
docker run --shm-size 256m --rm --platform ${{matrix.archs }} \
-e NWCHEM_EXECUTABLE=/opt/nwchem/bin/nwchem --entrypoint='/opt/nwchem/QA/runtests.mpi.unix' \
-w /opt/nwchem/QA -v `pwd`:/opt/nwchem/QA \
${{ env.tag }} \
dft_he2+ ;\
fi
- name: store cache
if: ( github.actor == github.repository_owner )
run: |
mkdir -p ~/cache/
docker run --privileged --user 0 --rm --platform ${{matrix.archs }} \
--entrypoint='/bin/cp' -v ~/cache:/data \
${{ env.tag }} \
-rp /opt/nwchem/src/libext/libext.tar.bz2 /data/. || true
ls -Ralrt ~/cache || true
bundle_images1:
needs: [changes, docker_filter]
uses: ./.github/workflows/docker_manifest.yml
secrets:
inherit
docker_schedule:
if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'schedule')
strategy:
fail-fast: false
matrix:
folder:
- nwchem-dev
archs: [linux/amd64, linux/arm64, linux/ppc64le, linux/arm/v7, linux/riscv64]
fc: [ gfortran, nvfortran]
branch: [ master, release-7-2-0]
exclude:
- {folder: nwchem-dev, archs: linux/riscv64, fc: nvfortran}
- {folder: nwchem-dev, archs: linux/ppc64le, fc: nvfortran}
- {folder: nwchem-dev, archs: linux/arm/v7, fc: nvfortran}
runs-on: ubuntu-latest
timeout-minutes: 420
outputs:
tag: ${{ steps.env_tag.outputs.tag }}
tag_noarch: ${{ steps.env_tag_noarch.outputs.tag_noarch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup cache
id: setup-cache
uses: actions/cache@v4
with:
path: |
~/cache
key: ${{ matrix.folder}}-${{ matrix.fc}}/${{ matrix.archs}}-nwchemdockercache-v018
- name: Qemu
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v6.0.0-10
platforms: ${{ matrix.archs }}
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:v0.11.6
network=host
buildkitd-flags: --debug
- name: Login to GitHub Container Registry
if: ${{ github.actor == github.repository_owner }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Arch
id: get-arch
run: |
echo "arch=$(echo ${{matrix.archs }} | sed 's/linux//'|sed 's/\///g' )" >> $GITHUB_ENV
shell: bash
- name: FC tag
id: fc-tag
run: |
if [[ ${{ matrix.fc }} == 'gfortran' ]]; then
echo "fc=" >> $GITHUB_ENV
else
echo "fc=$(echo -${{matrix.fc }} )" >> $GITHUB_ENV
fi
shell: bash
- name: fetch cache
if: (steps.setup-cache.outputs.cache-hit == 'true')
run: |
cd ${{ matrix.folder }}
ls -lrta
if [[ -f ~/cache/libext.tar.bz2 ]]; then \
echo "libext cache present" ; \
mkdir -p cache|| true ; \
rsync -av ~/cache/libext* cache/. ; \
echo "libext cache fetched" ; \
ls -l cache/ ; \
echo "======" ; \
fi
echo "cache_hit=Y" >> $GITHUB_ENV
- name: negative-cache-hit-reporter
if: (steps.setup-cache.outputs.cache-hit != 'true')
run: |
echo "cache_hit=N" >> $GITHUB_ENV
- name: nwchem version tag
run: |
if [[ ${{ matrix.branch }} == master ]]; then
echo "nwversion=dev" >> $GITHUB_ENV
else
echo "nwversion=720" >> $GITHUB_ENV
fi
shell: bash
- name: docker tag noarch
run: |
echo "tag_noarch=ghcr.io/${{ github.actor }}/nwchem-${{ env.nwversion }}${{ env.fc }}" >> $GITHUB_ENV
shell: bash
- name: docker tag
run: |
echo "tag=${{ env.tag_noarch }}:${{ env.arch }}" >> $GITHUB_ENV
shell: bash
- name: echo docker tag to env
id: env_tag
run:
echo "tag=${{ env.tag }}" >> $GITHUB_OUTPUT
- name: echo docker tag_noarch to env
id: env_tag_noarch
run:
echo "tag_noarch=${{ env.tag_noarch }}" >> $GITHUB_OUTPUT
- name: build date
id: build-date
run: |
echo "date=$(TZ=America/Los_Angeles date +%Y%m%d_%H%M%S)" >> $GITHUB_ENV
- name: print env
run: |
echo "GITHUB_ENV" `cat $GITHUB_ENV`
echo " tag " ${{ env.tag }}
- name: build_schedule
uses: docker/build-push-action@v6
with:
push: ${{ github.actor == github.repository_owner }}
provenance: false
context: ${{ matrix.folder }}
shm-size: 256m
platforms: ${{ matrix.archs }}
tags: |
${{ env.tag }}
${{ env.tag }}-${{ env.date }}
build-args: |
FC=${{ matrix.fc }}
NWCHEM_BRANCH=${{ matrix.branch }}
CACHE_HIT=${{ env.cache_hit }}
GITHUB_REPOSITORY_OWNER=${{ github.repository_owner }}
- name: load and test image
if: ( github.actor == github.repository_owner )
run: |
sleep 30s
docker pull ${{ env.tag }}
cd /tmp
umask u=rwx,g=rwx,o=rwx
umask -S
git clone --no-checkout https://github.com/nwchemgit/nwchem
cd nwchem
git sparse-checkout init --cone
git sparse-checkout set QA
git checkout
cd QA
if [[ ${{ matrix.archs }} != 'linux/arm/v7' && ${{ matrix.fc }} != 'nvfortran' ]]; then \
docker run --shm-size 256m --rm --platform ${{matrix.archs }} \
-e NWCHEM_EXECUTABLE=/opt/nwchem/bin/nwchem --entrypoint='/opt/nwchem/QA/runtests.mpi.unix' \
-w /opt/nwchem/QA -v `pwd`:/opt/nwchem/QA \
${{ env.tag }} \
dft_he2+ ;\
fi
- name: store cache
if: ( github.actor == github.repository_owner )
run: |
mkdir -p ~/cache/
docker run --privileged --user 0 --rm --platform ${{matrix.archs }} \
--entrypoint='/bin/cp' -v ~/cache:/data \
${{ env.tag }} \
-rp /opt/nwchem/src/libext/libext.tar.bz2 /data/. || true
docker run --privileged --user 0 --rm --platform ${{matrix.archs }} \
--entrypoint='/bin/cp' -v ~/cache:/data \
${{ env.tag }} \
-rp /opt/nwchem/src/libext/simint.tar.bz2 /data/. || true
ls -Ralrt ~/cache || true
bundle_images2:
needs: [docker_schedule]
uses: ./.github/workflows/docker_manifest.yml
secrets:
inherit