-
Notifications
You must be signed in to change notification settings - Fork 0
239 lines (214 loc) · 11 KB
/
slim_externals.yaml
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
name: Build docker image with slim externals
on:
workflow_dispatch:
inputs:
tag-suffix:
description: 'optional suffix for test-only externals image (e.g., T would mean alma9-slim-externals:v2.2T)'
default: ''
account-to-copy:
description: 'the user account whose docker-scratch/cvmfs_dunedaq area you want to copy (default dunedaq)'
default: 'dunedaq'
spack-version:
description: 'the version of Spack the v2.2 externals were built with (default 0.22.0)'
default: '0.22.0'
jobs:
build_alma9_externals:
name: build_al9_initial
runs-on: daq
permissions:
packages: write
contents: read
steps:
- name: Intro
run: |
echo "Will create a ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }} image"
echo "Image contents will include $HOSTNAME:/home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq/spack/externals/ext-v2.2/spack-${{ github.event.inputs.spack-version }}"
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/dune-daq/alma9-slim-externals
tags: |
type=raw,value=v2.2${{ github.event.inputs.tag-suffix }}-initial
- name: prepare build dir
id: prep_build_dir
run: |
build_dir="/home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq"
cd $build_dir
refresh_date=$(date +%y-%m-%d)
echo "FROM ghcr.io/dune-daq/alma9-spack:latest" > Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_AT $refresh_date" >> Dockerfile
echo "ADD spack/externals/ext-v2.2/spack-${{ github.event.inputs.spack-version }} /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.2/spack-${{ github.event.inputs.spack-version }}" >> Dockerfile
echo "RUN source /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.2/spack-${{ github.event.inputs.spack-version }}/share/spack/setup-env.sh && spack uninstall -y llvm || true" >> Dockerfile
echo "ADD tools /cvmfs/dunedaq.opensciencegrid.org/tools" >> Dockerfile
echo "ADD assets /cvmfs/dunedaq.opensciencegrid.org/assets" >> Dockerfile
echo "ADD setup_dunedaq.sh /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh" >> Dockerfile
echo "ADD pypi-repo /cvmfs/dunedaq.opensciencegrid.org/pypi-repo" >> Dockerfile
echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: /home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Clean up
if: always()
run: |
rm -f /home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq/Dockerfile
docker image prune -f
docker container prune -f
docker network prune -f
docker volume prune -f
build_alma9_slim_externals:
name: build_alma9
runs-on: daq
needs: build_alma9_externals
permissions:
packages: write
contents: read
steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/dune-daq/alma9-slim-externals
tags: |
type=raw,value=v2.2${{ github.event.inputs.tag-suffix }}
- name: prepare build dir
run: |
build_dir="${{ github.workspace }}/docker-build"
mkdir -p $build_dir
cd $build_dir
refresh_date=$(date +%y-%m-%d)
echo "FROM ghcr.io/dune-daq/alma9-spack:latest" > Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_AT $refresh_date" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/spack /cvmfs/dunedaq.opensciencegrid.org/spack" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/tools /cvmfs/dunedaq.opensciencegrid.org/tools" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/assets /cvmfs/dunedaq.opensciencegrid.org/assets" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.2${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/pypi-repo /cvmfs/dunedaq.opensciencegrid.org/pypi-repo" >> Dockerfile
echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: ${{ github.workspace }}/docker-build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build_alma9_externals2:
name: build_al9_initial2
runs-on: daq
permissions:
packages: write
contents: read
steps:
- name: Intro
run: |
echo "Will create a ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }} image"
echo "Image contents will include $HOSTNAME:/home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq/spack/externals/ext-v2.0"
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/dune-daq/alma9-slim-externals
tags: |
type=raw,value=v2.0${{ github.event.inputs.tag-suffix }}-initial
- name: prepare build dir
id: prep_build_dir
run: |
build_dir="/home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq"
cd $build_dir
refresh_date=$(date +%y-%m-%d)
echo "FROM ghcr.io/dune-daq/alma9-spack:latest" > Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_AT $refresh_date" >> Dockerfile
echo "ADD spack/externals/ext-v2.0 /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.0" >> Dockerfile
echo "RUN source /cvmfs/dunedaq.opensciencegrid.org/spack/externals/ext-v2.0/spack-0.20.0/share/spack/setup-env.sh && spack uninstall -y llvm || true" >> Dockerfile
echo "ADD tools /cvmfs/dunedaq.opensciencegrid.org/tools" >> Dockerfile
echo "ADD assets /cvmfs/dunedaq.opensciencegrid.org/assets" >> Dockerfile
echo "ADD setup_dunedaq.sh /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh" >> Dockerfile
echo "ADD pypi-repo /cvmfs/dunedaq.opensciencegrid.org/pypi-repo" >> Dockerfile
echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: /home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Clean up
if: always()
run: |
rm -f /home/nfs/${{ github.event.inputs.account-to-copy }}/docker-scratch/cvmfs_dunedaq/Dockerfile
docker image prune -f
docker container prune -f
docker network prune -f
docker volume prune -f
build_alma9_slim_externals2:
name: build_alma9_2
runs-on: daq
needs: build_alma9_externals2
permissions:
packages: write
contents: read
steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/dune-daq/alma9-slim-externals
tags: |
type=raw,value=v2.0${{ github.event.inputs.tag-suffix }}
- name: prepare build dir
run: |
build_dir="${{ github.workspace }}/docker-build"
mkdir -p $build_dir
cd $build_dir
refresh_date=$(date +%y-%m-%d)
echo "FROM ghcr.io/dune-daq/alma9-spack:latest" > Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_AT $refresh_date" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/spack /cvmfs/dunedaq.opensciencegrid.org/spack" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/tools /cvmfs/dunedaq.opensciencegrid.org/tools" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/assets /cvmfs/dunedaq.opensciencegrid.org/assets" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:v2.0${{ github.event.inputs.tag-suffix }}-initial /cvmfs/dunedaq.opensciencegrid.org/pypi-repo /cvmfs/dunedaq.opensciencegrid.org/pypi-repo" >> Dockerfile
echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: ${{ github.workspace }}/docker-build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}