Skip to content

Commit 1ffed51

Browse files
committed
Revert "ci(helm): run kube e2e inside CI container with --network host"
This reverts commit 461b1fd.
1 parent 461b1fd commit 1ffed51

1 file changed

Lines changed: 40 additions & 24 deletions

File tree

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

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -54,47 +54,63 @@ jobs:
5454
name: Helm E2E (Rust smoke)
5555
needs: [pr_metadata, build-gateway, build-supervisor]
5656
if: needs.pr_metadata.outputs.should_run == 'true'
57+
# Bare runner: kind-in-container hits the same nested-Docker / kubeconfig
58+
# complications take-1 saw with k3d (commit 4b5961fe). The runner has
59+
# Docker; mise installs helm, kubectl, and the Rust toolchain.
5760
runs-on: linux-amd64-cpu8
5861
timeout-minutes: 60
5962
permissions:
6063
contents: read
6164
packages: read
62-
# Run inside the CI container (Rust toolchain + libz3 + mise-managed
63-
# helm/kubectl/k3d preinstalled) with --network host so the ephemeral
64-
# k3d cluster's API server (exposed on a host loopback port by the
65-
# wrapper's k3d cluster create) and `kubectl port-forward` are
66-
# reachable at 127.0.0.1 from this container. The host docker socket
67-
# is bind-mounted so k3d nodes (created as sibling docker containers)
68-
# share the same daemon as our `docker pull` of the gateway image.
69-
container:
70-
image: ghcr.io/nvidia/openshell/ci:latest
71-
credentials:
72-
username: ${{ github.actor }}
73-
password: ${{ secrets.GITHUB_TOKEN }}
74-
options: --privileged --network host
75-
volumes:
76-
- /var/run/docker.sock:/var/run/docker.sock
77-
- /home/runner/_work:/home/runner/_work
7865
env:
7966
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80-
IMAGE_TAG: ${{ github.sha }}
81-
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
67+
KIND_CLUSTER_NAME: helm-e2e-${{ github.run_id }}
8268
steps:
8369
- uses: actions/checkout@v6
8470

71+
- name: Install mise
72+
run: |
73+
curl https://mise.run | sh
74+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
75+
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
76+
77+
- name: Install tools
78+
run: mise install --locked
79+
8580
- name: Log in to GHCR
8681
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
8782

88-
# Pre-pull on the host docker daemon so with-kube-gateway.sh can
89-
# `k3d image import` them into the ephemeral k3d cluster — `k3d image
90-
# import` requires the images to already exist in the daemon k3d
91-
# talks to (the host's, shared with us via the docker.sock mount).
92-
- name: Pre-pull gateway and supervisor images
83+
- name: Create kind cluster
84+
uses: helm/kind-action@v1
85+
with:
86+
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
87+
wait: 120s
88+
89+
# mise.toml sets KUBECONFIG="{{config_root}}/kubeconfig"; helm/kind-action
90+
# writes to ~/.kube/config. Materialize the kind context at the mise path
91+
# so `mise run e2e:helm` (and the wrapper's `kubectl --context=…`) finds
92+
# the kind cluster.
93+
- name: Export kind kubeconfig to mise path
94+
run: |
95+
set -euo pipefail
96+
kind get kubeconfig --name "$KIND_CLUSTER_NAME" > "$GITHUB_WORKSPACE/kubeconfig"
97+
chmod 600 "$GITHUB_WORKSPACE/kubeconfig"
98+
99+
# Pre-pull and side-load: kind nodes don't have ghcr credentials, and
100+
# tagging IMAGE_TAG to a SHA means the chart's IfNotPresent pull policy
101+
# is satisfied once the image is loaded into the node's containerd.
102+
- name: Load gateway and supervisor images into kind
93103
run: |
94104
set -euo pipefail
95105
for component in gateway supervisor; do
96-
docker pull "ghcr.io/nvidia/openshell/${component}:${IMAGE_TAG}"
106+
image="ghcr.io/nvidia/openshell/${component}:${{ github.sha }}"
107+
docker pull "$image"
108+
kind load docker-image "$image" --name "$KIND_CLUSTER_NAME"
97109
done
98110
99111
- name: Run Helm E2E (Rust smoke)
112+
env:
113+
OPENSHELL_E2E_KUBE_CONTEXT: kind-${{ env.KIND_CLUSTER_NAME }}
114+
IMAGE_TAG: ${{ github.sha }}
115+
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
100116
run: mise run --no-deps --skip-deps e2e:helm

0 commit comments

Comments
 (0)