《OpenShift / RHEL / DevSecOps 汇总目录》
说明:本文已经在 OpenShift 4.18 + OpenShift AI 2.19 的环境中验证
文章目录
- 查看可用 Notebook 镜像
- 控制台查看
- 命令行查看
- Notebook 镜像和 Image Stream 对应关系
- 启用老版本的 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/tensorflowtags:- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:6fadedc5a10f5a914bb7b27cd41bc644392e5757ceaf07d930db884112054265generation: 2image: sha256:6fadedc5a10f5a914bb7b27cd41bc644392e5757ceaf07d930db884112054265tag: "1.2"- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:88d80821ff8c5d53526794261d519125d0763b621d824f8c3222127dab7b6cc8generation: 2image: sha256:88d80821ff8c5d53526794261d519125d0763b621d824f8c3222127dab7b6cc8tag: "2023.1"- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:3da74d732d158b92eaada0a27fb7067fa18c8bde5033c672e23caed0f21d6481generation: 2image: sha256:3da74d732d158b92eaada0a27fb7067fa18c8bde5033c672e23caed0f21d6481tag: "2023.2"- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:0e57a0b756872636489ccd713dc9f00ad69d0c481a66ee0de97860f13b4fedcdgeneration: 2image: sha256:0e57a0b756872636489ccd713dc9f00ad69d0c481a66ee0de97860f13b4fedcdtag: "2024.1"- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:99d3fb964e635873214de4676c259a96c2ea25f3f79cc4bead5bc9f39aba34c0generation: 2image: sha256:99d3fb964e635873214de4676c259a96c2ea25f3f79cc4bead5bc9f39aba34c0tag: "2024.2"- items:- created: "2025-05-27T01:53:53Z"dockerImageReference: quay.io/modh/cuda-notebooks@sha256:3c7d3cb69cb311925afd67d05e54b0d34a2acd6990ff12a16bb3ee5cb8dbd265generation: 2image: sha256:3c7d3cb69cb311925afd67d05e54b0d34a2acd6990ff12a16bb3ee5cb8dbd265tag: "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-896680f67436resourceVersion: '65395'creationTimestamp: '2025-05-27T01:53:53Z'annotations:image.openshift.io/dockerLayersOrder: ascendingopendatahub.io/image-tag-outdated: 'true'opendatahub.io/notebook-build-commit: 07015ecopendatahub.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 对应关系
OpenShift 的 Image Stream 和 OpenShift AI 的 Notebook 镜像对应关系如下:
Image Stream 名称 | Notebook Image 名称 |
---|---|
s2i-minimal-notebook | Minimal Python |
s2i-generic-data-science-notebook | Standard Data Science |
minimal-gpu | CUDA |
pytorch | PyTorch |
tensorflow | TensorFlow |
odh-trustyai-notebook | TrustyAI |
code-server-notebook | code-server |
jupyter-rocm-minimal | ROCm |
jupyter-rocm-pytorch | ROCm-PyTorch |
jupyter-rocm-tensorflow | ROCm-TensorFlow |
启用老版本的 Notebook 镜像
- 编辑名为 tensorflow:2023.1 的 imagestreamtag 对象,删除包含
opendatahub.io/image-tag-outdated: "true"
的 3 行,然后保存。 - 然后在 OpenShift AI 控制中可看到原来未显示的过时老版本 2023.1 被显示出来了。
参考
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