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
2 changes: 0 additions & 2 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ self-hosted-runner:
- linux-arm64-xl
- self-hosted-arm64
- self-hosted-arm64-2xl
- blacksmith-4vcpu-ubuntu-2404-arm
- blacksmith-16vcpu-ubuntu-2404-arm
- arc-arm64-2cpu-4gb
- arc-arm64-4cpu-12gb
- arc-arm64-8cpu-24gb
28 changes: 11 additions & 17 deletions .github/actions/runner-size-converter/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Runner Size Converter Action

A composite action that converts a runner size into an arm64 GitHub runner name.
By default it resolves the Blacksmith arm64 cloud runners; set
`use-blacksmith-runners: false` to resolve the self-hosted `linux-arm64` runners
instead, or `use-arc-runners: true` to resolve the self-hosted ARC runners
(this takes precedence).
With `use-arc-runners: true` it resolves the self-hosted ARC runners; otherwise
it resolves the GitHub-hosted `linux-arm64` larger runners.

## Usage

Expand All @@ -14,8 +12,7 @@ instead, or `use-arc-runners: true` to resolve the self-hosted ARC runners
uses: monta-app/github-workflows/.github/actions/runner-size-converter@main
with:
runner-size: 'large'
use-blacksmith-runners: true # optional, defaults to true
use-arc-runners: false # optional, defaults to false; wins over use-blacksmith-runners
use-arc-runners: true # optional, defaults to false

- name: Use runner
runs-on: ${{ steps.runner.outputs.runner-name }}
Expand All @@ -28,24 +25,21 @@ instead, or `use-arc-runners: true` to resolve the self-hosted ARC runners
| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `runner-size` | Yes | - | Runner size: `normal` or `large` |
| `use-blacksmith-runners` | No | `true` | Resolve Blacksmith arm64 cloud runners (default). Set to `false` to resolve the self-hosted `linux-arm64` runners |
| `use-arc-runners` | No | `false` | Resolve the self-hosted ARC arm64 runners. Takes precedence over `use-blacksmith-runners` |
| `use-arc-runners` | No | `false` | Resolve the self-hosted ARC arm64 runners (private repositories only). Otherwise the GitHub-hosted `linux-arm64` runners |

## Outputs

| Output | Description |
|--------|-------------|
| `runner-name` | The converted runner name (e.g., `linux-arm64-xl`) |
| `runner-name` | The converted runner name (e.g., `arc-arm64-4cpu-12gb`) |

## Runner Mapping

| Size | `use-arc-runners` | `use-blacksmith-runners` | Output |
|------|-------------------|--------------------------|--------|
| `normal` | `false` | `false` | `linux-arm64` |
| `large` | `false` | `false` | `linux-arm64-xl` |
| `normal` | `false` | `true` | `blacksmith-4vcpu-ubuntu-2404-arm` |
| `large` | `false` | `true` | `blacksmith-16vcpu-ubuntu-2404-arm` |
| `normal` | `true` | any | `arc-arm64-4cpu-12gb` |
| `large` | `true` | any | `arc-arm64-8cpu-24gb` |
| Size | `use-arc-runners` | Output |
|------|-------------------|--------|
| `normal` | `false` | `linux-arm64` |
| `large` | `false` | `linux-arm64-xl` |
| `normal` | `true` | `arc-arm64-4cpu-12gb` |
| `large` | `true` | `arc-arm64-8cpu-24gb` |

In a public repository (`github.event.repository.private == false`) the output is always `ubuntu-24.04-arm`, GitHub's standard arm64 runner, whatever the inputs. ARC is only used in private repositories; when the event has no repository (e.g. `schedule`), the table above applies without ARC.
16 changes: 2 additions & 14 deletions .github/actions/runner-size-converter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ inputs:
runner-size:
description: 'Runner size (normal or large)'
required: true
use-blacksmith-runners:
description: 'Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners'
required: false
default: 'true'
use-arc-runners:
description: 'Run on the self-hosted ARC arm64 runners. Takes precedence over use-blacksmith-runners'
description: 'Run on the self-hosted ARC arm64 runners (private repositories only). Otherwise the GitHub-hosted linux-arm64 runners are used'
required: false
default: 'false'

Expand All @@ -28,7 +24,6 @@ runs:
shell: bash
run: |
SIZE="${{ inputs.runner-size }}"
USE_BLACKSMITH="${{ inputs.use-blacksmith-runners }}"
USE_ARC="${{ inputs.use-arc-runners }}"
PRIVATE="${{ github.event.repository.private }}"

