Use the Arena CLI to create, query, update, and delete models in MLflow Model Registry from the command line.
Background
MLflow is an open source machine learning lifecycle management platform for tracking model training, managing models, and deploying models. For more information about MLflow Model Registry, see MLflow Model Registry.
Prerequisites
Before you begin, ensure that you have:
-
An ACK Pro cluster running Kubernetes 1.20 or later. For more information, see Create an ACK Pro cluster.
-
A Resource Access Management (RAM) user created in the RAM console and associated with a quota group. For more information, see Create a RAM user and Step 1: Create a quota group for the RAM user.
-
The MLflow component deployed in the
kube-ainamespace of the ACK cluster. For more information, see Configure MLflow Model Registry. -
The Arena client configured with Arena 0.9.14 or later. For more information, see Configure the Arena client.
Add a model version
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 a registered model
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 a model version
Run the following command to query version 1 of my-model:
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 the description and tags of 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 tags, append a hyphen (-) to each tag key or key-value pair. The following command deletes key1 and key2 from my-model, and deletes key3 and key4 from version 1:
arena model update \
--name my-model \
--tags key1-,key2=value2- \
--version 1 \
--version-tags key3-,key4=value4-
This removes the key1 and key2 tags from the registered model my-model, and removes the key3 and key4 tags from version 1.
Delete registered models or model versions
Deleting a registered model also deletes all model versions associated with it. Proceed with caution.
All delete commands prompt for confirmation before executing. Enter yes to confirm or no to cancel.
Delete a registered model
Run the following command to delete my-model:
arena model delete \
--name my-model
To skip the confirmation prompt—for example, in automated scripts—add --force:
arena model delete \
--name my-model \
--force
Delete a model version
Run the following command to delete version 1 of my-model:
arena model delete \
--name my-model \
--version 1
To skip the confirmation prompt, add --force:
arena model delete \
--name my-model \
--version 1 \
--force
What's next
For the full Arena model command reference, see Model manage guide.