Skip to content

Commit ef569da

Browse files
committed
RHAIENG-347: fix(manifests): consistency in accelerator info display on workbenches (#2536)
1 parent 5b9a559 commit ef569da

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

manifests/base/code-server-notebook-imagestream.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
# language=json
2020
opendatahub.io/notebook-software: |
2121
[
22-
{"name": "code-server", "version": "4.98"},
22+
{"name": "code-server", "version": "4.104"},
2323
{"name": "Python", "version": "v3.12"}
2424
]
2525
# language=json

manifests/base/jupyter-rocm-pytorch-notebook-imagestream.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ spec:
2020
# language=json
2121
opendatahub.io/notebook-software: |
2222
[
23+
{"name": "ROCm", "version": "v6.4"},
2324
{"name": "Python", "version": "v3.12"},
2425
{"name": "ROCm-PyTorch", "version": "2.7"}
2526
]
@@ -59,6 +60,7 @@ spec:
5960
# language=json
6061
opendatahub.io/notebook-software: |
6162
[
63+
{"name": "ROCm", "version": "v6.2"},
6264
{"name": "Python", "version": "v3.11"},
6365
{"name": "ROCm-PyTorch", "version": "2.6"}
6466
]

manifests/base/jupyter-rocm-tensorflow-notebook-imagestream.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ spec:
2020
# language=json
2121
opendatahub.io/notebook-software: |
2222
[
23+
{"name": "ROCm", "version": "v6.4"},
2324
{"name": "Python", "version": "v3.12"},
24-
{"name": "ROCm-TensorFlow", "version": "2.18"}
25+
{"name": "TensorFlow-ROCm", "version": "2.18"}
2526
]
2627
# language=json
2728
opendatahub.io/notebook-python-dependencies: |
2829
[
2930
{"name": "JupyterLab","version": "4.4"},
30-
{"name": "ROCm-TensorFlow", "version": "2.18"},
31+
{"name": "TensorFlow-ROCm", "version": "2.18"},
3132
{"name": "Tensorboard", "version": "2.18"},
3233
{"name": "Kafka-Python-ng", "version": "2.2"},
3334
{"name": "Matplotlib", "version": "3.10"},
@@ -58,14 +59,15 @@ spec:
5859
# language=json
5960
opendatahub.io/notebook-software: |
6061
[
62+
{"name": "ROCm", "version": "v6.2"},
6163
{"name": "Python", "version": "v3.11"},
62-
{"name": "ROCm-TensorFlow", "version": "2.14"}
64+
{"name": "TensorFlow-ROCm", "version": "2.14"}
6365
]
6466
# language=json
6567
opendatahub.io/notebook-python-dependencies: |
6668
[
6769
{"name": "JupyterLab","version": "4.4"},
68-
{"name": "ROCm-TensorFlow", "version": "2.14"},
70+
{"name": "TensorFlow-ROCm", "version": "2.14"},
6971
{"name": "Tensorboard", "version": "2.14"},
7072
{"name": "Kafka-Python-ng", "version": "2.2"},
7173
{"name": "Matplotlib", "version": "3.10"},

tests/test_main.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,23 @@ def test_image_pyprojects(subtests: pytest_subtests.plugin.SubTests):
7474
manifest = load_manifests_file_for(directory)
7575

7676
with subtests.test(msg="checking the `notebook-software` array", pyproject=file):
77-
# TODO(jdanek)
78-
pytest.skip("checking the `notebook-software` array not yet implemented")
7977
for s in manifest.sw:
8078
if s.get("name") == "Python":
8179
assert s.get("version") == f"v{python}", (
8280
"Python version in imagestream does not match Pipfile"
8381
)
82+
elif s.get("name") in ("R", "code-server"):
83+
# TODO(jdanek): check not implemented yet
84+
continue
85+
elif s.get("name") in ("CUDA", "ROCm"):
86+
# TODO(jdanek): check not implemented yet
87+
continue
8488
else:
85-
pytest.fail(f"unexpected {s=}")
89+
e = next((dep for dep in manifest.dep if dep.get("name") == s.get("name")), None)
90+
if e:
91+
assert s.get("version") == e.get("version")
92+
else:
93+
pytest.fail(f"unexpected {s=}")
8694

8795
with subtests.test(msg="checking the `notebook-python-dependencies` array", pyproject=file):
8896
for d in manifest.dep:
@@ -130,6 +138,7 @@ def test_image_pyprojects(subtests: pytest_subtests.plugin.SubTests):
130138
"Torch",
131139
"Transformers",
132140
"TrustyAI",
141+
"TensorFlow-ROCm",
133142
}
134143

135144
name = d["name"]
@@ -216,7 +225,7 @@ class VersionData:
216225
"Numpy",
217226
(
218227
"1.26", # trustyai 0.6.2 depends on numpy~=1.26.4
219-
# 2.0 for tensorflow rocm, but we don't have that in manifests
228+
"2.0", # for tensorflow rocm
220229
"2.1", # for tensorflow cuda
221230
"2.2", # for python 3.11 n-1 images
222231
"2.3", # this is our latest where possible
@@ -273,7 +282,7 @@ def test_image_pyprojects_version_alignment(subtests: pytest_subtests.plugin.Sub
273282
("torchvision", ("==0.22.1", "~=0.22.1", "==0.22.1+cu128", "==0.22.1+rocm6.2.4")),
274283
(
275284
"matplotlib",
276-
("~=3.10.6"),
285+
("~=3.10.6",),
277286
),
278287
(
279288
"numpy",
@@ -377,12 +386,8 @@ def is_suffix[T](main_sequence: Sequence[T], suffix_sequence: Sequence[T]):
377386

378387

379388
def _skip_unimplemented_manifests(directory: pathlib.Path, call_skip=True) -> bool:
380-
# TODO(jdanek): missing manifests
381-
dirs = (
382-
"runtimes/rocm-tensorflow/ubi9-python-3.12",
383-
"jupyter/rocm/tensorflow/ubi9-python-3.12",
384-
)
385-
for d in dirs:
389+
unimplemented_dirs = ()
390+
for d in unimplemented_dirs:
386391
if is_suffix(directory.parts, pathlib.Path(d).parts):
387392
if call_skip:
388393
pytest.skip(f"Manifest not implemented {directory.parts}")
@@ -429,8 +434,11 @@ def load_manifests_file_for(directory: pathlib.Path) -> Manifest:
429434
)
430435
current_tag = recommended_tags[0] if recommended_tags else imagestream["spec"]["tags"][0]
431436

432-
sw = json.loads(current_tag["annotations"]["opendatahub.io/notebook-software"])
433-
dep = json.loads(current_tag["annotations"]["opendatahub.io/notebook-python-dependencies"])
437+
try:
438+
sw = json.loads(current_tag["annotations"]["opendatahub.io/notebook-software"])
439+
dep = json.loads(current_tag["annotations"]["opendatahub.io/notebook-python-dependencies"])
440+
except Exception as e:
441+
raise ValueError(f"invalid json syntax in {manifest_file}") from e
434442

435443
return Manifest(
436444
filename=manifest_file,

0 commit comments

Comments
 (0)