-
Notifications
You must be signed in to change notification settings - Fork 0
185 lines (154 loc) · 6.54 KB
/
build-frozen-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
name: Alma9 Build frozen release
on:
workflow_dispatch:
inputs:
release:
description: 'targeted release (e.g. v4.1.0)'
required: true
build-number:
description: 'frozen release build number, e.g. 1'
required: true
jobs:
build_the_frozen_release_spack:
name: build_frozen_release_spack
runs-on: isc01
container:
image: ghcr.io/dune-daq/alma9-slim-externals:v2.0
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
run: |
export BASE_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/dunedaq-${{ github.event.inputs.release }}-a9
export DET_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/fddaq-${{ github.event.inputs.release }}-a9
export OS=almalinux9
export BUILD_NUMBER=${{ github.event.inputs.build-number }}
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $BASE_RELEASE_DIR $DET_RELEASE_DIR dune $OS
cd $BASE_RELEASE_DIR/..
tar_and_stage_release $BASE_RELEASE_TAG
- name: upload spack frozen release tarball for dunedaq
uses: actions/upload-artifact@v3
with:
name: frozens_dunedaq
path: ${{ github.workspace }}/tarballs_for_upload/dunedaq-${{ github.event.inputs.release }}-a9.tar.gz
- name: setup directories and install spack for the fddaq release
run: |
export BASE_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/dunedaq-${{ github.event.inputs.release }}-a9
export DET_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/fddaq-${{ github.event.inputs.release }}-a9
export OS=almalinux9
export BUILD_NUMBER=${{ github.event.inputs.build-number }}
source daq-release/.github/workflows/wf-setup-tools.sh
daq-release/scripts/spack/build-release.sh $BASE_RELEASE_DIR $DET_RELEASE_DIR fd $OS
cd $DET_RELEASE_DIR/..
tar_and_stage_release $DET_RELEASE_TAG
- name: upload spack frozen release tarball for fddaq
uses: actions/upload-artifact@v3
with:
name: frozens_fddaq
path: ${{ github.workspace }}/tarballs_for_upload/fddaq-${{ github.event.inputs.release }}-a9.tar.gz
update_image:
name: update_spack_image_rc
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: "ghcr.io/dune-daq/alma9-slim-externals"
os_name: "al9"
needs: build_the_frozen_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 frozen release tarball artifact for dunedaq
uses: actions/download-artifact@v3
with:
name: frozens_dunedaq
path: ${{ github.workspace }}/docker-build
- name: Download spack frozen release tarball artifact for fddaq
uses: actions/download-artifact@v3
with:
name: frozens_fddaq
path: ${{ github.workspace }}/docker-build
- name: prepare cvmfs mirror spack-frozens
run: |
cd ${{ github.workspace }}/docker-build
mkdir -p releases
export EXT_VERSION=v2.0
image_name="${{ matrix.image }}:${EXT_VERSION}"
cd releases
dunedaq_tag=dunedaq-${{ github.event.inputs.release }}-a9
tar xvf ../${dunedaq_tag}.tar.gz
rm -rf ../${dunedaq_tag}.tar.gz
fddaq_tag=fddaq-${{ github.event.inputs.release }}-a9
tar xvf ../${fddaq_tag}.tar.gz
rm -rf ../${fddaq_tag}.tar.gz
cd ${fddaq_tag}; ln -s spack-*-gcc-* default; cd ..
cd ..
echo "FROM ${image_name}"> Dockerfile
echo 'MAINTAINER John Freeman "[email protected]"' >> Dockerfile
echo "ENV REFRESHED_FOR ${fddaq_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 releases /cvmfs/dunedaq.opensciencegrid.org/spack/releases" >> 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.image }}
tags: |
type=raw,value=spack-dev-frozen-split
- 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_${{ matrix.os_name }}
runs-on: ubuntu-latest
needs: update_image
container:
image: "ghcr.io/dune-daq/alma9-slim-externals:spack-dev-frozen-split-test"
defaults:
run:
shell: bash
steps:
- name: create dbt-setup-release-env.sh and daq_app_rte.sh for fddaq
run: |
DET=fd
daq_tag=${DET}daq-${{ github.event.inputs.release }}-a9
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest|| true
dbt-setup-release ${daq_tag}
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 fddaq-dbt-setup-release-env.sh
uses: actions/upload-artifact@v3
with:
name: fddaq-dbt_setup_release_env
path: ${{ github.workspace }}/fddaq-dbt-setup-release-env.sh
- name: upload fddaq_app_rte.sh
uses: actions/upload-artifact@v3
with:
name: fddaq_app_rte
path: ${{ github.workspace }}/fddaq_app_rte.sh