Skip to content

Commit 55b0266

Browse files
authored
fix(ci): make buildkitd-config opt-in for setup-buildx (#970)
#966 hard-coded `buildkitd-config: /etc/buildkit/buildkitd.toml` inside the `driver: local` branch of the setup-buildx composite action. The only caller using that driver is shadow-docker-build.yml, which runs inside the ghcr.io/nvidia/openshell/ci:latest container — so the host-side buildkitd.toml was invisible to docker/setup-buildx-action and every matrix job failed at "Set up buildx". Revert the hard-coded path and expose it as an opt-in input on the action (empty default, passed through to both the remote and local branches). Wire shadow-docker-build.yml to bind-mount /etc/buildkit into the ci container and pass the path explicitly, so the action can read the file from inside the container. Remote-driver callers are unaffected (empty input is a no-op). Signed-off-by: Jonas Toelke <jtoelke@nvidia.com>
1 parent a01b6dd commit 55b0266

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

.github/actions/setup-buildx/action.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ inputs:
2121
name:
2222
description: Builder instance name
2323
default: openshell
24+
buildkitd-config:
25+
description: >
26+
Path to a buildkitd.toml to configure the builder with (e.g. the
27+
nv-gha-runners Docker Hub mirror at /etc/buildkit/buildkitd.toml).
28+
Must be readable *from where this action runs* — in a containerized
29+
job that means the caller must bind-mount the host path into the job
30+
container (e.g. `volumes: [/etc/buildkit:/etc/buildkit:ro]`). Empty
31+
disables the config (default).
32+
default: ""
2433

2534
runs:
2635
using: composite
@@ -36,6 +45,7 @@ runs:
3645
append: |
3746
- endpoint: ${{ inputs.arm64-endpoint }}
3847
platforms: linux/arm64
48+
buildkitd-config: ${{ inputs.buildkitd-config }}
3949

4050
- name: Set up Docker Buildx (local)
4151
if: inputs.driver == 'local'
@@ -44,8 +54,4 @@ runs:
4454
name: ${{ inputs.name }}
4555
driver: docker-container
4656
platforms: linux/amd64,linux/arm64
47-
# Use the nv-gha-runners Docker Hub mirror to avoid unauthenticated
48-
# pull rate limits on shared runners. The TOML is pre-populated on
49-
# every nv-gha-runner. Per:
50-
# https://docs.gha-runners.nvidia.com/platform/best-practices/#use-docker-cache-for-buildkit
51-
buildkitd-config: /etc/buildkit/buildkitd.toml
57+
buildkitd-config: ${{ inputs.buildkitd-config }}

.github/workflows/shadow-docker-build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
options: --privileged
4646
volumes:
4747
- /var/run/docker.sock:/var/run/docker.sock
48+
# Expose the nv-gha-runners buildkitd.toml (registry-mirror config)
49+
# inside the container so docker/setup-buildx-action can read it.
50+
# The file is pre-populated on every nv-gha-runner per:
51+
# https://docs.gha-runners.nvidia.com/platform/best-practices/#use-docker-cache-for-buildkit
52+
- /etc/buildkit:/etc/buildkit:ro
4853
timeout-minutes: 45
4954
steps:
5055
- uses: actions/checkout@v4
@@ -61,6 +66,10 @@ jobs:
6166
uses: ./.github/actions/setup-buildx
6267
with:
6368
driver: local
69+
# Bind-mounted above via container.volumes; without that, the file
70+
# is on the host but invisible to the action (which runs inside
71+
# the ci:latest container).
72+
buildkitd-config: /etc/buildkit/buildkitd.toml
6473

6574
- name: Package Helm chart (cluster only)
6675
if: matrix.component == 'cluster'

0 commit comments

Comments
 (0)