-
Notifications
You must be signed in to change notification settings - Fork 12
152 lines (148 loc) · 5.36 KB
/
docker_build.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
name: Build docker images (build-env & runtime)
on:
push:
branches: [ main ]
paths:
- "vasp-build/**"
- ".github/workflows/docker_build.yml"
pull_request:
branches: [ main ]
paths:
- "vasp-build/**"
- ".github/workflows/docker_build.yml"
workflow_dispatch:
jobs:
build_env:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: setup docker context for buildx
id: buildx-context
run: |
docker context create builders || :
- name: setup docker buildx
uses: docker/setup-buildx-action@v1
with:
endpoint: builders
- name: Login to Github Container Repo
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case repository name
# Hit from https://github.community/t/github-actions-repository-name-must-be-lowercase/184924
run: |
echo "REPO_OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"
- name: Build and push to GHCR
uses: docker/build-push-action@v2
with:
context: vasp-build/
file: vasp-build/extras/Dockerfile.build_env
push: true
tags: |
ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:build_env
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Tag image version
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:build_env
dst: ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:build_env-hpcsdk21.2-20.04
runtime:
needs: [build_env,]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: setup docker context for buildx
id: buildx-context
run: |
docker context create builders || :
- name: setup docker buildx
uses: docker/setup-buildx-action@v1
with:
endpoint: builders
- name: Login to Github Container Repo
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case repository name
# Hit from https://github.community/t/github-actions-repository-name-must-be-lowercase/184924
run: |
echo "REPO_OWNER_LC=${OWNER,,}" >> ${GITHUB_ENV}
env:
OWNER: "${{ github.repository_owner }}"
- name: Build and push to GHCR
uses: docker/build-push-action@v2
with:
context: vasp-build/
file: vasp-build/extras/Dockerfile.runtime
push: true
tags: |
ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:runtime
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Tag image version
uses: akhilerm/[email protected]
with:
src: ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:runtime
dst: ghcr.io/${{ env.REPO_OWNER_LC }}/vasp-interactive:runtime-hpcsdk21.2-cuda11.2-20.04
test:
needs: [runtime,]
runs-on: ubuntu-latest
container:
image: ghcr.io/ulissigroup/vasp-interactive:runtime
env:
VASP_PREFIX: "mpirun -np 1 --mca btl_vader_single_copy_mechanism none --mca mpi_cuda_support 0 --allow-run-as-root"
options: --user root --entrypoint /bin/bash
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
vasp-version: ["vasp54", "vasp61", "vasp62", "vasp63"]
variant: ["patch", "pristine"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download test binaries
run: |
wget --no-verbose https://github.com/ulissigroup/vasp-interactive/releases/download/v0.0.1/test_binaries.zip
unzip -d vasp -P $MYPWD test_binaries.zip
VASP_ROOT=`realpath vasp`
echo "VASP_ROOT=${VASP_ROOT}" >> $GITHUB_ENV
env:
MYPWD: ${{ secrets.TEST_BINARY_KEY }}
- name: Run vasp binary (let it fail)
run: |
${VASP_PREFIX} ${VASP_ROOT}/${{ matrix.variant }}/${{ matrix.vasp-version }}/bin/vasp_std > /tmp/vasp.out 2>&1 || true
grep " I REFUSE TO CONTINUE WITH THIS SICK JOB" /tmp/vasp.out || grep "Error reading item" /tmp/vasp.out
rm -rf /tmp/vasp.out
- name: Do test beef
run: |
export VASP_COMMAND="${VASP_PREFIX} ${VASP_ROOT}/${{ matrix.variant }}/${{ matrix.vasp-version }}/bin/vasp_std"
cd vasp/tests/beef
bash test.sh
- name: Do test interactive mode
run: |
export VASP_COMMAND="${VASP_PREFIX} ${VASP_ROOT}/${{ matrix.variant }}/${{ matrix.vasp-version }}/bin/vasp_std"
cd vasp/tests/interactive
bash test.sh
if: ${{ matrix.variant == 'patch' }}
- name: Do test ipi-patch
run: |
export VASP_COMMAND="${VASP_PREFIX} ${VASP_ROOT}/${{ matrix.variant }}/${{ matrix.vasp-version }}/bin/vasp_std"
cd vasp/tests/ipi-socket
bash test.sh
if: ${{ matrix.variant == 'patch' }}