标准化接口参数详情-镜像与 notebook

查镜像仓库/docker构建/镜像/notebook四个模型字段(镜像名、dockerfile、notebook 资源默认值等)时读这篇

06-二次开发 / API参考 / 标准化接口参数详情
镜像仓库repositorydocker镜像构建imagesnotebookjupyter在线IDE

镜像与 notebook 参数详情

字段「默认值/必填/可选值」为后端表单(add/edit_form_extra_fields)静态快照,运行时可能随用户、配置或 _info 接口动态变化,联调时以 $view/api/_info 返回为准。通用调用约定见 README 与 标准化接口。

仓库管理

/repository_modelview/api,表名:repository,视图:Repository_ModelView_Api,模型:Repository。

源码:myapp/views/view_images.py,myapp/models/model_job.py。

新增参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
name name string 是 是 英文名
server 服务地址 string(enum) 是 harbor.oa.com/cube-studio/ 否 镜像仓库地址,示例:REPOSITORY_ORG DataRequired(); Regexp('^[a-zA-Z0-9\-._:@\/]*$'); choices=[['harbor.oa.com/cube-studio/', 'harbor.oa.com/cube-studio/'], ['ccr.ccs.tenc...
user 用户名 string 是 否 镜像仓库的用户名 DataRequired()
password 密码 string 是 否 镜像仓库的链接密码 DataRequired()
hubsecret hubsecret string 否 否 k8s secret名

修改参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
name name string 是 是 英文名
server 服务地址 string(enum) 是 harbor.oa.com/cube-studio/ 否 镜像仓库地址,示例:REPOSITORY_ORG DataRequired(); Regexp('^[a-zA-Z0-9\-._:@\/]*$'); choices=[['harbor.oa.com/cube-studio/', 'harbor.oa.com/cube-studio/'], ['ccr.ccs.tenc...
user 用户名 string 是 否 镜像仓库的用户名 DataRequired()
password 密码 string 是 否 镜像仓库的链接密码 DataRequired()
hubsecret hubsecret string 否 否 k8s secret名

查看参数

无。

docker构建管理

/docker_modelview/api,表名:docker,视图:Docker_ModelView_Api,模型:Docker。

源码:myapp/views/view_docker.py,myapp/models/model_docker.py。

新增参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 是 否 项目组id
describe 描述 string 是 否 目标镜像描述 DataRequired()
base_image base_image string 否 否 基础镜像
target_image target_image string 否 否 目标镜像
consecutive_build consecutive_build boolean 否 True 否 连续构建
expand 扩展 string 否 expand 否 扩展参数

修改参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 是 否 项目组id
describe 描述 string 是 否 目标镜像描述 DataRequired()
base_image base_image string 否 否 基础镜像
target_image target_image string 否 否 目标镜像
consecutive_build consecutive_build boolean 否 True 否 连续构建
expand 扩展 string 否 expand 否 扩展参数

查看参数

无。

镜像管理

/images_modelview/api,表名:images,视图:Images_ModelView_Api,模型:Images。

源码:myapp/views/view_images.py,myapp/models/model_job.py。

新增参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 否 否 项目组id
repository repository relation 否 否 仓库id
name 名称 string 是 否 镜像名称全称,例如ubuntu:20.04 DataRequired(); Regexp('^[a-zA-Z0-9\-._:@\/]*$')
describe describe string 是 否 描述
dockerfile dockerfile string 否 否 镜像的构建Dockerfile全部内容,/mnt/$username/是个人存储目录,可以从此目录下复制文件到镜像中
gitpath gitpath string 否 否 git地址

修改参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 否 否 项目组id
repository repository relation 否 否 仓库id
name 名称 string 是 否 镜像名称全称,例如ubuntu:20.04 DataRequired(); Regexp('^[a-zA-Z0-9\-._:@\/]*$')
describe describe string 是 否 描述
dockerfile dockerfile string 否 否 镜像的构建Dockerfile全部内容,/mnt/$username/是个人存储目录,可以从此目录下复制文件到镜像中
gitpath gitpath string 否 否 git地址

查看参数

无。

notebook管理

/notebook_modelview/api,表名:notebook,视图:Notebook_ModelView_Api,模型:Notebook。

源码:myapp/views/view_notebook.py,myapp/models/model_notebook.py。

说明:node_selector 表单默认值取值为 cpu=true;notebook=true(分号分隔,myapp/views/view_notebook.py:171)。

新增参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 是 否 项目组id
name name string 否 是 英文名
describe describe string 否 否 描述
images images string 否 否 镜像
working_dir working_dir string 否 否 工作目录
volume_mount volume_mount string 否 kubeflow-user-workspace(pvc):/mnt 否 挂载
resource_memory resource_memory string 否 10G 否 申请内存
resource_cpu resource_cpu string 否 10 否 申请cpu
resource_gpu resource_gpu string 否 0 否 申请gpu
node_selector node_selector string 否 cpu=true;notebook=true 否 机器选择器

修改参数

无。

查看参数

参数 名称 类型 必填 默认值 唯一 说明 校验/可选值
project project relation 是 否 项目组id
name name string 否 是 英文名
namespace namespace string 否 jupyter 否 命名空间
describe describe string 否 否 描述
images images string 否 否 镜像
working_dir working_dir string 否 否 工作目录
env env string 否 否 环境变量
volume_mount volume_mount string 否 kubeflow-user-workspace(pvc):/mnt 否 挂载
resource_memory resource_memory string 否 10G 否 申请内存
resource_cpu resource_cpu string 否 10 否 申请cpu
resource_gpu resource_gpu string 否 0 否 申请gpu
expand expand string 否 {} 否 扩展参数
node_selector node_selector string 否 cpu=true;notebook=true 否 机器选择器
status status computed 否 否
changed_on changed_on computed 否 否
created_on created_on computed 否 否
最后更新 2026-07-14完整文档以官方仓库为准:GitHub Wiki