Skip to content

Commit 43bf83e

Browse files
authored
Merge pull request #768 from rewenila/bci_pytorch
Adding tests for AI pytorch container
2 parents 6963390 + 1299906 commit 43bf83e

4 files changed

Lines changed: 41 additions & 1 deletion

File tree

bci_tester/data.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,13 @@ def create_BCI(
10291029
custom_entry_point="/bin/bash",
10301030
)
10311031

1032+
PYTORCH_CONTAINER = create_BCI(
1033+
build_tag=f"{SAC_CONTAINER_PREFIX}/pytorch:2-nvidia",
1034+
bci_type=ImageType.SAC_APPLICATION,
1035+
available_versions=["15.6-ai"],
1036+
custom_entry_point="/bin/bash",
1037+
)
1038+
10321039
STUNNEL_CONTAINER = create_BCI(
10331040
build_tag=f"{APP_CONTAINER_PREFIX}/stunnel:5",
10341041
bci_type=ImageType.APPLICATION,
@@ -1112,6 +1119,7 @@ def create_BCI(
11121119
MINIMAL_CONTAINER,
11131120
OLLAMA_CONTAINER,
11141121
MILVUS_CONTAINER,
1122+
PYTORCH_CONTAINER,
11151123
*POSTFIX_CONTAINERS,
11161124
*TOMCAT_CONTAINERS,
11171125
*POSTGRESQL_CONTAINERS,
@@ -1157,6 +1165,7 @@ def create_BCI(
11571165
OLLAMA_CONTAINER,
11581166
OPENWEBUI_CONTAINER,
11591167
MILVUS_CONTAINER,
1168+
PYTORCH_CONTAINER,
11601169
]
11611170
+ BASE_FIPS_CONTAINERS
11621171
+ CONTAINER_389DS_CONTAINERS

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ markers = [
141141
'python_3.12',
142142
'python_3.13',
143143
'python_3.6',
144+
'pytorch_2-nvidia',
144145
'registry_2.8',
145146
'ruby_2.5',
146147
'ruby_3.4',

tests/test_ai.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@
99
from bci_tester.data import MILVUS_CONTAINER
1010
from bci_tester.data import OLLAMA_CONTAINER
1111
from bci_tester.data import OPENWEBUI_CONTAINER
12+
from bci_tester.data import PYTORCH_CONTAINER
1213

13-
CONTAINER_IMAGES = (OLLAMA_CONTAINER, OPENWEBUI_CONTAINER, MILVUS_CONTAINER)
14+
CONTAINER_IMAGES = (
15+
OLLAMA_CONTAINER,
16+
OPENWEBUI_CONTAINER,
17+
MILVUS_CONTAINER,
18+
PYTORCH_CONTAINER,
19+
)
1420

1521

1622
@pytest.mark.parametrize(
@@ -71,3 +77,18 @@ def test_milvus_health(container_per_test):
7177
)
7278
container_per_test.connection.check_output("etcd --version")
7379
container_per_test.connection.check_output("milvus")
80+
81+
82+
@pytest.mark.parametrize(
83+
"container",
84+
[PYTORCH_CONTAINER],
85+
indirect=["container"],
86+
)
87+
def test_pytorch_health(container):
88+
"""Test the pytorch container."""
89+
90+
# chech pytorch Version
91+
container.connection.check_output(
92+
"python3.11 -c 'import torch; print(torch.__version__)'"
93+
)
94+
container.connection.check_output("git --version")

tests/test_metadata.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
from bci_tester.data import POSTGRESQL_CONTAINERS
8484
from bci_tester.data import PROMETHEUS_CONTAINERS
8585
from bci_tester.data import PYTHON_CONTAINERS
86+
from bci_tester.data import PYTORCH_CONTAINER
8687
from bci_tester.data import RUBY_CONTAINERS
8788
from bci_tester.data import RUST_CONTAINERS
8889
from bci_tester.data import SAC_PYTHON_CONTAINERS
@@ -101,6 +102,10 @@
101102
reason="no supportlevel labels on openSUSE containers",
102103
)
103104

105+
SKIP_IF_AI_MARK = pytest.mark.skipif(
106+
OS_VERSION == "15.6-ai", reason="no supportlevel labels on AI containers"
107+
)
108+
104109

105110
def _get_container_label_prefix(
106111
container_name: str, container_type: ImageType
@@ -277,6 +282,7 @@ def _get_container_label_prefix(
277282
(OLLAMA_CONTAINER, "ollama", ImageType.SAC_APPLICATION),
278283
(OPENWEBUI_CONTAINER, "open-webui", ImageType.SAC_APPLICATION),
279284
(MILVUS_CONTAINER, "milvus", ImageType.SAC_APPLICATION),
285+
(PYTORCH_CONTAINER, "pytorch", ImageType.SAC_APPLICATION),
280286
]
281287
+ [(STUNNEL_CONTAINER, "stunnel", ImageType.APPLICATION)]
282288
+ [
@@ -516,6 +522,7 @@ def test_disturl_can_be_checked_out(
516522

517523

518524
@SKIP_IF_TW_MARK
525+
@SKIP_IF_AI_MARK
519526
@pytest.mark.parametrize(
520527
"container",
521528
[
@@ -552,6 +559,7 @@ def test_techpreview_label(container: ContainerData):
552559

553560

554561
@SKIP_IF_TW_MARK
562+
@SKIP_IF_AI_MARK
555563
@pytest.mark.parametrize(
556564
"container",
557565
list(ACC_CONTAINERS),
@@ -568,6 +576,7 @@ def test_acc_label(container: ContainerData):
568576

569577

570578
@SKIP_IF_TW_MARK
579+
@SKIP_IF_AI_MARK
571580
@pytest.mark.parametrize("container", L3_CONTAINERS, indirect=True)
572581
def test_l3_label(container: ContainerData):
573582
"""Check that containers under L3 support have the label

0 commit comments

Comments
 (0)