管理模型 registry


Red Hat OpenShift AI Cloud Service 1

在 Red Hat OpenShift AI Cloud Service 中管理模型 registry

摘要

作为 OpenShift AI 管理员,您可以在 OpenShift AI 中创建、删除和管理模型 registry 的权限。

前言

作为 OpenShift AI 管理员,您可以在 OpenShift AI 中创建、删除和管理模型 registry 的权限。

第 1 章 模型 registry 概述

重要

在 Red Hat OpenShift AI 中,模型 registry 和模型目录目前在 Red Hat OpenShift AI 中作为技术预览功能提供。技术预览功能不受红帽产品服务等级协议(SLA)支持,且功能可能并不完整。红帽不推荐在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。

有关红帽技术预览功能支持范围的更多信息,请参阅技术预览功能支持范围

模型 registry 是人工智能/机器学习(AI/ML)模型以及任何机器学习操作(MLOps)平台或 ML 工作流的重要组成部分。模型 registry 充当中央存储库,包含与机器学习模型相关的元数据,从最初到部署。此元数据从部署环境和项目来源等高级别信息范围到类似培训超参数、性能指标和部署事件等详细信息。模型注册表充当模型试验和服务之间的桥接,为 ML 生命周期的利益相关者提供安全的协作元数据存储接口。

模型 registry 提供了一种结构化和组织的方法来存储、共享、版本、部署和跟踪模型。

要在 OpenShift AI 中使用模型 registry,OpenShift 集群管理员必须启用模型 registry 组件。如需更多信息 ,请参阅启用模型 registry 组件

启用模型 registry 组件后,OpenShift AI 管理员可以在 OpenShift AI 中创建模型 registry,并授予模型 registry 对使用它们的数据科学家的访问权限。如需更多信息,请参阅 管理模型 registry

可访问模型 registry 的数据科学家可以使用模型 registry 功能存储、共享、版本、部署和跟踪模型。如需更多信息,请参阅使用模型 registry

通过增加了模型目录功能,您可以发现可用的模型,并可供您机构注册、部署和自定义。此功能从使用 Granite 系列模型连接用户开始,以及与 LAB-tuning 工作流一起使用的手和 judge 模型开始。

有关使用 LAB-tuning 工作流的更多信息,请参阅使用 LAB-tuning 自定义模型

第 2 章 创建模型 registry

您可以创建一个模型 registry 来存储、共享、版本、部署和跟踪您的模型。

先决条件

  • 您已以具有 OpenShift AI 管理员特权的用户身份登录到 OpenShift AI。
  • 集群管理员已在 OpenShift AI 部署中启用了模型 registry 组件。如需更多信息 ,请参阅启用模型 registry 组件
  • 您可以访问外部 MySQL 数据库,该数据库至少使用 MySQL 版本 5.x。但是,红帽建议您使用 MySQL 版本 8.x。

流程

  1. 在 OpenShift AI 仪表板中点 SettingsModel registry settings
  2. Create model registry

    Create model registry 对话框将打开。

  3. Name 字段中输入模型 registry 的名称。
  4. 可选:点 Edit resource name,然后在 Resource name 字段中输入模型 registry 的特定资源名称。默认情况下,资源名称将与模型 registry 的名称匹配。

    重要

    资源名称是您资源在 OpenShift 中标记为哪些资源。您的资源名称不能超过 253 个字符,必须包含小写字母数字字符或 -,且必须以字母数字字符开头和结尾。资源名称在创建后不可编辑。

    资源名称必须与 OpenShift 集群中任何其他模型 registry 资源的名称不匹配。

  5. 可选:在 Description 字段中输入模型 registry 的描述。
  6. Connect to external MySQL database 部分中,输入存储模型数据的外部数据库的信息。

    1. Host 字段中,输入数据库主机名。

      1. 如果数据库在 rhoai-model-registries 命名空间中运行,则只为数据库输入主机名。
      2. 如果数据库在与 rhoai-model-registries 不同的命名空间中运行,以 <hostname>.< namespace>.svc.cluster.local 格式输入数据库主机名详情。
    2. Port 字段中输入数据库的端口号。
    3. Username 字段中,输入连接到数据库的默认用户名。
    4. Password 字段中,输入默认用户帐户的密码。
    5. Database 字段中,输入数据库名称。
  7. 可选: 选择 Add CA 证书来保护数据库连接,以使用您的数据库连接的证书。

    重要

    如果您的外部数据库被配置为强制传输层安全(TLS),您必须添加证书颁发机构(CA)证书。

    1. Use cluster-wide CA bundle 来使用 odh-trusted-ca-bundle ConfigMap 中的 ca-bundle.crt 捆绑包。
    2. Use Red Hat OpenShift AI CA bundle,以使用 odh-trusted-ca-bundle ConfigMap 中的 odh-ca-bundle.crt 捆绑包。
    3. Choose from existing certificates 以选择现有证书。您可以在 rhoai-model-registries 命名空间中选择任何 ConfigMap 或 secret 的键。

      1. Resource 列表中,选择一个 ConfigMap 或 secret。
      2. Key 列表中,选择一个密钥。
    4. Upload new certificate 以上传新证书作为 ConfigMap。

      1. 将证书的 PEM 文件拖放到 Certificate 字段中,或者点击 Upload 以从本地机器的文件系统中选择文件。

        注意

        上传证书会创建带有 ca.crt 键的 db-credential ConfigMap。

        要上传证书作为 secret,您必须在 OpenShift rhoai-model-registries 命名空间中创建 secret,然后在创建模型 registry 时将其选为现有证书。

        有关在 OpenShift 中创建 secret 的更多信息,请参阅 OpenShift Dedicated:使用 secret 和 Red Hat OpenShift Service on AWS 将敏感数据提供给 pod :使用 secret 将敏感数据提供给 pod

  8. Create
