Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Description

Place a description of your PR here

## Checklist
- [ ] If creating a new version of the tutorial, create a new directory at the root of the repository with the relevant name
- [ ] Ensure all Docker-related material except for tutorial contents goes in a `docker` subdirectory
- [ ] Update `github_ci_matrix.json` with (1) the tag you will eventually use for the tutorial Docker images (place in the `"tag"` field) and (2) the name of the directory for your version of the tutorial (place in the `"tutorial_dir"` field)
362 changes: 362 additions & 0 deletions .github/workflows/push_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,362 @@
name: Build containers and push to GHCR

on:
workflow_dispatch:
inputs:
tag:
type: string
description: Tag to use for the uploaded containers
required: true
tutorial_dir:
type: string
description: The directory (relative to repo root) for the tutorial you want to build
required: true

jobs:
setup_shared_matrix:
runs-on: ubuntu-latest
outputs:
matrix_data: ${{ steps.set-matrix.outputs.matrix_data }}

steps:
- id: set-matrix
run: |
matrix_data='{"docker_os": ["linux"], "docker_arch": ["amd64"]}'
echo "matrix_data=$matrix_data" >> "$GITHUB_OUTPUT"

build_caliper_container:
needs: setup_shared_matrix
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
tag:
- ${{ github.event.inputs.tag }}
tutorial_dir:
- ${{ github.event.inputs.tutorial_dir }}
docker_os: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_os }}
docker_arch: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_arch }}
containers_to_build:
- ["docker/Dockerfile.caliper", "ghcr.io/llnl/caliper"]

steps:
- uses: actions/checkout@v4

- name: Remove unneeded stuff to make space for container
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull layers if they exist
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker pull ${container} || echo "${container} has not yet been pushed"

- name: Build container
env:
context: ${{ matrix.tutorial_dir }}
dockerfile: ${{ matrix.containers_to_build[0] }}
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
platform: "${{ matrix.docker_os }}/${{ matrix.docker_arch }}"
run: |
cd ${context}
docker build --progress=plain --platform ${platform} -f ${dockerfile} -t ${container} .

- name: Deploy container
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker push ${container}

build_thicket_container:
needs:
- setup_shared_matrix
- build_caliper_container
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
tag:
- ${{ github.event.inputs.tag }}
tutorial_dir:
- ${{ github.event.inputs.tutorial_dir }}
docker_os: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_os }}
docker_arch: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_arch }}
containers_to_build:
- ["docker/Dockerfile.thicket", "ghcr.io/llnl/thicket"]

steps:
- uses: actions/checkout@v4

- name: Remove unneeded stuff to make space for container
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull layers if they exist
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker pull ${container} || echo "${container} has not yet been pushed"

- name: Build container
env:
context: ${{ matrix.tutorial_dir }}
dockerfile: ${{ matrix.containers_to_build[0] }}
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
platform: "${{ matrix.docker_os }}/${{ matrix.docker_arch }}"
run: |
cd ${context}
docker build --progress=plain --platform ${platform} -f ${dockerfile} -t ${container} .

- name: Deploy container
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker push ${container}

build_benchpark_container:
needs:
- setup_shared_matrix
- build_thicket_container
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
tag:
- ${{ github.event.inputs.tag }}
tutorial_dir:
- ${{ github.event.inputs.tutorial_dir }}
docker_os: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_os }}
docker_arch: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_arch }}
containers_to_build:
- ["docker/Dockerfile.benchpark", "ghcr.io/llnl/benchpark"]

steps:
- uses: actions/checkout@v4

- name: Remove unneeded stuff to make space for container
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull layers if they exist
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker pull ${container} || echo "${container} has not yet been pushed"

- name: Build container
env:
context: ${{ matrix.tutorial_dir }}
dockerfile: ${{ matrix.containers_to_build[0] }}
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
platform: "${{ matrix.docker_os }}/${{ matrix.docker_arch }}"
run: |
cd ${context}
docker build --progress=plain --platform ${platform} -f ${dockerfile} -t ${container} .

- name: Deploy container
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker push ${container}

build_spawn_container:
needs:
- setup_shared_matrix
- build_benchpark_container
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
tag:
- ${{ github.event.inputs.tag }}
tutorial_dir:
- ${{ github.event.inputs.tutorial_dir }}
docker_os: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_os }}
docker_arch: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_arch }}
containers_to_build:
- ["docker/Dockerfile.spawn", "ghcr.io/llnl/reproducible-benchmarking-spawn"]

steps:
- uses: actions/checkout@v4

- name: Remove unneeded stuff to make space for container
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull layers if they exist
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker pull ${container} || echo "${container} has not yet been pushed"

- name: Build container
env:
context: ${{ matrix.tutorial_dir }}
dockerfile: ${{ matrix.containers_to_build[0] }}
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
platform: "${{ matrix.docker_os }}/${{ matrix.docker_arch }}"
run: |
cd ${context}
docker build --progress=plain --platform ${platform} -f ${dockerfile} -t ${container} .

- name: Deploy container
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker push ${container}

build_init_container:
needs:
- setup_shared_matrix
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
tag:
- ${{ github.event.inputs.tag }}
tutorial_dir:
- ${{ github.event.inputs.tutorial_dir }}
docker_os: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_os }}
docker_arch: ${{ fromJson(needs.setup_shared_matrix.outputs.matrix_data).docker_arch }}
containers_to_build:
- ["docker/Dockerfile.init", "ghcr.io/llnl/reproducible-benchmarking-init"]

steps:
- uses: actions/checkout@v4

- name: Remove unneeded stuff to make space for container
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true

- name: Set up Docker
uses: docker/setup-docker-action@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull layers if they exist
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker pull ${container} || echo "${container} has not yet been pushed"

- name: Build container
env:
context: ${{ matrix.tutorial_dir }}
dockerfile: ${{ matrix.containers_to_build[0] }}
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
platform: "${{ matrix.docker_os }}/${{ matrix.docker_arch }}"
run: |
cd ${context}
docker build --progress=plain --platform ${platform} -f ${dockerfile} -t ${container} .

- name: Deploy container
env:
container: "${{ matrix.containers_to_build[1] }}:${{ matrix.tag }}"
run: docker push ${container}
Loading