《OpenShift / RHEL / DevSecOps 汇总目录》
说明:本文已经在 OpenShift 4.14 + RHODS 2.50 的环境中验证
RHOAI 使用 StatefulSet 来运行 Applications > Enabled 中的 Jupyter 环境,该 StatefulSet 和其他相关资源全部运行在 rhods-notebook 项目中。
$ oc get all -n rhods-notebooks
Warning: apps.openshift.io/v1 DeploymentConfig is deprecated in v4.14+, unavailable in v4.10000+
NAME READY STATUS RESTARTS AGE
pod/jupyter-nb-user1-0 2/2 Running 0 14m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/jupyter-nb-user1 ClusterIP 172.31.145.240 <none> 80/TCP 14m
service/jupyter-nb-user1-tls ClusterIP 172.31.157.129 <none> 443/TCP 14m
NAME READY AGE
statefulset.apps/jupyter-nb-user1 1/1 14m
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
route.route.openshift.io/jupyter-nb-user1 jupyter-nb-user1-rhods-notebooks.apps.cluster-4gwc7.dynamic.redhatworkshops.io jupyter-nb-user1-tls oauth-proxy reencrypt/Redirect None
$ oc get pvc -n rhods-notebooks
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
jupyterhub-nb-user1-pvc Bound pvc-379c22b3-ddc8-4c7c-b6ae-59311f2a1383 20Gi RWO ocs-external-storagecluster-ceph-rbd 41m
$ oc get statefulset -n rhods-notebooks
NAME READY AGE
jupyter-nb-user1 0/0 16m
在 RHOAI 中是通过容器运行 Jupyter notebook 的。可以在 RHOAI 控制台中看到缺省提供的容器镜像类型,它们包括:Minimal Python、Standard Data Science、CUDA、Pytorch、TensorFlow、HabanaAI、TrustAI。另外用户也可以使用自己定制的容器镜像。
注意:每个镜像包含的预安装包见详细说明。
在创建 Jupyter notebook server 的界面中需要我们选择所使用的镜像。这些镜像是通过 redhat-ods-applications 项目中的 ImageStream 被访问到的。
$ oc get is -n redhat-ods-applications
NAME IMAGE REPOSITORY TAGS UPDATED
habana-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/habana-notebook 2023.2 9 minutes ago
minimal-gpu image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/minimal-gpu 1.2,2023.1,2023.2 9 minutes ago
odh-trustyai-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/odh-trustyai-notebook 2023.1,2023.2 9 minutes ago
pytorch image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/pytorch 1.2,2023.1,2023.2 9 minutes ago
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 9 minutes ago
s2i-minimal-notebook image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-minimal-notebook 1.2,2023.1,2023.2 9 minutes ago
tensorflow image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/tensorflow 1.2,2023.1,2023.2 9 minutes ago
$ oc get is -n redhat-ods-applications tensorflow -ojsonpath={.spec.tags[2]} | jq
{
"annotations": {
"opendatahub.io/notebook-build-commit": "d0ce8b0",
"opendatahub.io/notebook-python-dependencies": "[{\"name\":\"TensorFlow\",\"version\":\"2.13\"},{\"name\":\"Tensorboard\",\"version\":\"2.13\"}, {\"name\":\"Boto3\",\"version\":\"1.28\"},{\"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.3\"},{\"name\":\"Scipy\",\"version\":\"1.11\"},{\"name\":\"Elyra\",\"version\":\"3.15\"},{\"name\":\"PyMongo\",\"version\":\"4.5\"},{\"name\":\"Pyodbc\",\"version\":\"4.0\"}, {\"name\":\"Codeflare-SDK\",\"version\":\"0.12\"}, {\"name\":\"Sklearn-onnx\",\"version\":\"1.15\"}, {\"name\":\"Psycopg\",\"version\":\"3.1\"}, {\"name\":\"MySQL Connector/Python\",\"version\":\"8.0\"}]",
"opendatahub.io/notebook-software": "[{\"name\":\"CUDA\",\"version\":\"11.8\"},{\"name\":\"Python\",\"version\":\"v3.9\"},{\"name\":\"TensorFlow\",\"version\":\"2.13\"}]",
"opendatahub.io/workbench-image-recommended": "true",
"openshift.io/imported-from": "quay.io/modh/cuda-notebooks"
},
"from": {
"kind": "DockerImage",
"name": "quay.io/modh/cuda-notebooks@sha256:59d571d0d245c050eb9f79de5c3c40517a575d8fdfb41385a324ee45a42b597b"
},
"generation": 2,
"importPolicy": {
"importMode": "Legacy"
},
"name": "2023.2",
"referencePolicy": {
"type": "Source"
}
}
在 RHOAI 控制台中每个有权限的用户都可在 Applications 中创建并运行一个 Notebook Server 环境。所有用户的 Notebook Server 都是以 StatefulSet 方式运行在 rhods-notebook 项目中。然而一个用户的多个 AI/ML 都在 Applications 中的这个 Notebook Server 环境中运行往往是不够的,因此用户可以在 Data Science Projects 中创建多个项目以运维不同的 AI/ML。
https://ai-on-openshift.io/odh-rhods/configuration/