Expand All @@ -52,15 +47,8 @@ runs:
else
RUNNER_NAME="arc-arm64-4cpu-12gb"
fi
elif [ "$USE_BLACKSMITH" = "true" ]; then
# Blacksmith managed arm64 cloud runners
if [ "$SIZE" = "large" ]; then
RUNNER_NAME="blacksmith-16vcpu-ubuntu-2404-arm"
else
RUNNER_NAME="blacksmith-4vcpu-ubuntu-2404-arm"
fi
else
# Self-hosted arm64 runners
# GitHub-hosted arm64 larger runners
RUNNER_NAME="linux-arm64"
if [ "$SIZE" = "large" ]; then
RUNNER_NAME="$RUNNER_NAME-xl"
Expand Down
73 changes: 1 addition & 72 deletions .github/workflows/component-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ on:
type: string
default: 'normal'
description: 'Runner size (normal or large)'
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones; takes precedence over use-blacksmith-runners). Builds with docker buildx and the ECR registry layer cache, like the self-hosted path."
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones)."
stage:
required: true
type: string
Expand Down Expand Up @@ -119,77 +114,11 @@ jobs:
uses: monta-app/github-workflows/.github/actions/runner-size-converter@main
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
# Blacksmith path: build on a Blacksmith arm64 cloud runner. Its sticky-disk builder
# hydrates the layer cache from prior runs, so no registry cache directives are needed.
build-blacksmith:
name: Build (Blacksmith)
needs: setup
if: ${{ inputs.use-blacksmith-runners && !(inputs.use-arc-runners && github.event.repository.private) && github.event.repository.private != false }}
runs-on: ${{ needs.setup.outputs.runner }}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
ref: ${{ inputs.git-sha || github.sha }}
- name: Configure AWS credentials via assumed role
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ecr-put-image
role-session-name: push-new-image-to-${{ inputs.service-identifier }}-${{inputs.stage}}
aws-region: ${{ inputs.region }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@fa648b43de3d4d023bcb3f89ed6940096949c419 # v2
- name: Docker meta
id: meta
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6
with:
images: ${{ steps.login-ecr.outputs.registry }}/${{ inputs.ecr-repository-name || format('{0}-{1}', inputs.service-identifier, inputs.stage) }}
tags: |
type=raw,value=${{ inputs.git-sha || github.sha }}
type=raw,value=latest
- name: Set up Blacksmith Docker builder
uses: useblacksmith/setup-docker-builder@ab5c1da94f53f5cd75c1038092aa276dddfccbba # v1
- name: Build and push
id: build
uses: useblacksmith/build-push-action@fb9e3e6a9299c78462bfadd0d93352c316adc9b8 # v2
env:
BUILDX_NO_DEFAULT_ATTESTATIONS: 1
with:
context: .
file: ./${{ inputs.docker-file-name }}
push: true
platforms: linux/arm64
# provenance/sbom off (with BUILDX_NO_DEFAULT_ATTESTATIONS=1 above) so the
# pushed tag is a plain single-arch image, not a manifest list.
provenance: false
sbom: false
build-args: |
${{ inputs.additional-build-args }}
labels: |
GITHUB_RUN_ID=${{ github.run_id }}
${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
secrets: |
GHL_USERNAME=${{ secrets.GHL_USERNAME }}
GHL_PASSWORD=${{ secrets.GHL_PASSWORD }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
FARO_API_KEY=${{ secrets.FARO_API_KEY }}
AWS_CDN_ACCESS_KEY_ID=${{ secrets.AWS_CDN_ACCESS_KEY_ID }}
AWS_CDN_SECRET_ACCESS_KEY=${{ secrets.AWS_CDN_SECRET_ACCESS_KEY }}
LOKALISE_TOKEN=${{ secrets.LOKALISE_TOKEN }}
LOKALISE_PROJECT_ID=${{ secrets.LOKALISE_PROJECT_ID }}
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY=${{ secrets.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY }}

# Self-hosted path: build on a self-hosted linux-arm64 or ARC runner with docker buildx
# and a registry-backed BuildKit cache in the ECR repo.
build-self-hosted:
name: Build (self-hosted)
needs: setup
if: ${{ !inputs.use-blacksmith-runners || (inputs.use-arc-runners && github.event.repository.private) || github.event.repository.private == false }}
runs-on: ${{ needs.setup.outputs.runner }}
timeout-minutes: 30
env:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/component-test-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ on:
required: false
type: string
description: 'Runner size for the component-runner-size-converter'
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: false
description: "Run on the self-hosted ARC arm64 runners (takes precedence over use-blacksmith-runners)."
description: "Run on the self-hosted ARC arm64 runners."
service-name:
required: false
type: string
Expand Down Expand Up @@ -65,7 +60,6 @@ jobs:
uses: monta-app/github-workflows/.github/actions/runner-size-converter@main
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ inputs.use-arc-runners }}
test:
name: Test
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/component-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ on:
required: false
type: string
description: 'Runner size for the component-runner-size-converter'
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones; takes precedence over use-blacksmith-runners). Set to false to opt out."
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones). Set to false to run on the GitHub-hosted linux-arm64 runners."
service-name:
required: false
type: string
Expand Down Expand Up @@ -64,7 +59,6 @@ jobs:
uses: monta-app/github-workflows/.github/actions/runner-size-converter@main
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
test:
name: Test
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/deploy-generic-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ on:
type: string
description: "Runner to use for the job (normal, or large)"
default: "normal"
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones; takes precedence over use-blacksmith-runners). Set to false to opt out."
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones). Set to false to run on the GitHub-hosted linux-arm64 runners."
# DEPRECATED (no-op): all builds and CI run on arm64. Retained for backwards
# compatibility with callers still passing it; the value is ignored and this
# input will be removed in a future release.
Expand Down Expand Up @@ -169,7 +164,6 @@ jobs:
uses: ./.github/workflows/component-build.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
stage: ${{ inputs.stage }}
service-name: ${{ inputs.service-name }}
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/deploy-generic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ on:
type: string
description: "Runner to use for the job (normal, or large)"
default: "normal"
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones; takes precedence over use-blacksmith-runners). Set to false to opt out."
description: "Run on the self-hosted ARC arm64 runners (default in private repositories, never used in public ones). Set to false to run on the GitHub-hosted linux-arm64 runners."
# DEPRECATED (no-op): all builds and CI run on arm64. Retained for backwards
# compatibility with callers still passing it; the value is ignored and this
# input will be removed in a future release.
Expand Down Expand Up @@ -160,7 +155,6 @@ jobs:
uses: ./.github/workflows/component-build.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
stage: ${{ inputs.stage }}
service-name: ${{ inputs.service-name }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/deploy-kotlin-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ on:
type: string
description: "Runner to use for the job (normal, or large)"
default: "normal"
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default; takes precedence over use-blacksmith-runners). Never used in public repositories: the ARC runner group rejects them, so they keep the Blacksmith/GitHub-hosted runners. Applies to the test, image build and service profile jobs."
description: "Run on the self-hosted ARC arm64 runners (default). Never used in public repositories: the ARC runner group rejects them, so they keep the GitHub-hosted runners. Applies to the test, image build and service profile jobs."
# DEPRECATED (no-op): all builds and CI run on arm64. Retained for backwards
# compatibility with callers still passing it; the value is ignored and this
# input will be removed in a future release.
Expand Down Expand Up @@ -249,7 +244,6 @@ jobs:
uses: ./.github/workflows/component-test-kotlin.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
service-name: ${{ inputs.service-name }}
service-emoji: ${{ inputs.service-emoji }}
Expand All @@ -264,7 +258,6 @@ jobs:
uses: ./.github/workflows/component-build.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
stage: ${{ inputs.stage }}
service-name: ${{ inputs.service-name }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/deploy-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ on:
type: string
description: "Runner to use for the job (normal, or large)"
default: "normal"
use-blacksmith-runners:
required: false
type: boolean
default: true
description: "Run on Blacksmith arm64 cloud runners (default). Set to false to run on the self-hosted linux-arm64 runners."
use-arc-runners:
required: false
type: boolean
default: true
description: "Run on the self-hosted ARC arm64 runners (default; takes precedence over use-blacksmith-runners). Never used in public repositories: the ARC runner group rejects them, so they keep the Blacksmith/GitHub-hosted runners. Applies to the test, image build and service profile jobs."
description: "Run on the self-hosted ARC arm64 runners (default). Never used in public repositories: the ARC runner group rejects them, so they keep the GitHub-hosted runners. Applies to the test, image build and service profile jobs."
# DEPRECATED (no-op): all builds and CI run on arm64. Retained for backwards
# compatibility with callers still passing it; the value is ignored and this
# input will be removed in a future release.
Expand Down Expand Up @@ -237,7 +232,6 @@ jobs:
uses: ./.github/workflows/component-test-kotlin.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
service-name: ${{ inputs.service-name }}
service-emoji: ${{ inputs.service-emoji }}
Expand All @@ -252,7 +246,6 @@ jobs:
uses: ./.github/workflows/component-build.yml
with:
runner-size: ${{ inputs.runner-size }}
use-blacksmith-runners: ${{ inputs.use-blacksmith-runners }}
use-arc-runners: ${{ (inputs.use-arc-runners && github.event.repository.private) }}
stage: ${{ inputs.stage }}
service-name: ${{ inputs.service-name }}
Expand Down
Loading
Loading