Updating a deployment

After you create an online or a batch deployment, you can still make changes in your deployment details and update the assets associated with your deployment.

Refer to these sections:

Updating deployment details

You can update general deployment details, such as deployment name, description, metadata and tags using one of these methods:

Updating deployment details from the UI

  1. From the Deployments tab of your deployment space, click the action menu for the deployment and choose Edit configuration.
  2. Make the required updates and then click Save.

Tip: You can also update a deployment from the information sheet for the deployment.

  1. Click the deployment name to view the details.
  2. Click one of the Edit icons in the information sheet to edit the deployment.


Updating a deployment configuration

Notes

If in the deployment details you see a warning next to the Deployment owner section, this means that the previous deployment owner left the space and the deployment must be assigned to a new owner. In this situation, only a space administrator can assign a new deployment owner. Refer to Collaborator permissions for spaces.

For details, refer to Updating deployment details using the Patch API command

Updating deployment details using the Patch API command

Use the Watson Machine Learning API Patch command to update deployment details.

curl -X PATCH '<deployment endpoint url>/ml/v4/deployments/<deployment id>?space_id=<space id>&version=<YYYY-MM-DD>' \n--data-raw '[
    {
        "op": "<operation type>",
        "path": "<path>",
        "value": "<new value>"
    },
    {
        "op": "<operation type>",
        "path": "<path>",
        "value": "<new value>"
    }
]'

For example, to update a description for deployment:

curl -X PATCH '<deployment endpoint url>/ml/v4/deployments/<deployment_id>?space_id=<space_id>&version=<YYYY-MM-DD>' \n--data-raw '[
    {
        "op": "replace",
        "path": "/description",
        "value": "<new_description>"
    },
]'

Notes:

Updating assets associated with a deployment

After you create an online or batch deployment, you can update the deployed asset from the same endpoint. For example, if you have a better performing model, you can replace the deployed model with the improved version. Once the update is complete, the new model will be available from the REST API endpoint.

Before you update an asset, make sure these conditions are true:

Caution: Failure to follow these conditions can result in a failed deployment.

Updating an asset from the deployment space

  1. From the Deployments tab of your deployment space, click the action menu for the deployment and choose Replace asset.
  2. Select the asset you want to replace and click Replace.
  3. Drag and drop or upload a new asset to replace the deployed asset.
  4. Wait for the notification message that confirms a successful update, then test the new deployment.


Replacing a deployed asset

You can import a space or a project, including data assets, into an existing space. This way you can update existing assets. Refer to Importing spaces and projects into existing deployment spaces.

Updating an asset using the Patch API command

Use the Watson Machine Learning API Patch command to update any supported asset, except for RShiny apps.

Use this method to patch a model for an online deployment.

curl -X PATCH '<deployment endpoint url>/ml/v4/models/<model_id>?space_id=<space_id>&project_id=<project_id>&version=<YYYY-MM-DD>' \n--data-raw '[
    {
        "op": "<operation type>",
        "path": "<path>",
        "value": "<new value>"
    },
    {
        "op": "<operation type>",
        "path": "<path>",
        "value": "<new value>"
    }
]'

For example, patch a model with id 6f01d512-fe0f-41cd-9a52-1e200c525c84 in space id f2ddb8ce-7b10-4846-9ab0-62454a449802:

curl -X PATCH '<deployment endpoint url>/ml/v4/models/6f01d512-fe0f-41cd-9a52-1e200c525c84?space_id=f2ddb8ce-7b10-4846-9ab0-62454a449802&project_id=<project_id>&version=<YYYY-MM-DD>' \n--data-raw '[

   {
      "op":"replace",
      "path":"/asset",
      "value":{
         "id":"6f01d512-fe0f-41cd-9a52-1e200c525c84",
         "rev":"1"
      }
   }
]'

A successful output response will look like this:

{
  "entity": {
    "asset": {
      "href": "/v4/models/6f01d512-fe0f-41cd-9a52-1e200c525c84?space_id=f2ddb8ce-7b10-4846-9ab0-62454a449802",
      "id": "6f01d512-fe0f-41cd-9a52-1e200c525c84"
    },
    "custom": {
    },
    "description": "Test V4 deployments",
    "name": "test_v4_dep_online_space_hardware_spec",
    "online": {
    },
    "space": {
      "href": "/v4/spaces/f2ddb8ce-7b10-4846-9ab0-62454a449802",
      "id": "f2ddb8ce-7b10-4846-9ab0-62454a449802"
    },
    "space_id": "f2ddb8ce-7b10-4846-9ab0-62454a449802",
    "status": {
      "online_url": {
        "url": "https://example.com/v4/deployments/349dc1f7-9452-491b-8aa4-0777f784bd83/predictions"
      },
      "state": "updating"
    }
  },
  "metadata": {
    "created_at": "2020-06-08T16:51:08.315Z",
    "description": "Test V4 deployments",
    "guid": "349dc1f7-9452-491b-8aa4-0777f784bd83",
    "href": "/v4/deployments/349dc1f7-9452-491b-8aa4-0777f784bd83",
    "id": "349dc1f7-9452-491b-8aa4-0777f784bd83",
    "modified_at": "2020-06-08T16:55:28.348Z",
    "name": "test_v4_dep_online_space_hardware_spec",
    "parent": {
      "href": ""
    },
    "space_id": "f2ddb8ce-7b10-4846-9ab0-62454a449802"
  }
}

Notes:

Parent topic: Managing deployments