forked from NOAA-GSL/ExascaleWorkflowSandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (144 loc) · 5.26 KB
/
docker-slurm.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
name: ExascaleSandboxTests
on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
timeout-minutes: 720
steps:
-
name: Checkout repository
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Prune pre-loaded GHA docker images
run: |
docker images
docker image prune -a -f
docker images
-
name: Create spack-stack Dockerfile
run: |
cd docker/spack-stack
./create_dockerfile.sh
-
name: Build spack-stack
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/spack-stack/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/spack-stack-gnu-openmpi:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/spack-stack-gnu-openmpi:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/spack-stack-gnu-openmpi:cache,mode=max
-
name: Build frontend
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/frontend/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
-
name: Build master
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/master/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
-
name: Build node
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/node/Dockerfile
push: false
load: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max
-
name: Start Slurm cluster containers
run: |
cd docker
export DOCKER_CLIENT_TIMEOUT=600
export COMPOSE_HTTP_TIMEOUT=600
docker compose version
docker compose config
docker images
docker ps -a
docker compose -f docker-compose.yml up -d --no-build
-
name: Copy test files to work directory
run: |
docker exec frontend bash -l -c "mkdir -p work; cd work ; cp -r ../chiltepin/* ."
-
name: Install chiltepin package
run: docker exec frontend bash -l -c "conda activate chiltepin ; cd work ; pip install -e ."
-
name: Run test suite
run: docker exec frontend bash -l -c "conda activate chiltepin ; cd work/tests ; pytest --assert=plain --config=ci.yaml"
-
name: Debug session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
limit-access-to-actor: true
-
name: Shut down Slurm cluster containers
run: |
cd docker
export DOCKER_CLIENT_TIMEOUT=600
export COMPOSE_HTTP_TIMEOUT=600
docker compose -f docker-compose.yml down
-
name: Push frontend
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/frontend/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/frontend:cache,mode=max
-
name: Push master
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/master/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/master:cache,mode=max
-
name: Push node
uses: docker/build-push-action@v4
with:
context: ./docker
file: ./docker/node/Dockerfile
push: true
tags: ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:latest
cache-from: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache
cache-to: type=registry,ref=ghcr.io/noaa-gsl/exascaleworkflowsandbox/node:cache,mode=max