Skip to content

Images update with VeloC #432

Images update with VeloC

Images update with VeloC #432

name: Spack images
on:
schedule: [ { cron: "50 23 * * 0" } ] # run every Sunday 23h50
push: { branches: [ main, 'v*' ] }
pull_request:
workflow_dispatch:
inputs:
cache:
description: 'Reuse previously cached runs if available'
required: false
default: true
type: boolean
defaults:
run:
shell: bash
jobs:
step_1_base_2_spackbase:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with: { submodules: 'recursive' }
- name: "Build and push 1- base"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/1-base
image-name: base
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
cache: ${{ github.event_name != 'schedule' && ( github.event_name != 'workflow_dispatch' || inputs.cache ) }} # cache for every run but scheduled ones
- name: "Build and push 2- spackbase"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/2-spackbase
image-name: spackbase
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
step_3_baselibs:
strategy:
fail-fast: false
matrix:
version: ['latest', 'oldest']
compiler: ['gcc', 'clang']
needs: step_1_base_2_spackbase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with: { submodules: 'recursive' }
- name: "Build and push 3- baselibs"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/3-baselibs
image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-baselibs
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
build-args: |
VERSION=${{ matrix.version }}
COMPILER=${{ matrix.compiler }}
step_4_mini_5_all:
strategy:
fail-fast: false
matrix:
version: ['latest', 'oldest']
compiler: ['gcc', 'clang']
mpi: ['openmpi','mpich']
needs: step_3_baselibs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with: { submodules: 'recursive' }
- name: "Build and push 4- mini"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/4-mini
image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-mini
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
build-args: |
VERSION=${{ matrix.version }}
COMPILER=${{ matrix.compiler }}
MPI=${{ matrix.mpi }}
- name: "Build and push 5- all"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/5-all
image-name: builder:${{ matrix.version }}-${{ matrix.compiler }}-${{ matrix.mpi }}-all
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
build-args: |
VERSION=${{ matrix.version }}
COMPILER=${{ matrix.compiler }}
MPI=${{ matrix.mpi }}
step6_finalize:
strategy:
fail-fast: false
matrix:
version: ['latest', 'oldest']
compiler: ['gcc', 'clang']
mpi: ['openmpi','mpich']
level: ['mini', 'all']
needs: step_4_mini_5_all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with: { submodules: 'recursive' }
- name: "Compute tags"
id: info
run: |
if [ 'true' = "${{ github.event_name == 'push' || github.event_name == 'schedule' }}" ]
then
echo "tags=ghcr.io/pdidev/spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}"
echo "fullspack=ghcr.io/pdidev/fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}:${{github.ref_name}}" >> "${GITHUB_OUTPUT}"
fi
- name: "Build and no push"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/6-finalize
image-name: spack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}
test: true
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
build-args: |
VERSION=${{ matrix.version }}
COMPILER=${{ matrix.compiler }}
MPI=${{ matrix.mpi }}
LIBS=${{ matrix.level }}
tags: |
${{ steps.info.outputs.tags }}
- name: "Build and push fullspack"
uses: pdidev/test_env/.github/actions/build@v4
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
context: "./"
path: spack/6-finalize
image-name: fullspack/${{ matrix.version }}/${{ matrix.compiler }}/${{ matrix.mpi }}/${{ matrix.level }}
target: fullspack
push : "false"
cache-to: "type=registry,ref=ghcr.io/iole-bolognesi/test_env/cache/${{ matrix.base }}/${{ matrix.mpi }}/${{ matrix.variant }},mode=max"
build-args: |
VERSION=${{ matrix.version }}
COMPILER=${{ matrix.compiler }}
MPI=${{ matrix.mpi }}
LIBS=${{ matrix.level }}
tags: |
${{ steps.info.outputs.fullspack }}