All Products
Search
Document Center

Container Service for Kubernetes:Manage models in MLflow Model Registry

最終更新日:May 11, 2024

You can use the cloud-native AI suite to manage models in MLflow Model Registry. This topic describes how to use AI Developer Console and the Arena CLI to manage models.

Background information

MLflow is an open source machine learning lifecycle management platform, which can be used to track model training information, manage machine learning models, and deploy machine learning models. For more information about MLflow Model Registry, see MLflow Model Registry - MLflow documentation.

Prerequisites

Use AI Developer Console to manage models

Add registered models

  1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, click the name of the cluster that you want to manage and choose Applications > Cloud-native AI Suite in the left-side navigation pane.

  3. In the upper-left part of the Cloud-native AI Suite page, click AI Developer Console. Then, in the left-side navigation pane of the Cloud Native AI page, click Model Manage.

  4. On the Model Manage page, click New Registered Model.

  5. In the New Registered Model dialog box, configure the Name, Tags, and Description parameters.

    In the following example, the model name is my-model. The key1 and key2=value2 tags are added to the model. The model description is This is some description about my-model!.

    image

  6. After you complete the configuration, click OK and refresh the model list. Then, the registered model is displayed in Registered Models list.

View registered models

In the registered model list on the Model Manage page, click the name of your model to view the detailed information about the model on the Registered Model Details page.

Modify registered models

On the Registered Model Details page, you can perform the following operations:

  • Modify the name of the registered model.

  • Modify the description of the registered model.

  • Modify the tags of the registered model or add tags to the model.

  • Add a model version.

Use Arena to manage models

For more information about how to use Arena to manage models, see Model Manage Guide - Arena Documentation.

Add model versions

Run the following command to add a model version:

arena model create \
    --name my-model \
    --tags key1,key2=value2 \
    --description "This is some description about my-model" \
    --version-tags key3,key4=value4 \
    --version-description "This is some description about my-model v1" \
    --source pvc://my-pvc/models/my-model/1

Expected output:

INFO[0000] registered model "my-model" created     
INFO[0000] model version 1 for "my-model" created  

Query registered models or model versions

  • Query registered models

    Run the following command to query a registered model named my-model:

    arena model get \
        --name my-model

    Expected output:

    Name:                my-model
    LatestVersion        1
    CreationTime:        2024-04-29T16:15:26+08:00
    LastUpdatedTime:     2024-04-29T16:44:17+08:00
    Description:
      This is some description about my-model!
    Tags:
      key1: 
      key2: value2
    Versions:
      Version    Source
      ---        ---
      1          pvc://my-pvc/models/my-model/1
  • Query model versions

    Run the following command to query a model version whose model name is my-model and version number is 1:

    arena model get \
        --name my-model \
        --version 1

    Expected output:

    Name:                my-model
    Version:             1
    CreationTime:        2024-04-29T16:42:18+08:00
    LastUpdatedTime:     2024-04-29T16:42:18+08:00
    Source:              pvc://my-pvc/models/my-model/1
    Description:
      This is some description about my-model v1
    Tags:
      createdBy: arena
      key3: 
      key4: value4

List all registered models

Run the following command to list all registered models:

arena model list 

Update registered models or model versions

Run the following command to update a registered model named my-model:

arena model update \
    --name my-model \
    --description "This is some updated description" \
    --tags key1=updatedValue1,key2=updatedValue2 

Expected output:

INFO[0000] model version "my-model/1" updated 

To delete the tags of a model, append hyphens (-) to the tags. In the following example, the key1, key2=value2, key3, and key4=value4 tags are deleted:

arena model update \
    --name my-model \
    --tags key1-,key2=value2- \
    --version 1 \
    --version-tags key3-,key4=value4-

Delete registered models or model versions

Warning

Deleting a registered model also deletes all model versions associated with the model. Proceed with caution.

  • Delete registered models

    For example, you can run the following command to delete a registered model named my-model:

    arena model delete \
        --name my-model

    To prevent user errors, the system prompts you to confirm whether to delete the specified model when you run the preceding command. Enter yes or no to confirm.

    If you use automated scripts or you do not need to confirm the deletion operation, add --force to skip the confirmation step and directly delete the model. Example:

    arena model delete \
        --name my-model \
        --force
  • Delete model versions

    For example, you can run the following command to delete a model version whose model name is my-model and version number is 1:

    arena model delete \
        --name my-model \
        --version 1

    To prevent user errors, the system prompts you to confirm whether to delete the specified model version when you run the preceding command. Enter yes or no to confirm.

    If you use automated scripts or you do not need to confirm the deletion operation, add --force to skip the confirmation step and directly delete the model version. Example:

    arena model delete \
        --name my-model \
        --version 1 \
        --force