Skip to content

Commit 066820a

Browse files
committed
fix check issue
1 parent cb9dd6a commit 066820a

File tree

5 files changed

+106
-71
lines changed

5 files changed

+106
-71
lines changed

.github/workflows/build-check-test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ jobs:
221221
curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
222222
k3d version
223223
224+
- name: Install skaffold
225+
run: |
226+
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
227+
sudo install skaffold /usr/local/bin/
228+
skaffold version
229+
224230
- name: Install Helm
225231
run: |
226232
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

operator/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,12 @@ run-e2e-full: e2e-cluster-up
135135

136136
# Run autoMNNVL e2e tests (all 4 configurations: supported/unsupported x enabled/disabled)
137137
# This creates a dedicated k3d cluster, runs all configurations sequentially, then cleans up.
138+
# Images are built with skaffold/ko as part of cluster setup (no Docker build required).
138139
# Usage: make run-e2e-mnnvl-full
139-
# make run-e2e-mnnvl-full # Full run with build
140-
# SKIP_BUILD=1 make run-e2e-mnnvl-full # Skip image build (reuse existing)
141140
.PHONY: run-e2e-mnnvl-full
142141
run-e2e-mnnvl-full:
143-
@echo "> Preparing charts (copying CRDs)..."
144-
@$(MODULE_HACK_DIR)/prepare-charts.sh
145142
@echo "> Running autoMNNVL e2e tests (all 4 configurations)..."
146-
@python3 $(MODULE_HACK_DIR)/e2e-autoMNNVL/run_autoMNNVL_e2e_all.py $(if $(SKIP_BUILD),--skip-build)
143+
@python3 $(MODULE_HACK_DIR)/e2e-autoMNNVL/run_autoMNNVL_e2e_all.py
147144

148145
# Delete the autoMNNVL e2e test cluster
149146
.PHONY: e2e-mnnvl-cluster-down

