Skip to content

Commit 1a9eea5

Browse files
authored
feat(tasks): wire e2e:gpu to bootstrap cluster with GPU support (#547)
Pass CLUSTER_GPU=1 inline in e2e:python:gpu's depends so that the cluster is bootstrapped with --gpu when GPU e2e tests are run. Add --gpu flag handling to cluster-bootstrap.sh and default OPENSHELL_E2E_GPU_IMAGE to an empty string so the server resolves the default sandbox image when no override is provided. Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent f37b69b commit 1a9eea5

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

e2e/python/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ def _run(sandbox: Sandbox, code: str) -> tuple[int, str, str]:
9696

9797
@pytest.fixture(scope="session")
9898
def gpu_sandbox_spec() -> datamodel_pb2.SandboxSpec:
99-
image = os.environ.get(
100-
"OPENSHELL_E2E_GPU_IMAGE",
101-
"ghcr.io/nvidia/openshell-community/sandboxes/nvidia-gpu:latest",
102-
)
99+
# Empty string defers image resolution to the server, which substitutes
100+
# the configured default sandbox image. Set OPENSHELL_E2E_GPU_IMAGE to
101+
# override (e.g. a locally-built or registry-mirrored image).
102+
image = os.environ.get("OPENSHELL_E2E_GPU_IMAGE", "")
103103
return datamodel_pb2.SandboxSpec(
104104
gpu=True,
105105
template=datamodel_pb2.SandboxTemplate(image=image),

tasks/scripts/cluster-bootstrap.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ fi
243243

244244
DEPLOY_CMD=(openshell gateway start --name "${CLUSTER_NAME}" --port "${GATEWAY_PORT}")
245245

246+
if [ "${CLUSTER_GPU:-0}" = "1" ]; then
247+
DEPLOY_CMD+=(--gpu)
248+
fi
249+
246250
if [ -n "${GATEWAY_HOST:-}" ]; then
247251
DEPLOY_CMD+=(--gateway-host "${GATEWAY_HOST}")
248252

tasks/test.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ run = "uv run pytest -o python_files='test_*.py' -m 'not gpu' -n ${E2E_PARALLEL:
4343

4444
["e2e:python:gpu"]
4545
description = "Run Python GPU e2e tests"
46-
depends = ["python:proto", "cluster"]
46+
depends = ["python:proto", "CLUSTER_GPU=1 cluster"]
4747
env = { UV_NO_SYNC = "1", PYTHONPATH = "python" }
4848
run = "uv run pytest -o python_files='test_*.py' -m gpu -n ${E2E_PARALLEL:-1} e2e/python"

0 commit comments

Comments
 (0)