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 Watson Data 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.
- From the Assets tab of the project or space, click the name of the model, script, or function to access the details.
- Click the Versions icon to access version-related information.
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.
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.
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:
- Go to the Assets tab in your deployment space.
- Click the action menu icon and choose Deploy.
- In the dialog box, choose the version that you want to deploy in the Version field.
- Enter the details and click Create.
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:
- Go to the Deployments tab in your deployment space.
- Click the action menu icon and choose Edit.
- In the Edit deployment dialog box, select the version with which you want to update your deployment and click Replace asset.
- Click Save.
Parent topic: Assets in deployment spaces