operator/hack/e2e-autoMNNVL/run_autoMNNVL_e2e.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env python3
2+
# /*
3+
# Copyright 2026 The Grove Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# */
17+
218
"""run_autoMNNVL_e2e.py - Run autoMNNVL e2e tests with a single configuration.
319
420
This script sets up the cluster (via setup_autoMNNVL_cluster.py) and runs the e2e tests.

operator/hack/e2e-autoMNNVL/run_autoMNNVL_e2e_all.py

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env python3
2+
# /*
3+
# Copyright 2026 The Grove Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# */
17+
218
"""run_autoMNNVL_e2e_all.py - Run autoMNNVL e2e tests with all 4 configurations.
319
420
This script runs the autoMNNVL e2e tests with all possible configurations:
@@ -7,18 +23,19 @@
723
3. Feature enabled + CRD unsupported (no fake GPU)
824
4. Feature disabled + CRD unsupported (no fake GPU)
925
26+
Images are built with skaffold/ko and pushed to the k3d registry as part of
27+
cluster setup -- no Docker build is required.
28+
1029
Usage: ./hack/e2e-autoMNNVL/run_autoMNNVL_e2e_all.py [options]
1130
1231
Options:
13-
--skip-build Skip initial image build, reuse existing local images
1432
--keep-cluster Keep cluster after all configs (no shutdown)
1533
--help Show this help message
1634
"""
1735

1836
from __future__ import annotations
1937

2038
import argparse
21-
import os
2239
import subprocess
2340
import sys
2441
from dataclasses import dataclass
@@ -74,22 +91,27 @@ class ConfigEntry:
7491

7592

7693
# The four configurations we test.
94+
#
95+
# Images are built with skaffold/ko as part of cluster setup (no upfront Docker
96+
# build). Configs that create a new cluster also build+push images; configs that
97+
# reuse the cluster skip the build since images are already in the registry.
98+
#
7799
# Config 3 uses --skip-operator-wait because the operator intentionally exits
78100
# (preflight failure) in this invalid configuration; the e2e test itself
79101
# validates the expected failure behaviour.
80102
CONFIGS: list[ConfigEntry] = [
81103
ConfigEntry(1, "Config1_SupportedAndEnabled",
82104
"--with-fake-gpu", "--mnnvl-enabled",
83-
["--skip-build"]),
105+
[]),
84106
ConfigEntry(2, "Config2_SupportedButDisabled",
85107
"--with-fake-gpu", "--mnnvl-disabled",
86-
["--skip-cluster-create"]),
108+
["--skip-cluster-create", "--skip-build"]),
87109
ConfigEntry(3, "Config3_UnsupportedButEnabled",
88110
"--without-fake-gpu", "--mnnvl-enabled",
89-
["--skip-build", "--skip-operator-wait"]),
111+
["--skip-operator-wait"]),
90112
ConfigEntry(4, "Config4_UnsupportedAndDisabled",
91113
"--without-fake-gpu", "--mnnvl-disabled",
92-
["--skip-cluster-create"]),
114+
["--skip-cluster-create", "--skip-build"]),
93115
]
94116

95117
# ---------------------------------------------------------------------------
@@ -100,30 +122,11 @@ def parse_args() -> argparse.Namespace:
100122
description="Run MNNVL e2e tests with all 4 configurations.",
101123
formatter_class=argparse.RawDescriptionHelpFormatter,
102124
)
103-
parser.add_argument("--skip-build", action="store_true", default=False,
104-
help="Skip initial image build, reuse existing local images")
105125
parser.add_argument("--keep-cluster", action="store_true", default=False,
106126
help="Keep cluster after all configs (no shutdown)")
107127
return parser.parse_args()
108128

109129

110-
# ---------------------------------------------------------------------------
111-
# Helpers
112-
# ---------------------------------------------------------------------------
113-
def build_images_once() -> None:
114-
"""Build images once at the start so individual configs can use --skip-build."""
115-
log_info("Building images once for all configurations...")
116-
subprocess.run("./hack/prepare-charts.sh", shell=True, check=True, cwd=OPERATOR_DIR)
117-
subprocess.run(
118-
"./hack/docker-build.sh",
119-
shell=True, check=True, cwd=OPERATOR_DIR,
120-
env={**os.environ,
121-
"GOARCH": "amd64",
122-
"PLATFORM": "linux/amd64",
123-
"DOCKER_BUILD_ADDITIONAL_ARGS": "--load"},
124-
)
125-
126-
127130
def run_config(cfg: ConfigEntry) -> bool:
128131
"""Run a single configuration. Returns True on success."""
129132
log_header("==========================================")
@@ -203,14 +206,6 @@ def main() -> None:
203206
log_info("==========================================")
204207
print(flush=True)
205208

206-
os.chdir(OPERATOR_DIR)
207-
208-
# Build images once if not skipping
209-
if not args.skip_build:
210-
build_images_once()
211-
else:
212-
log_warning("Skipping initial build (--skip-build)")
213-
214209
# Run all configurations
215210
results: dict[str, str] = {cfg.name: "NOT_RUN" for cfg in CONFIGS}
216211

operator/hack/e2e-autoMNNVL/setup_autoMNNVL_cluster.py

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/usr/bin/env python3
2+
# /*
3+
# Copyright 2026 The Grove Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# */
17+
218
"""setup_autoMNNVL_cluster.py - Set up a k3d cluster for autoMNNVL e2e testing.
319
420
This script handles cluster creation, fake GPU operator installation,
@@ -13,8 +29,8 @@
1329
--without-fake-gpu Skip fake GPU operator installation
1430
--mnnvl-enabled Enable MNNVL feature in Grove (default)
1531
--mnnvl-disabled Disable MNNVL feature in Grove
16-
--build Build images with docker (default)
17-
--skip-build Skip image build, use existing local images
32+
--build Build images with skaffold/ko (default)
33+
--skip-build Skip image build, reuse images already in registry
1834
--skip-operator-wait Don't wait for operator pod readiness
1935
--image <tag> Use existing image with specified tag
2036
--help Show this help message
@@ -27,6 +43,7 @@
2743
import subprocess
2844
import sys
2945
import time
46+
from datetime import datetime, timezone
3047
from pathlib import Path
3148

