Skip to content

Commit d663a7f

Browse files
committed
ci(helm-e2e): reuse docker-build.yml for gateway and supervisor images
The Helm e2e jobs were rebuilding gateway and supervisor images from source inside each container, duplicating the work docker-build.yml already does on every PR. Add build-gateway and build-supervisor reusable-workflow calls (linux/amd64 to match the runner) and have the e2e jobs pull the resulting GHCR images via a new HELM_E2E_IMAGE_TAG env var. The local-dev buildx path is preserved as the fallback when the tag is unset, so 'mise run e2e:helm:*' still works without CI.
1 parent 680fec8 commit d663a7f

2 files changed

Lines changed: 66 additions & 19 deletions

File tree

‎.github/workflows/branch-helm-e2e.yml‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,31 @@ jobs:
2828
with:
2929
required_label: test:e2e-helm
3030

31+
build-gateway:
32+
needs: [pr_metadata]
33+
if: needs.pr_metadata.outputs.should_run == 'true'
34+
permissions:
35+
contents: read
36+
packages: write
37+
uses: ./.github/workflows/docker-build.yml
38+
with:
39+
component: gateway
40+
platform: linux/amd64
41+
42+
build-supervisor:
43+
needs: [pr_metadata]
44+
if: needs.pr_metadata.outputs.should_run == 'true'
45+
permissions:
46+
contents: read
47+
packages: write
48+
uses: ./.github/workflows/docker-build.yml
49+
with:
50+
component: supervisor
51+
platform: linux/amd64
52+
3153
helm-e2e-rust:
3254
name: Helm E2E (rust)
33-
needs: [pr_metadata]
55+
needs: [pr_metadata, build-gateway, build-supervisor]
3456
if: needs.pr_metadata.outputs.should_run == 'true'
3557
runs-on: linux-amd64-cpu8
3658
timeout-minutes: 60
@@ -48,12 +70,16 @@ jobs:
4870
env:
4971
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5072
HELM_E2E_CLUSTER_NAME: helm-e2e-${{ github.run_id }}-rust
73+
HELM_E2E_IMAGE_TAG: ${{ github.sha }}
5174
steps:
5275
- uses: actions/checkout@v6
5376

5477
- name: Mark workspace safe for git
5578
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
5679

80+
- name: Log in to GHCR
81+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
82+
5783
- name: Install tools
5884
run: mise install --locked
5985

@@ -62,7 +88,7 @@ jobs:
6288

6389
helm-e2e-python:
6490
name: Helm E2E (python)
65-
needs: [pr_metadata]
91+
needs: [pr_metadata, build-gateway, build-supervisor]
6692
if: needs.pr_metadata.outputs.should_run == 'true'
6793
runs-on: linux-amd64-cpu8
6894
timeout-minutes: 60
@@ -80,12 +106,16 @@ jobs:
80106
env:
81107
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82108
HELM_E2E_CLUSTER_NAME: helm-e2e-${{ github.run_id }}-python
109+
HELM_E2E_IMAGE_TAG: ${{ github.sha }}
83110
steps:
84111
- uses: actions/checkout@v6
85112

86113
- name: Mark workspace safe for git
87114
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
88115

116+
- name: Log in to GHCR
117+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
118+
89119
- name: Install tools
90120
run: mise install --locked
91121

‎tasks/scripts/helm-e2e.sh‎

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
# HELM_E2E_PKI pki-init | cert-manager (default: pki-init)
2121
# HELM_E2E_KEEP_CLUSTER 1 to skip cluster deletion on exit (default: 0)
2222
# HELM_E2E_CLUSTER_NAME override k3d cluster name (default: derived from branch)
23+
# HELM_E2E_IMAGE_TAG if set, pull gateway+supervisor images from
24+
# HELM_E2E_IMAGE_REGISTRY at this tag instead of
25+
# building them locally (used by CI to reuse the
26+
# images produced by docker-build.yml)
27+
# HELM_E2E_IMAGE_REGISTRY registry to pull pre-built images from
28+
# (default: ghcr.io/nvidia/openshell)
2329
# KUBECONFIG path to kubeconfig (default: <repo-root>/kubeconfig)
2430
# OPENSHELL_PROVISION_TIMEOUT sandbox ready timeout in seconds (default: 300)
2531

@@ -127,23 +133,34 @@ fi
127133
GATEWAY_IMAGE="openshell/gateway:helm-e2e"
128134
SUPERVISOR_IMAGE="openshell/supervisor:helm-e2e"
129135

130-
echo "Building gateway image..."
131-
docker buildx build \
132-
--build-arg BUILD_FROM_SOURCE=1 \
133-
--target gateway \
134-
--tag "${GATEWAY_IMAGE}" \
135-
--load \
136-
--file "${ROOT}/deploy/docker/Dockerfile.images" \
137-
"${ROOT}" 2>&1
138-
139-
echo "Building supervisor image..."
140-
docker buildx build \
141-
--build-arg BUILD_FROM_SOURCE=1 \
142-
--target supervisor \
143-
--tag "${SUPERVISOR_IMAGE}" \
144-
--load \
145-
--file "${ROOT}/deploy/docker/Dockerfile.images" \
146-
"${ROOT}" 2>&1
136+
if [ -n "${HELM_E2E_IMAGE_TAG:-}" ]; then
137+
REGISTRY="${HELM_E2E_IMAGE_REGISTRY:-ghcr.io/nvidia/openshell}"
138+
echo "Pulling pre-built gateway image (${REGISTRY}/gateway:${HELM_E2E_IMAGE_TAG})..."
139+
docker pull "${REGISTRY}/gateway:${HELM_E2E_IMAGE_TAG}"
140+
docker tag "${REGISTRY}/gateway:${HELM_E2E_IMAGE_TAG}" "${GATEWAY_IMAGE}"
141+
142+
echo "Pulling pre-built supervisor image (${REGISTRY}/supervisor:${HELM_E2E_IMAGE_TAG})..."
143+
docker pull "${REGISTRY}/supervisor:${HELM_E2E_IMAGE_TAG}"
144+
docker tag "${REGISTRY}/supervisor:${HELM_E2E_IMAGE_TAG}" "${SUPERVISOR_IMAGE}"
145+
else
146+
echo "Building gateway image..."
147+
docker buildx build \
148+
--build-arg BUILD_FROM_SOURCE=1 \
149+
--target gateway \
150+
--tag "${GATEWAY_IMAGE}" \
151+
--load \
152+
--file "${ROOT}/deploy/docker/Dockerfile.images" \
153+
"${ROOT}" 2>&1
154+
155+
echo "Building supervisor image..."
156+
docker buildx build \
157+
--build-arg BUILD_FROM_SOURCE=1 \
158+
--target supervisor \
159+
--tag "${SUPERVISOR_IMAGE}" \
160+
--load \
161+
--file "${ROOT}/deploy/docker/Dockerfile.images" \
162+
"${ROOT}" 2>&1
163+
fi
147164

148165
# Load images into the k3d cluster nodes.
149166
echo "Loading images into k3d cluster..."

0 commit comments

Comments
 (0)