Add/ecp copa exampm #122
Workflow file for this run
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: build containers metrics-operator | |
on: | |
pull_request: [] | |
push: | |
branches: | |
- main | |
jobs: | |
build-containers: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
test: [["sysstat", "ghcr.io/converged-computing/metric-sysstat:latest"], | |
["osu-benchmark", "ghcr.io/converged-computing/metric-osu-benchmark:latest"], | |
["fio", "ghcr.io/converged-computing/metric-fio:latest"], | |
["amg", "ghcr.io/converged-computing/metric-amg:latest"], | |
["hwloc", "ghcr.io/converged-computing/metric-hwloc:latest"], | |
["chatterbug", "ghcr.io/converged-computing/metric-chatterbug:latest"], | |
["pennant", "ghcr.io/converged-computing/metric-pennant:latest"], | |
["hpl-spack", "ghcr.io/converged-computing/metric-hpl-spack:latest"], | |
["hpl", "ghcr.io/converged-computing/metric-hpl:latest"], | |
["ior", "ghcr.io/converged-computing/metric-ior:latest"], | |
["exaMPM", "ghcr.io/converged-computing/metric-exampm:latest"], | |
["cabanaPIC", "ghcr.io/converged-computing/metric-cabanapic:latest"], | |
["charmpp", "ghcr.io/converged-computing/metric-charmpp:latest"], | |
["qmcpack", "ghcr.io/converged-computing/metric-qmcpack:latest"], | |
["quicksilver", "ghcr.io/converged-computing/metric-quicksilver:latest"], | |
["ovis-hpc", "ghcr.io/converged-computing/metric-ovis-hpc:latest"], | |
["kripke", "ghcr.io/converged-computing/metric-kripke:latest"], | |
["mpitrace-rocky", "ghcr.io/converged-computing/metric-mpitrace:rocky"], | |
["darshan-view", "ghcr.io/converged-computing/metric-darshan-view:ubuntu"], | |
["darshan-view-rocky", "ghcr.io/converged-computing/metric-darshan-view:rocky"], | |
["hpctoolkit-viewer", "ghcr.io/converged-computing/metric-hpctoolkit-viewer:latest"], | |
["hpctoolkit-view", "ghcr.io/converged-computing/metric-hpctoolkit-view:ubuntu"], | |
["hpctoolkit-view-rocky", "ghcr.io/converged-computing/metric-hpctoolkit-view:rocky"], | |
["hpctoolkit-spack", "ghcr.io/converged-computing/metric-hpctoolkit-spack:latest"], | |
["hpctoolkit", "ghcr.io/converged-computing/metric-hpctoolkit:latest"], | |
["bdas", "ghcr.io/converged-computing/metric-bdas:latest"], | |
["laghos", "ghcr.io/converged-computing/metric-laghos:latest"], | |
["nekbone", "ghcr.io/converged-computing/metric-nekbone:latest"], | |
["lammps-intel-mpi-rocky", "ghcr.io/converged-computing/metric-lammps-intel-mpi:rocky"], | |
["lammps", "ghcr.io/converged-computing/metric-lammps:latest"], | |
["perf-kit-benchmarker", "ghcr.io/converged-computing/metric-perf-kit-benchmarker:latest"]] | |
steps: | |
- name: Clone the code | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v37 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ^1.20 | |
- name: GHCR Login | |
if: (github.event_name != 'pull_request') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull Layers (if exist) | |
env: | |
container: ${{ matrix.test[1] }} | |
run: docker pull ${container} || echo "${container} not pushed yet" | |
- name: Make Space For Build | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
- name: Build Container | |
env: | |
context: ${{ matrix.test[0] }} | |
container: ${{ matrix.test[1] }} | |
run: | | |
cd ${context} | |
dockerfile=$(realpath Dockerfile) | |
dobuild="no" | |
cd - | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
file=$(realpath $file) | |
echo "Looking at changed file ${file}" | |
if [[ "$file" == "$dockerfile" ]]; then | |
echo "$file was changed and warrants build" | |
cd ${context} | |
docker build -t ${container} . | |
dobuild="yes" | |
fi | |
# Exit after we have found the match | |
if [[ "$dobuild" == "yes" ]]; then | |
break | |
fi | |
done | |
echo "dobuild=${dobuild}" >> $GITHUB_ENV | |
- name: Deploy Container | |
if: (github.event_name != 'pull_request' && env.dobuild == 'yes') | |
env: | |
container: ${{ matrix.test[1] }} | |
run: docker push ${container} | |