-
Notifications
You must be signed in to change notification settings - Fork 0
187 lines (156 loc) · 7.55 KB
/
build-candidate-release-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
name: Alma9 build v5 candidate release
on:
workflow_dispatch:
inputs:
base-release:
description: 'targeted base release (e.g. v4.4.0)'
required: true
det-release:
description: 'targeted detector release (e.g. v4.3.0)'
required: true
det:
description: 'detector type (nd or fd)'
required: true
build-number:
description: 'candidate release number, e.g. 1'
required: true
jobs:
build_the_candidate_release_spack:
name: build_dev_release_spack
runs-on: daq
container:
image: ghcr.io/dune-daq/alma9-slim-externals:v2.1
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 base release
run: |
export DET=${{ github.event.inputs.det }}
export BASE_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/candidates/coredaq-${{ github.event.inputs.base-release }}-rc${{ github.event.inputs.build-number }}-a9
export DET_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/candidates/${DET}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9
export OS=almalinux9
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $BASE_RELEASE_DIR $DET_RELEASE_DIR core $OS
cd $BASE_RELEASE_DIR/..
tar_and_stage_release $BASE_RELEASE_TAG
- name: upload spack candidate release tarball for base release
uses: actions/upload-artifact@v3
with:
name: candidates_coredaq
path: ${{ github.workspace }}/tarballs_for_upload/coredaq-${{ github.event.inputs.base-release }}-rc${{ github.event.inputs.build-number }}-a9.tar.gz
- name: setup directories and install spack for the detector release
run: |
export DET=${{ github.event.inputs.det }}
export BASE_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/candidates/coredaq-${{ github.event.inputs.base-release }}-rc${{ github.event.inputs.build-number }}-a9
export DET_RELEASE_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/candidates/${DET}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9
export OS=almalinux9
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $BASE_RELEASE_DIR $DET_RELEASE_DIR $DET $OS
cd $DET_RELEASE_DIR/..
tar_and_stage_release $DET_RELEASE_TAG
- name: upload spack candidate release tarball for detector release
uses: actions/upload-artifact@v3
with:
name: candidates_${{ github.event.inputs.det }}daq
path: ${{ github.workspace }}/tarballs_for_upload/${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9.tar.gz
update_image:
name: update_spack_image_rc
runs-on: ubuntu-latest
strategy:
matrix:
include:
- input_image: "ghcr.io/dune-daq/alma9-slim-externals:v2.1"
output_image: "ghcr.io/dune-daq/candidate-release-alma9"
tag: ${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9
needs: build_the_candidate_release_spack
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 candidate release tarball artifact for base release
uses: actions/download-artifact@v3
with:
name: candidates_coredaq
path: ${{ github.workspace }}/docker-build
- name: Download spack candidate release tarball artifact for detector release
uses: actions/download-artifact@v3
with:
name: candidates_${{ github.event.inputs.det }}daq
path: ${{ github.workspace }}/docker-build
- name: prepare cvmfs mirror spack-candidates
run: |
cd ${{ github.workspace }}/docker-build
mkdir -p candidates
cd candidates
base_tag=coredaq-${{ github.event.inputs.base-release }}-rc${{ github.event.inputs.build-number }}-a9
tar xf ../${base_tag}.tar.gz
rm -rf ../${base_tag}.tar.gz
tar xf ../${{ matrix.tag }}.tar.gz
rm -rf ../${{ matrix.tag }}.tar.gz
cd ..
echo "FROM "${{ matrix.input_image }} > Dockerfile
echo 'MAINTAINER John Freeman "jcfree@fnal.gov"' >> Dockerfile
echo "ENV REFRESHED_FOR "${{ matrix.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 candidates /cvmfs/dunedaq-development.opensciencegrid.org/candidates" >> 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: |
${{ matrix.output_image }}
tags: |
type=raw,value=${{ matrix.tag }}
- 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 }}
generate_dbt_setup_release_env:
name: generate_dbt_setup_release_env
runs-on: ubuntu-latest
needs: update_image
container:
image: ghcr.io/dune-daq/candidate-release-alma9:${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9
defaults:
run:
shell: bash
steps:
- name: create dbt-setup-release-env.sh and daq_app_rte.sh for detector release
run: |
DET=${{ github.event.inputs.det }}
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest || true
dbt-setup-release -b candidate ${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-rc${{ github.event.inputs.build-number }}-a9
declare -x > ${GITHUB_WORKSPACE}/${DET}daq-dbt-setup-release-env.sh
declare -f >> ${GITHUB_WORKSPACE}/${DET}daq-dbt-setup-release-env.sh
egrep "declare -x (PATH|.*_SHARE|CET_PLUGIN_PATH|DUNEDAQ_SHARE_PATH|LD_LIBRARY_PATH|LIBRARY_PATH|PYTHONPATH)=" ${GITHUB_WORKSPACE}/${DET}daq-dbt-setup-release-env.sh > ${GITHUB_WORKSPACE}/${DET}daq_app_rte.sh
- name: upload ${{ github.event.inputs.det }}daq-dbt-setup-release-env.sh
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.inputs.det }}daq-dbt_setup_release_env
path: ${{ github.workspace }}/${{ github.event.inputs.det }}daq-dbt-setup-release-env.sh
- name: upload ${{ github.event.inputs.det }}daq_app_rte.sh
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.inputs.det }}daq_app_rte
path: ${{ github.workspace }}/${{ github.event.inputs.det }}daq_app_rte.sh