forked from nwchemgit/nwchem
-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (85 loc) · 2.83 KB
/
docker_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
name: nwchem_docker
on:
release:
schedule:
- cron: '0 2 * * *'
repository_dispatch:
types: [backend_automation]
workflow_dispatch:
jobs:
docker_build:
strategy:
fail-fast: false
matrix:
include:
- {folder: nwchem-dev, archs: linux/aarch64, fc: gfortran}
- {folder: nwchem-dev, archs: linux/ppc64le, fc: gfortran}
- {folder: nwchem-dev, archs: linux/arm/v7, fc: gfortran}
runs-on: ubuntu-latest
timeout-minutes: 420
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: 'nwchemgit/nwchem-dockerfiles'
fetch-depth: 5
- name: Setup cache
id: setup-cache
uses: actions/cache@v3
with:
path: |
~/cache
key: ${{ matrix.folder}}-${{ matrix.fc}}/${{ matrix.archs}}-nwchem-dockeractions-v002
- name: Qemu
id: qemu
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v6.0.0-10
- name: Available platforms
run: |
echo ${{ steps.qemu.outputs.platforms }}
docker images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: |
image=moby/buildkit:v0.10.4
- name: fetch cache
if: (steps.setup-cache.outputs.cache-hit == 'true') && ( matrix.folder != 'helloworld' )
run: |
cd ${{ matrix.folder }}
if [[ -f ~/cache/libext.tar.bz2 ]]; then \
mkdir -p cache|| true ; \
rsync -av ~/cache/libext* cache/. ; \
echo "libext cache fetched" ; \
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: build_schedule
uses: docker/build-push-action@v4
with:
push: false
context: ${{ matrix.folder }}
platforms: ${{ matrix.archs }}
outputs: type=docker,dest=/tmp/nwchem_image.tar
tags: nwchem_image
build-args: |
FC=${{ matrix.fc }}
CACHE_HIT=${{ env.cache_hit }}
NWCHEM_BRANCH=${{ github.ref_name }}
GITHUB_REPOSITORY_OWNER=${{ github.repository_owner }}
- name: store cache
run: |
mkdir -p ~/cache/
ls -l /tmp/nwchem_image.tar || true
docker load --input /tmp/nwchem_image.tar
docker images
docker inspect nwchem_image
docker run --privileged --user 0 --rm --platform ${{matrix.archs }} \
--entrypoint='/bin/cp' -v ~/cache:/data \
nwchem_image \
-rp /opt/nwchem/src/libext/libext.tar.bz2 /data/. || true
ls -Ralrt ~/cache || true