Alma9 build v4 production frozen release #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Alma9 build v4 production frozen 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: 'frozen release number, e.g. 1' | |
required: true | |
jobs: | |
build_the_frozen_release_spack: | |
name: build_frozen_release_spack | |
runs-on: daq | |
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 base release | |
run: | | |
export DET=${{ github.event.inputs.det }} | |
export BASE_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/coredaq-${{ github.event.inputs.base-release }}-a9-${{ github.event.inputs.build-number }} | |
export DET_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/${DET}daq-${{ github.event.inputs.det-release }}-a9-${{ github.event.inputs.build-number }} | |
export OS=almalinux9 | |
source daq-release/.github/workflows/wf-setup-tools.sh | |
daq-release/scripts/checkout-daq-package.py -i daq-release/configs/coredaq/coredaq-${{ github.event.inputs.base-release }}/release.yaml -a -c -o $DET_RELEASE_DIR/sourcecode | |
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 frozen release tarball for base release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frozens_coredaq | |
path: ${{ github.workspace }}/tarballs_for_upload/coredaq-${{ github.event.inputs.base-release }}-a9-${{ github.event.inputs.build-number }}.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.opensciencegrid.org/spack/releases/coredaq-${{ github.event.inputs.base-release }}-a9-${{ github.event.inputs.build-number }} | |
export DET_RELEASE_DIR=/cvmfs/dunedaq.opensciencegrid.org/spack/releases/${DET}daq-${{ github.event.inputs.det-release }}-a9-${{ github.event.inputs.build-number }} | |
export OS=almalinux9 | |
source daq-release/.github/workflows/wf-setup-tools.sh | |
daq-release/scripts/checkout-daq-package.py -i daq-release/configs/fddaq/fddaq-${{ github.event.inputs.det-release }}/release.yaml -a -c -o $DET_RELEASE_DIR/sourcecode | |
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 frozen release tarball for detector release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frozens_${{ github.event.inputs.det }}daq | |
path: ${{ github.workspace }}/tarballs_for_upload/${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-a9-${{ github.event.inputs.build-number }}.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.0" | |
output_image: "ghcr.io/dune-daq/frozen-release-alma9" | |
tag: ${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-a9 | |
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 base release | |
uses: actions/download-artifact@v3 | |
with: | |
name: frozens_coredaq | |
path: ${{ github.workspace }}/docker-build | |
- name: Download spack frozen release tarball artifact for detector release | |
uses: actions/download-artifact@v3 | |
with: | |
name: frozens_${{ github.event.inputs.det }}daq | |
path: ${{ github.workspace }}/docker-build | |
- name: prepare cvmfs mirror spack-frozens | |
run: | | |
cd ${{ github.workspace }}/docker-build | |
mkdir -p releases | |
cd releases | |
base_tag=coredaq-${{ github.event.inputs.base-release }}-a9 | |
tar xf ../${base_tag}-${{ github.event.inputs.build-number }}.tar.gz | |
rm -rf ../${base_tag}-${{ github.event.inputs.build-number }}.tar.gz | |
tar xf ../${{ matrix.tag }}-${{ github.event.inputs.build-number }}.tar.gz | |
rm -rf ../${{ matrix.tag }}-${{ github.event.inputs.build-number }}.tar.gz | |
ln -s ${{ matrix.tag }}-${{ github.event.inputs.build-number }} ${{ matrix.tag }} | |
cd .. | |
echo "FROM "${{ matrix.input_image }} > Dockerfile | |
echo 'MAINTAINER John Freeman "[email protected]"' >> 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 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.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/frozen-release-alma9:${{ github.event.inputs.det }}daq-${{ github.event.inputs.det-release }}-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 ${DET}daq-${{ github.event.inputs.det-release }}-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 |