注意

要查找模型 registry 的资源名称或类型,请点击 registry 名称旁的帮助图标 Help icon 。资源名称和类型用于在 OpenShift 中查找您的资源。

验证

  • 新模型 registry 在 Model registry 设置 页面中显示。
  • 您可以点击模型 registry 来编辑模型 registry,然后点击 Edit model registry
  • 您可以在 Model registry 选项卡中使用模型 registry 注册模型。有关使用模型 registry 的更多信息,请参阅使用模型 registry

第 3 章 编辑模型 registry

您可以编辑现有模型 registry 的详细信息,如模型 registry 名称、描述和数据库连接详情。

先决条件

  • 您已以具有 OpenShift AI 管理员特权的用户身份登录到 OpenShift AI。
  • 集群管理员已在 OpenShift AI 部署中启用了模型 registry 组件。如需更多信息 ,请参阅启用模型 registry 组件
  • 您的 OpenShift AI 部署至少包含 1 个模型 registry。

流程

  1. 在 OpenShift AI 仪表板中点 SettingsModel registry settings
  2. 点您要编辑的模型 registry旁边的操作菜单(alsa),然后点 Edit model registry

    这会打开 Edit model registry 对话框。

  3. 可选:在 Name 字段中,编辑模型 registry 的名称。
  4. 可选:在 Description 字段中编辑模型 registry 的描述。
  5. 可选:在 Connect to external MySQL 数据库 部分,编辑存储了 registry 的外部数据库的信息。

    1. Host 字段中,输入数据库主机名。

      1. 如果数据库在 rhoai-model-registries 命名空间中运行,则只为数据库输入主机名。
      2. 如果数据库在与 rhoai-model-registries 不同的命名空间中运行,以 <hostname>.< namespace>.svc.cluster.local 格式输入数据库主机名详情。
    2. Port 字段中输入数据库的端口号。
    3. Username 字段中,输入连接到数据库的默认用户名。
    4. Password 字段中,输入默认用户帐户的密码。
    5. Database 字段中,输入数据库名称。
  6. 可选: 选择 Add CA 证书来保护数据库连接,以使用您的数据库连接的证书。

    重要

    如果您的外部数据库被配置为强制传输层安全(TLS),您必须添加证书颁发机构(CA)证书。

    1. Use cluster-wide CA bundle 来使用 odh-trusted-ca-bundle ConfigMap 中的 ca-bundle.crt 捆绑包。
    2. Use Red Hat OpenShift AI CA bundle,以使用 odh-trusted-ca-bundle ConfigMap 中的 odh-ca-bundle.crt 捆绑包。
    3. Choose from existing certificates 以选择现有证书。您可以在 rhoai-model-registries 命名空间中选择任何 ConfigMap 或 secret 的键。

      1. Resource 列表中,选择一个 ConfigMap 或 secret。
      2. Key 列表中,选择一个密钥。
    4. Upload new certificate 以上传新证书作为 ConfigMap。

      1. 将证书的 PEM 文件拖放到 Certificate 字段中,或者点击 Upload 以从本地机器的文件系统中选择文件。

        注意

        上传证书会创建带有 ca.crt 键的 db-credential ConfigMap。

        要上传证书作为 secret,您必须在 OpenShift rhoai-model-registries 命名空间中创建 secret,然后在创建模型 registry 时将其选为现有证书。

        有关在 OpenShift 中创建 secret 的更多信息,请参阅 OpenShift Dedicated:使用 secret 和 Red Hat OpenShift Service on AWS 将敏感数据提供给 pod :使用 secret 将敏感数据提供给 pod

  7. Update

