6.8. 我无法创建 Ray 集群或提交作业
问题
运行 cluster.up ()
命令后,会显示类似以下错误的错误:
RuntimeError: Failed to get RayCluster CustomResourceDefinition: (403) Reason: Forbidden HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"rayclusters.ray.io is forbidden: User \"system:serviceaccount:regularuser-project:regularuser-workbench\" cannot list resource \"rayclusters\" in API group \"ray.io\" in the namespace \"regularuser-project\"","reason":"Forbidden","details":{"group":"ray.io","kind":"rayclusters"},"code":403}
RuntimeError: Failed to get RayCluster CustomResourceDefinition: (403)
Reason: Forbidden
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"rayclusters.ray.io is forbidden: User \"system:serviceaccount:regularuser-project:regularuser-workbench\" cannot list resource \"rayclusters\" in API group \"ray.io\" in the namespace \"regularuser-project\"","reason":"Forbidden","details":{"group":"ray.io","kind":"rayclusters"},"code":403}
诊断
笔记本代码的 TokenAuthentication
部分中没有指定正确的 OpenShift 登录凭证。
解决方案
找出正确的 OpenShift 登录凭证,如下所示:
- 在 OpenShift 控制台标头中,单击您的用户名,再单击 Copy login command。
- 在打开的新标签页中,以您要使用的凭据的用户身份登录。
- 单击 Display Token。
-
从 带有此令牌部分的 Log in 中,复制
token
和server
值。
在笔记本代码中,指定复制的
令牌和
服务器
值,如下所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow