《OpenShift / RHEL / DevSecOps 汇总目录》
说明:本文已经在 OpenShift 4.18 + OpenShift AI 2.19 的环境中验证
文章目录
- 查看可用 Notebook 镜像
- 控制台查看
- 命令行查看
- Notebook 镜像、Image Stream 和 Image Registry Repository 对应关系
- 启用老版本的 Notebook 镜像
- 参考
查看可用 Notebook 镜像
控制台查看
在 OpenShift AI 中可以在一个项目的 Workbench 中或者在 Applications -> Enabled 中通过选择特定的 Notebook Image 来运行 Notebook Server。下图中 OpenShift AI 内置的 Notebook Image 包含的软件配置可参见官方 《Red Hat OpenShift AI: Supported Configurations》中 “Supported workbench images” 小节的说明。
可看到当前 OpenShift AI 有 2 个可用的 TensFlow版本:2025.1 和 2024.2。点击版本右侧的图标,将显示该版本镜像中所含软件包的情况。RedHat 会每 6 个月对 Notebook 镜像升级一次,同时会淘汰过时的老版本镜像(后面将介绍如何启用老版本 Notebook 镜像)。
命令行查看
通过以下命令可以查看在 OpenShift AI 中可用的 Notebook 镜像。
$ oc get is -n redhat-ods-applications
NAME IMAGE REPOSITORY TAGS UPDATED
code-server-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/code-server-notebook 2023.2,2024.1,2024.2,2025.1 5 days ago
cuda-rhel9 image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/cuda-rhel9
cuda-rstudio-rhel9 image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/cuda-rstudio-rhel9
jupyter-rocm-minimal image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/jupyter-rocm-minimal 2024.2,2025.1 5 days ago
jupyter-rocm-pytorch image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/jupyter-rocm-pytorch 2024.2,2025.1 5 days ago
jupyter-rocm-tensorflow image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/jupyter-rocm-tensorflow 2024.2,2025.1 5 days ago
minimal-gpu image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/minimal-gpu 1.2,2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
odh-trustyai-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/odh-trustyai-notebook 2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
pytorch image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/pytorch 1.2,2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
rstudio-rhel9 image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/rstudio-rhel9
s2i-generic-data-science-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-generic-data-science-notebook 1.2,2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
s2i-minimal-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook 1.2,2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
tensorflow image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/tensorflow 1.2,2023.1,2023.2,2024.1,2024.2,2025.1 5 days ago
执行以下命令可查看上一步显示的名为 tensorflow 的 ImageStream 包含的信息,包括 Tag 和对应的镜像地址。在返回结果的 status 中可以看到 tensorflow 有哪些可用的 tag,可以看到除了在控制台中看到的 2025.1 和 2024.2 以外还有 2024.1、2023.2、2023.1、1.2。
$ oc get is -n redhat-ods-applications tensorflow -oyaml
。。。
status:
dockerImageRepository: image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/tensorflow
tags:
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:6fadedc5a10f5a914bb7b27cd41bc644392e5757ceaf07d930db884112054265
generation: 2
image: sha256:6fadedc5a10f5a914bb7b27cd41bc644392e5757ceaf07d930db884112054265
tag: "1.2"
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:88d80821ff8c5d53526794261d519125d0763b621d824f8c3222127dab7b6cc8
generation: 2
image: sha256:88d80821ff8c5d53526794261d519125d0763b621d824f8c3222127dab7b6cc8
tag: "2023.1"
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:3da74d732d158b92eaada0a27fb7067fa18c8bde5033c672e23caed0f21d6481
generation: 2
image: sha256:3da74d732d158b92eaada0a27fb7067fa18c8bde5033c672e23caed0f21d6481
tag: "2023.2"
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:0e57a0b756872636489ccd713dc9f00ad69d0c481a66ee0de97860f13b4fedcd
generation: 2
image: sha256:0e57a0b756872636489ccd713dc9f00ad69d0c481a66ee0de97860f13b4fedcd
tag: "2024.1"
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:99d3fb964e635873214de4676c259a96c2ea25f3f79cc4bead5bc9f39aba34c0
generation: 2
image: sha256:99d3fb964e635873214de4676c259a96c2ea25f3f79cc4bead5bc9f39aba34c0
tag: "2024.2"
- items:
- created: "2025-05-27T01:53:53Z"
dockerImageReference: quay.io/modh/cuda-notebooks@sha256:3c7d3cb69cb311925afd67d05e54b0d34a2acd6990ff12a16bb3ee5cb8dbd265
generation: 2
image: sha256:3c7d3cb69cb311925afd67d05e54b0d34a2acd6990ff12a16bb3ee5cb8dbd265
tag: "2025.1"
。。。
查看名为 tensorflow:2023.1 的 imagestreamtag 。其中可以从以下部分了解该 imagestreamtag 对应的镜像情况,例如 notebook-software,notebook-python-dependencies,依赖镜像 quay.io/modh/cuda-notebooks,其中 opendatahub.io/image-tag-outdated 为 true。
$ oc get imagestreamtag tensorflow:2023.1 -n redhat-ods-applications -oyaml
。。。
image:
metadata:
name: 'sha256:88d80821ff8c5d53526794261d519125d0763b621d824f8c3222127dab7b6cc8'
uid: f90e20f0-84bb-4f1f-9841-896680f67436
resourceVersion: '65395'
creationTimestamp: '2025-05-27T01:53:53Z'
annotations:
image.openshift.io/dockerLayersOrder: ascending
opendatahub.io/image-tag-outdated: 'true'
opendatahub.io/notebook-build-commit: 07015ec
opendatahub.io/notebook-python-dependencies: |
[
{"name":"TensorFlow","version":"2.11"},
{"name":"Tensorboard","version":"2.11"},
{"name":"Boto3","version":"1.26"},
{"name":"Kafka-Python","version":"2.0"},
{"name":"Kfp-tekton","version":"1.5"},
{"name":"Matplotlib","version":"3.6"},
{"name":"Numpy","version":"1.24"},
{"name":"Pandas","version":"1.5"},
{"name":"Scikit-learn","version":"1.2"},
{"name":"Scipy","version":"1.10"},
{"name":"Elyra","version":"3.15"}
]
opendatahub.io/notebook-software: |
[
{"name":"CUDA","version":"11.8"},
{"name":"Python","version":"v3.9"},
{"name":"TensorFlow","version":"2.11"}
]
openshift.io/imported-from: quay.io/modh/cuda-notebooks
。。。
Notebook 镜像、Image Stream 和 Image Registry Repository 对应关系
Notebook 镜像名称 | Image Stream 名称 | Image Registry Repository | 说明 |
---|---|---|---|
Minimal Python | s2i-minimal-notebook | quay.io/modh/odh-pytorch-notebook | 只提供基础 Python 运行环境,不提供任何附加包 |
Standard Data Science | s2i-generic-data-science-notebook | quay.io/modh/odh-generic-data-science-notebook | 提供常用的科学计算包,但不提供 TensorFlow 或 PyTorch |
CUDA | minimal-gpu | quay.io/modh/cuda-notebooks | 使用 GPU 加速库和优化工具来优化工作 |
PyTorch | pytorch | quay.io/modh/odh-pytorch-notebook | 利用 PyTorch 构建、训练和部署机器学习模型 |
TensorFlow | tensorflow | quay.io/modh/cuda-notebooks | 利用 TensorFlow 构建、训练和部署机器学习模型 |
TrustyAI | odh-trustyai-notebook | quay.io/modh/odh-trustyai-notebook | 利用 TrustyAI 构建、训练和部署机器学习模型 |
ROCm | jupyter-rocm-minimal | quay.io/modh/rocm-notebooks | 使用 AMD GPU 运行通用的 ML 工作负载 |
ROCm-PyTorch | jupyter-rocm-pytorch | quay.io/modh/rocm-notebooks | 使用 AMD GPU 运行基于 PyTorch 的 ML 工作负载 |
ROCm-TensorFlow | jupyter-rocm-tensorflow | quay.io/modh/rocm-notebook | 使用 AMD GPU 运行通基于 TensorFlow 的工作负载 |
code-server | code-server-notebook | quay.io/modh/codeserver | 使用基于 VScode 的IDE |
启用老版本的 Notebook 镜像
- 编辑名为 tensorflow:2023.1 的 imagestreamtag 对象,删除包含
opendatahub.io/image-tag-outdated: "true"
的 3 行,然后保存。 - 然后在 OpenShift AI 控制中可看到原来未显示的过时老版本 2023.1 被显示出来了。
注意:
- 被恢复启用的老版本 Notebook 镜像因为已经超过 RedHat 支持的生命周期,因此即便有 Bug,也得不到官方支持。
- 当 OpenShift 集群被重启后,被恢复启用的老版本 Notebook 镜像会再次被重置为隐藏状态。
参考
https://access.redhat.com/articles/rhoai-supported-configs
https://ai-on-openshift.io/odh-rhoai/custom-notebooks/
https://github.com/opendatahub-io/notebooks/wiki/Workbenches
https://github.com/opendatahub-io/notebooks/wiki/Developer-Guide
https://github.com/opendatahub-io/notebooks/wiki/User-Guide
https://github.com/opendatahub-io/notebooks
https://github.com/opendatahub-io/notebooks/wiki/Workbenches
https://docs.redhat.com/en/documentation/red_hat_openshift_ai_self-managed/2.20/html/managing_openshift_ai/creating-custom-workbench-images
https://docs.redhat.com/en/documentation/red_hat_openshift_ai_self-managed/2.20/html/managing_openshift_ai/creating-custom-workbench-images#creating-a-custom-image-from-default-image_custom-images
https://github.com/opendatahub-io-contrib/workbench-images
https://github.com/opendatahub-io-contrib/workbench-images/releases
https://github.com/opendatahub-io-contrib/workbench-images/blob/main/DEVELOPMENT.md
https://quay.io/repository/opendatahub-contrib/workbench-images
https://quay.io/organization/modh