验证

  • 使用 Model registry settings 页中的更新详情会显示模型 registry。

第 4 章 管理模型 registry 权限

您可以为机构中个别用户和用户组管理对模型 registry 的访问,以及项目中的服务帐户。

注意

OpenShift AI 会自动创建 & lt;model-registry-name>-users 组,以用于模型 registry。您可以在 OpenShift 中将用户添加到这个组中,或者要求集群管理员这样做。

模型 registry operator 使用 OpenShift 基于角色的访问控制(RBAC),并在 rhoai-model-registries 命名空间中创建各种 RBAC 资源。

对于每个模型 registry 实例,Operator 都会创建一个 registry -users-<model registry instance name > 角色,以及一个名为 < model registry instance name>-users 的 OpenShift 组。要授予单个用户、服务帐户或组对模型 registry 实例的访问权限,集群管理员必须创建一个到实例的 registry -users-<model registry instance name&gt; 角色的角色绑定。

& lt;model registry instance name>-users 组具有到 registry-users-<model registry instance name> 角色的角色绑定。集群管理员可将用户添加到此组中,以授予他们对模型 registry 实例的访问权限,而无需为每个用户创建角色绑定。

有关在 OpenShift 中管理 RBAC 的更多信息,请参阅使用 RBAC 定义和应用权限(Red Hat OpenShift Service on AWS)以及使用 RBAC 定义和应用权限(OpenShift Dedicated)。

先决条件

  • 您已以具有 OpenShift AI 管理员特权的用户身份登录到 OpenShift AI。
  • 您的部署中存在一个可用的模型 registry。
  • OpenShift 中已存在您要提供访问权限的用户和组。如需更多信息,请参阅 管理用户和组

流程

  1. 在 OpenShift AI 仪表板中点 SettingsModel registry settings
  2. 点您要管理访问权限的模型 registry 旁边的 Manage 权限

    模型 registry 的权限页面将打开。

  3. 为一个或多个 OpenShift 组提供项目访问权限。

    1. Users 选项卡中,单击 Groups 部分中的 Add group
    2. Select a group 下拉列表中选择一个组。

      注意

      若要启用所有集群用户的访问权限,请将 system:authenticated 添加到组列表中。

    3. 要确认您的条目,请点击 Confirm ( The Confirm icon )。
    4. 可选: 要添加额外的组,点 Add group 并重复此过程。
  4. 提供一个或多个用户对模型 registry 的访问权限。

    1. Users 选项卡中,单击 Users 部分中的 Add user
    2. Type username 字段中,输入您要提供访问权限的用户的用户名。
    3. 要确认您的条目,请点击 Confirm ( The Confirm icon )。
    4. 可选: 要添加其他用户,请点 Add user 并重复此过程。
  5. 为项目中的所有服务帐户提供模型 registry 的访问权限。

    1. Projects 选项卡上,在 Projects 部分中,单击 Add project
    2. Select or enter project 字段中,选择或输入您要提供访问权限的项目名称。
    3. 要确认您的条目,请点击 Confirm ( The Confirm icon )。
    4. 可选: 要添加其他项目,请点 Add project 并重复此过程。

验证

  • 授予模型 registry 访问权限的用户、组和帐户可以在该 registry 中注册、查看、编辑、版本、部署、删除、存档和恢复模型。
  • Permissions 选项卡中的 Users and Groups 部分显示您授予对模型 registry 访问权限的相应用户和组。
  • Projects 选项卡中的 Projects 部分显示您被授予对模型 registry 访问权限的项目。

在提供对模型 registry 的访问后,具有访问权限的用户可以使用模型 registry 功能存储、共享、版本、部署和跟踪模型。如需更多信息,请参阅使用模型 registry

第 5 章 删除模型 registry

您可以删除不再需要的模型 registry。

重要

当您删除模型 registry 时,连接到模型 registry 的数据库不会被删除。要删除任何剩余的数据库,请联络您的集群管理员。

先决条件

  • 您已以具有 OpenShift AI 管理员特权的用户身份登录到 OpenShift AI。
  • 您的部署中存在一个可用的模型 registry。

流程

  1. 在 OpenShift AI 仪表板中点 SettingsModel registry settings
  2. 点您要删除的模型 registry旁边的操作菜单(WWN)。
  3. Delete model registry
  4. 在打开的 Delete model registry? 对话框中,在文本字段中输入模型 registry 的名称,以确认您想要删除它。
  5. Delete model registry

验证

  • Model registry 不再显示在 Model registry settings 页面中。

法律通告

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部