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
26 changes: 10 additions & 16 deletions .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ on:
required: false
default: ''
smoke-test-cmd:
description: 'Shell command to functionally test the built image before it is pushed. When set, the image is built into the local buildah/containers store (single-platform only — set platforms accordingly), this command runs with $SMOKE_IMAGE pointing at that store ref, and the registry push happens only if it passes. Run it with `podman run "$SMOKE_IMAGE"` — NOT `docker run`: the image is not yet pushed and Docker does not share buildah''s store, so docker would try to pull the missing tag and fail with `manifest unknown`. Empty = skip.'
description: 'Shell command to functionally test the built image before it is pushed. When set, the image is built into the local buildah/containers store (single-platform only — set platforms accordingly), this command runs with $SMOKE_IMAGE pointing at that store ref, and the registry push happens only if it passes. Run it from that store, never with `docker run`: the image is not yet pushed and Docker does not share buildah''s store, so docker would try to pull the missing tag and fail with `manifest unknown`. On a hosted runner `podman run "$SMOKE_IMAGE"` works. The FerrLabs runners have no podman: use `ctr=$(buildah from "$SMOKE_IMAGE")` then `buildah run --isolation oci --network none "$ctr" -- …`. Empty = skip.'
type: string
required: false
default: ''
Expand Down Expand Up @@ -77,21 +77,15 @@ on:
required: false
default: 3
runner:
description: 'GitHub Actions runner label for the build job (the heavy one). Private consumers pass `ferrlabs-k8s`; public consumers leave the default.'
description: 'GitHub Actions runner label for the build job (the heavy one). Leave empty for `ferrlabs-k8s-large` on a private FerrLabs repository and `ubuntu-latest` anywhere else, including a private repository outside the organisation.'
type: string
required: false
default: 'ubuntu-latest'
default: ''
helper-runner:
description: >-
Runner label for the four supporting jobs (hadolint, Trivy, cosign,
SBOM). Leave empty to keep the historical behaviour: the self-hosted
`ferrlabs-k8s` pool on a private repository, `ubuntu-latest` on a
public one. That default reads a repository''s VISIBILITY as a proxy
for WHICH ORGANISATION owns it, which holds only while every private
consumer is a FerrLabs repository. A private repository in another
organisation targets a runner label that does not exist there, and its
jobs queue forever with no error. Such a consumer passes
`ubuntu-latest` here.
SBOM). Leave empty for the FerrLabs pools on a private FerrLabs
repository and `ubuntu-latest` anywhere else.
type: string
required: false
default: ''
Expand Down Expand Up @@ -153,7 +147,7 @@ jobs:
# hadolint via its static binary (not the hadolint-action Docker container)
# so it runs on the self-hosted pool for private repos — the ARC runners
# have buildah but no Docker daemon. Public repos fall back to ubuntu-latest.
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && 'ferrlabs-k8s-light' || 'ubuntu-latest') }}
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && github.repository_owner == 'FerrLabs' && 'ferrlabs-k8s-light' || 'ubuntu-latest') }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
Expand All @@ -173,7 +167,7 @@ jobs:
build:
name: Build & push
needs: hadolint
runs-on: ${{ inputs.runner }}
runs-on: ${{ inputs.runner != '' && inputs.runner || (github.event.repository.private && github.repository_owner == 'FerrLabs' && 'ferrlabs-k8s-large' || 'ubuntu-latest') }}
outputs:
digest: ${{ steps.push.outputs.digest }}
steps:
Expand Down Expand Up @@ -373,7 +367,7 @@ jobs:
# medium, not inputs.runner (-large): Trivy just pulls the pushed image
# from the registry and scans it — no buildah/compile, so it doesn't need
# the scarce 2-slot large tier. Frees a large slot per docker-build run.
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && 'ferrlabs-k8s' || 'ubuntu-latest') }}
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && github.repository_owner == 'FerrLabs' && 'ferrlabs-k8s' || 'ubuntu-latest') }}
steps:
# Trivy reads ~/.docker/config.json to pull the image; without this a
# private GHCR image fails with a 401/manifest-unknown.
Expand Down Expand Up @@ -475,7 +469,7 @@ jobs:
# self-hosted pool for private repos. Public repos fall back to ubuntu-latest.
# Keyless signing uses the Actions OIDC token, which is available on
# self-hosted runners too (needs id-token: write, already granted).
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && 'ferrlabs-k8s-light' || 'ubuntu-latest') }}
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && github.repository_owner == 'FerrLabs' && 'ferrlabs-k8s-light' || 'ubuntu-latest') }}
steps:
- name: Install cosign
run: |
Expand Down Expand Up @@ -514,7 +508,7 @@ jobs:
if: inputs.push
# medium, not inputs.runner (-large): Syft pulls the pushed image and
# generates the SBOM — no buildah/compile, so no need for the large tier.
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && 'ferrlabs-k8s' || 'ubuntu-latest') }}
runs-on: ${{ inputs.helper-runner != '' && inputs.helper-runner || (github.event.repository.private && github.repository_owner == 'FerrLabs' && 'ferrlabs-k8s' || 'ubuntu-latest') }}
steps:
# Syft pulls the image via the Docker keychain (~/.docker/config.json);
# a private GHCR image needs this login or the scan fails to fetch it.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-release-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
uses: ./.github/workflows/reusable-docker-build.yml
with:
image-name: ${{ inputs.docker-image-name }}
runner: ${{ inputs.runner }}
tag: ${{ github.ref_name }}
context: .
dockerfile: Dockerfile
Expand Down
Loading