3249
# ---------------------------------------------------------------------------
@@ -188,33 +205,44 @@ def uninstall_fake_gpu_operator() -> None:
188205
# ---------------------------------------------------------------------------
189206
# Build / push images
190207
# ---------------------------------------------------------------------------
191-
def build_images() -> None:
192-
log_info("Building Grove operator images...")
208+
def build_and_push_images() -> None:
209+
"""Build Grove images with skaffold/ko and push to the local k3d registry.
210+
211+
Uses the same approach as the main e2e cluster setup (create-e2e-cluster.py):
212+
skaffold build with the ko builder compiles Go binaries into OCI images and
213+
pushes them directly to the registry -- no Docker build required.
214+
"""
215+
log_info("Building and pushing Grove operator images with skaffold...")
193216
run("./hack/prepare-charts.sh", cwd=OPERATOR_DIR)
217+
218+
push_repo = f"localhost:{REGISTRY_PORT}"
219+
build_date = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
220+
env = {
221+
"VERSION": IMAGE_TAG,
222+
"LD_FLAGS": (
223+
"-X github.com/ai-dynamo/grove/operator/internal/version.gitCommit=e2e-test-commit "
224+
"-X github.com/ai-dynamo/grove/operator/internal/version.gitTreeState=clean "
225+
f"-X github.com/ai-dynamo/grove/operator/internal/version.buildDate={build_date} "
226+
"-X github.com/ai-dynamo/grove/operator/internal/version.gitVersion=mnnvl-e2e"
227+
),
228+
}
229+
230+
log_info(f"Running skaffold build (push to {push_repo})...")
194231
run(
195-
"./hack/docker-build.sh",
232+
f"skaffold build --default-repo {push_repo}",
196233
cwd=OPERATOR_DIR,
197-
env={
198-
"GOARCH": "amd64",
199-
"PLATFORM": "linux/amd64",
200-
"DOCKER_BUILD_ADDITIONAL_ARGS": "--load",
201-
},
234+
env=env,
202235
)
203236

237+
log_success("Grove images built and pushed to registry")
204238

205-
def push_images_to_registry() -> None:
206-
log_info("Pushing images to local registry...")
207-
208-
run(f"docker tag grove-operator:latest localhost:{REGISTRY_PORT}/grove-operator:{IMAGE_TAG}")
209-
run(f"docker tag grove-initc:latest localhost:{REGISTRY_PORT}/grove-initc:{IMAGE_TAG}")
210-
run(f"docker push localhost:{REGISTRY_PORT}/grove-operator:{IMAGE_TAG}")
211-
run(f"docker push localhost:{REGISTRY_PORT}/grove-initc:{IMAGE_TAG}")
212-
213-
# Also push alpine for test workloads
239+
# Push alpine for test workloads (simple pull/tag/push, not a build)
240+
log_info("Pushing alpine image for test workloads...")
241+
run("docker pull alpine:latest", check=False)
214242
run(f"docker tag alpine:latest localhost:{REGISTRY_PORT}/alpine:latest")
215243
run(f"docker push localhost:{REGISTRY_PORT}/alpine:latest")
216244

217-
log_success("Images pushed to registry")
245+
log_success("All images pushed to registry")
218246

219247

220248
# ---------------------------------------------------------------------------
@@ -320,9 +348,9 @@ def parse_args() -> argparse.Namespace:
320348

321349
build_group = parser.add_mutually_exclusive_group()
322350
build_group.add_argument("--build", action="store_true", default=None,
323-
help="Build images with docker (default)")
351+
help="Build images with skaffold/ko (default)")
324352
build_group.add_argument("--skip-build", action="store_true", default=None,
325-
help="Skip image build, use existing local images")
353+
help="Skip image build, reuse images already in registry")
326354
build_group.add_argument("--image", metavar="TAG", default=None,
327355
help="Use existing image with specified tag")
328356

@@ -424,19 +452,12 @@ def main() -> None:
424452
else:
425453
uninstall_fake_gpu_operator()
426454

427-
# Step 3: Build images (if requested)
455+
# Step 3: Build and push images with skaffold/ko
456+
# Skaffold builds Go binaries with ko and pushes directly to the k3d registry.
428457
if cfg["build_images"]:
429-
build_images()
430-
else:
431-
log_warning("Skipping image build (using existing images)")
432-
433-
# Step 3b: Push images to registry
434-
# Always push when a new cluster was created (fresh registry has no images).
435-
# When reusing an existing cluster, push only if we just built new images.
436-
if not cfg["skip_cluster_create"] or cfg["build_images"]:
437-
push_images_to_registry()
458+
build_and_push_images()
438459
else:
439-
log_info("Skipping image push (reusing existing cluster with existing images)")
460+
log_warning("Skipping image build (images already in registry)")
440461

441462
# Step 4: Install Grove operator
442463
install_grove_operator(

0 commit comments

Comments
 (0)