Skip to content

Commit

Permalink
JCF: add v2.0 externals to the slim externals image creation Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
John Freeman committed Apr 8, 2024
1 parent cbf8dce commit 374b54c
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/slim_externals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,113 @@ jobs:
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@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
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" >> Dockerfile
echo "ADD tools /cvmfs/dunedaq.opensciencegrid.org/tools" >> 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@v3
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@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
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/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@v3
with:
context: ${{ github.workspace }}/docker-build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 374b54c

Please sign in to comment.