-
Notifications
You must be signed in to change notification settings - Fork 0
289 lines (241 loc) · 10.5 KB
/
build-fddatautilities-alma9.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
name: Alma9 fddatautilities build
on:
workflow_dispatch:
inputs:
tag-prefix:
description: 'fddatautilities tag prefix'
default: ''
feature-branch:
description: 'feature branch to be used across all DAQ repos wherever possible.'
default: develop
cvmfs-deployment:
description: 'whether to deploy the release to cvmfs'
default: 'no'
jobs:
make_nightly_tag:
name: create nightly tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.create_nightly_tag.outputs.nightly_tag }}
defaults:
run:
shell: bash
steps:
- id: create_nightly_tag
run: |
date_tag=$(date +%y%m%d)
echo "nightly_tag=${{ github.event.inputs.tag-prefix }}_DEV_${date_tag}_A9" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
build_the_develop_release_spack:
name: build_dev_release_spack
runs-on: daq
needs: make_nightly_tag
container:
image: ghcr.io/dune-daq/alma9-slim-externals:fddatautilities
defaults:
run:
shell: bash
steps:
- name: Checkout daq-release
uses: actions/checkout@v4
with:
path: daq-release
- name: setup directories and install spack for the dunedaq release
env:
NIGHTLY_TAG: ${{needs.make_nightly_tag.outputs.tag}}
run: |
export CORE_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/nightly/NB${NIGHTLY_TAG}
export FULL_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/nightly/NFDDU${NIGHTLY_TAG}
export OS=almalinux9
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $CORE_RELEASE_DIR $FULL_RELEASE_DIR core $OS ${{ github.event.inputs.feature-branch }}
cd $CORE_RELEASE_DIR/../
tar_and_stage_release ${CORE_RELEASE_TAG}
- name: upload spack nightly tarball for core release
uses: actions/upload-artifact@v3
with:
name: nightly_dunedaq
path: ${{ github.workspace }}/tarballs_for_upload/NB${{needs.make_nightly_tag.outputs.tag}}.tar.gz
- name: setup directories and install spack for the fddu release
env:
NIGHTLY_TAG: ${{needs.make_nightly_tag.outputs.tag}}
run: |
export CORE_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/nightly/NB${NIGHTLY_TAG}
export FULL_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/nightly/NFDDU${NIGHTLY_TAG}
export OS=almalinux9
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $CORE_RELEASE_DIR $FULL_RELEASE_DIR fddatautilities $OS ${{ github.event.inputs.feature-branch }}
cd $FULL_RELEASE_DIR/../
tar_and_stage_release ${FULL_RELEASE_TAG}
- name: upload spack nightly tarball for far detector release
uses: actions/upload-artifact@v3
with:
name: nightly_fddatautilities
path: ${{ github.workspace }}/tarballs_for_upload/NFDDU${{needs.make_nightly_tag.outputs.tag}}.tar.gz
# update_build_image:
# name: update_spack_build_image_nightly
# runs-on: daq
# strategy:
# matrix:
# include:
# - input_image: "ghcr.io/dune-daq/alma9-slim-externals:fddatautilities"
# output_image: "ghcr.io/dune-daq/nightly-release-alma9"
# tag: "fddatautilities"
# needs: [build_the_develop_release_spack, make_nightly_tag]
# environment: dockerhub
# permissions:
# packages: write
# contents: read
# steps:
# - name: clean docker-build
# run: |
# mkdir -p ${GITHUB_WORKSPACE}/docker-build
# rm -rf ${GITHUB_WORKSPACE}/docker-build/*
# - name: Download spack nightly release tarball artifact for core release
# uses: actions/download-artifact@v3
# with:
# name: nightly_dunedaq
# path: ${{ github.workspace }}/docker-build
# - name: Download spack nightly release tarball artifact for far detector release
# uses: actions/download-artifact@v3
# with:
# name: nightly_fddatautilities
# path: ${{ github.workspace }}/docker-build
# - name: prepare cvmfs mirror spack-nightly
# env:
# NIGHTLY_TAG: ${{needs.make_nightly_tag.outputs.tag}}
# run: |
# cd ${{ github.workspace }}/docker-build
# mkdir -p nightly
# cd nightly
# core_tag="NB${NIGHTLY_TAG}"
# tar xf ../${core_tag}.tar.gz
# rm -rf ../${core_tag}.tar.gz
# fddatautilities_tag="NFDDU${NIGHTLY_TAG}"
# tar xf ../${fddatautilities_tag}.tar.gz
# rm -rf ../${fddatautilities_tag}.tar.gz
# cd ..
# echo "FROM "${{ matrix.input_image }} > Dockerfile
# echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
# echo "ENV REFRESHED_AT ${NIGHTLY_TAG}" >> Dockerfile
# echo "COPY --from=ghcr.io/dune-daq/pypi-repo:latest /cvmfs/dunedaq.opensciencegrid.org/pypi-repo /cvmfs/dunedaq.opensciencegrid.org/pypi-repo" >> Dockerfile
# echo "ADD nightly /cvmfs/dunedaq-development.opensciencegrid.org/nightly" >> Dockerfile
# echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
# - 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/nightly-release-alma9
# tags: |
# type=raw,value=fddatautilities
# - name: Build and push Docker images
# uses: docker/build-push-action@v5
# with:
# context: ${{ github.workspace }}/docker-build
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
update_run_image:
name: update_spack_run_image_nightly
needs: [build_the_develop_release_spack, make_nightly_tag]
runs-on: daq
permissions:
packages: write
contents: read
environment: dockerhub
steps:
- name: clean docker-build
run: |
mkdir -p ${GITHUB_WORKSPACE}/docker-build
rm -rf ${GITHUB_WORKSPACE}/docker-build/*
- name: Download spack nightly release tarball artifact for core release
uses: actions/download-artifact@v3
with:
name: nightly_dunedaq
path: ${{ github.workspace }}/docker-build
- name: Download spack nightly release tarball artifact for far detector release
uses: actions/download-artifact@v3
with:
name: nightly_fddatautilities
path: ${{ github.workspace }}/docker-build
- name: prepare cvmfs mirror spack-nightly
env:
NIGHTLY_TAG: ${{needs.make_nightly_tag.outputs.tag}}
run: |
cd ${{ github.workspace }}/docker-build
mkdir -p nightly
cd nightly
core_tag="NB${NIGHTLY_TAG}"
tar xf ../${core_tag}.tar.gz
rm -rf ../${core_tag}.tar.gz
fddatautilities_tag="NFDDU${NIGHTLY_TAG}"
tar xf ../${fddatautilities_tag}.tar.gz
rm -rf ../${fddatautilities_tag}.tar.gz
cd ..
echo "FROM ghcr.io/dune-daq/alma9-spack:latest" > Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_AT ${NIGHTLY_TAG}" >> Dockerfile
echo "COPY --from=ghcr.io/dune-daq/alma9-slim-externals:fddatautilities_runonly-initial /cvmfs/dunedaq.opensciencegrid.org /cvmfs/dunedaq.opensciencegrid.org" >> Dockerfile
echo "ADD nightly /cvmfs/dunedaq-development.opensciencegrid.org/nightly" >> Dockerfile
echo 'ENTRYPOINT ["/bin/bash"]' >> Dockerfile
- 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/nightly-release-alma9
tags: |
type=raw,value=fddatautilities_runonly
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: ${{ github.workspace }}/docker-build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# publish_to_cvmfs:
# name: publish to cvmfs
# needs: update_build_image
# runs-on: daq
# steps:
# - name: check_cvmfs_deployment
# id: do_deployment
# run: |
# cvmfs_deployment_input=${{ github.event.inputs.cvmfs-deployment }}
# cvmfs_deployment_flag=${cvmfs_deployment_input:-"yes"}
# echo "Do cvmfs deployment: ${cvmfs_deployment_flag}"
# [[ ${cvmfs_deployment_flag} == 'yes' ]] && exit 0 || exit 1
# continue-on-error: true
# - name: start docker container, and then rsync...
# if: steps.do_deployment.outcome == 'success'
# run: |
# [[ ${DO_DEPLOYMENT} == 'no' ]] && exit 0
# cd $GITHUB_WORKSPACE
# IMAGE="ghcr.io/dune-daq/nightly-release-alma9:fddatautilities"
# unique_name=$( date | tr " :" _ )
# docker pull $IMAGE
# files_to_copy=$( docker run --rm --entrypoint ls $IMAGE /cvmfs/dunedaq-development.opensciencegrid.org/nightly )
# docker run --name $unique_name $IMAGE
# mkdir $unique_name
# for file in $files_to_copy; do
# docker cp $unique_name:/cvmfs/dunedaq-development.opensciencegrid.org/nightly/$file $unique_name
# done
# docker rm $unique_name
# kinit -k -t $HOME/daq-nightly.keytab nightly-build/dune/[email protected]
# ssh -o StrictHostKeyChecking=no -l cvmfsdunedaqdev oasiscfs01.fnal.gov "cvmfs_server transaction dunedaq-development.opensciencegrid.org"
# rsync -e "ssh -o StrictHostKeyChecking=no" -rlpt --stats $unique_name/* [email protected]:/cvmfs/dunedaq-development.opensciencegrid.org/nightly
# ssh -o StrictHostKeyChecking=no -l cvmfsdunedaqdev oasiscfs01.fnal.gov "cvmfs_server publish dunedaq-development.opensciencegrid.org"
# rm -rf $unique_name