Files
OpenShell/e2e/python/test_sandbox_gpu.py
Piotr Mlocek 72e0268028 feat(sandbox): add gpu sandbox scheduling support (#257)
* feat(sandbox): add gpu sandbox scheduling support

Allow sandbox creation to request GPU resources explicitly or infer them from GPU image names. This wires GPU intent through bootstrap, validates gateway support, and adds dedicated GPU E2E coverage for follow-up cluster testing.
2026-03-13 11:32:43 -07:00

31 lines
825 B
Python

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from openshell._proto import datamodel_pb2
if TYPE_CHECKING:
from collections.abc import Callable
from openshell import Sandbox
@pytest.mark.gpu
def test_gpu_sandbox_reports_available_gpu(
sandbox: Callable[..., Sandbox],
gpu_sandbox_spec: datamodel_pb2.SandboxSpec,
) -> None:
with sandbox(spec=gpu_sandbox_spec, delete_on_exit=True) as sb:
result = sb.exec(
["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"],
timeout_seconds=30,
)
assert result.exit_code == 0, result.stderr
assert result.stdout.strip()