Managing deployment of asset versions

Learn how to manage versions of models, scripts, and functions in your deployment space.

Creating versions

Currently, you can create versions of a model, script, or function programmatically, by using the Data and AI Common Core API, the watsonx.ai Python client library, or the cpd-cli command-line interface tool.

For example, by using REST API calls:

  • To create a version, use:

    POST /v2/assets/<asset_id>/revisions
    
  • To reference the current state of an asset, use:

    GET /v2/assets/<asset_id>
    
  • To reference a specific version of an asset:

    GET /v2/assets/<asset_id>/revision_id=<rev_id>
    

Using versions in a deployment space

In a space, versions you create programmatically can be used when you:

  • Deploy a model, script, or function
  • Update your deployment

For example, you can create a deployment by using a version that uses a specific hardware or software configuration. Then, you can update the deployment with a version that uses a different configuration seamlessly, without stopping the deployment.

Viewing version information in a deployment space

If an asset has versions, you can view information about the versions from the asset detail page.

  1. From the Assets tab of the project or space, click the name of the model, script, or function to access the details.
  2. Click the VersionsPicture of versions icon icon to access version-related information.

Viewing versions in a project

Promoting an asset version from a project to a deployment space

When you promote a version of an asset to a space, the version information is not preserved. That is, if you promote Version B of Asset A to a space, the space shows Asset A and that is the current and only version available. However, if you have access to the project that contains the promoted asset, you can view information about the versions from the asset information page.

Viewing version detail in a space

In space, you can create new versions programmatically, in the same way that you create them in a project.

Viewing version information in a deployment space

You can view your deployment version information by going to the Assets tab in your deployment space. The badge indicates that your deployed asset has versions available.

Asset version in a deployment space

Deploying a version of an asset

When you create a deployment of an asset, the default asset is the current, most recent version. You can optionally choose a different version to deploy.

To deploy your asset with a different version, follow these steps:

  1. Go to the Assets tab in your deployment space.
  2. Click the action menu Menu icon icon and choose Deploy.
  3. In the dialog box, choose the version that you want to deploy in the Version field.
  4. Enter the details and click Create.

Creating deployment versions

Updating a deployment with a different version

When you update a deployment, you can choose a different version of the model, script, or function to replace the deployed asset.

To update your deployment with a different version, follow these steps:

  1. Go to the Deployments tab in your deployment space.
  2. Click the action menu Menu icon icon and choose Edit.
  3. In the Edit deployment dialog box, select the version with which you want to update your deployment and click Replace asset.
  4. Click Save.

Updating a deployment with a new version

Parent topic: Assets in deployment spaces