Deployment Spaces

AlainChabrier
4 min readOct 14, 2020

--

Some hints after the introduction of deployment spaces in Decision Optimization for Watson Machine Learning.

As mentioned in my previous post on final WML v4 APIs, among other changes, new deployment spaces have been introduced.

What are deployment spaces?

Spaces are to assets deployed in WML what projects are to assets developed in Watson Studio (WS). They are containers used to group together different related assets.

Spaces are created on a Cloud Object Storage (COS) instance so that its content can be persisted.

Spaces can be associated a WML instance in case some assets have to be deployed or run (e.g. models).

Spaces support access control, and from the UI, you can easily specify who can read or write in a given deployment space.

Creating spaces

From the user Interface

You can create spaces from the WS UI. From the dashboard page, you can see your recently used deployment spaces both in the main area and in the left hand side menu.

Access recent spaces in the Left hand Side menu.

From the complete list, you can create a new deployment space.

Creation requires a COS instance, and (optionally) a WML instance.

Note that in the above screen, the selection of COS and WML instances might be impacted by the Service Location Filters set for your profile. If the instance you are looking for does not appear, you might want to go and look at them here: https://dataplatform.cloud.ibm.com/settings/profile?context=cpdaas and check the filters include the location you need.

Service Location Filters are important to select COS and WML instances.

From Python

You can also create a space from Python. You will need the CRN (Cloud Resource Name) for your COS and WML instances. You can get those from your IBM Cloud dashboard.

space_name = '-sample'
cos_resource_crn = '<COS_crn>'
instance_crn = '<instance_crn>'

metadata = {
client.spaces.ConfigurationMetaNames.NAME: 'space' + space_name,
client.spaces.ConfigurationMetaNames.DESCRIPTION: space_name + ' description',
client.spaces.ConfigurationMetaNames.STORAGE: {
"type": "bmcos_object_storage",
"resource_crn": cos_resource_crn
},
client.spaces.ConfigurationMetaNames.COMPUTE: {
"name": "existing_instance_id",
"crn": instance_crn
}
}
space = client.spaces.store(meta_props=metadata)
space_id = client.spaces.get_id(space)
print(space_id)

You can look at the complete notebook example from the gallery.

From the REST APIs

Finally, you can also do all this using spaces REST APIs (see https://cpd-spaces-api.eu-gb.cf.appdomain.cloud/#/Spaces/spaces_create). In the payload of this API you will also need the CRN for the WML and COS instance.

Using Spaces

You can access spaces using the user interface through one of the paths highlighted above.

Browsing content

You will see several tabs for assets(data or models), deployments and jobs.

For example, the space can contain DO models with their type and their software specifications, as below.

Example of deployment space

To add assets to a space, you can drop them in the above UI, or promote them from a WS project.

Deploying models and creating jobs

From the promoted models in a deployment space, you can use this UI to create a deployment and then create jobs.

Deploying a model

The creation screen allows to set the hardware specifications such as the T-Shirt size and the number of nodes.

Deployment creation

You can then create a job from the deployment screen.

Creating a job

The job creation screen you can choose data assets from the deployment space to be used as input and/or output.

Job creation
Selecting assets to use

Let’s mention that jobs created in the UI are platform jobs which can be executed several times, each execution referred as a platform runs. These runs are what correspond to the deployment jobs that can be created form the WML v4 API.

Conclusion

Introduction of deployment sapce and corresponding User Interface has been a significant improvement in the support of DO in WS and WML. Now, the full end to end usage flow (from model development to deployed model execution monitoring) can be done form the User Interface.

https://twitter.com/AlainChabrier

--

--

AlainChabrier

Former Decision Optimization Senior Technical Staff Member at IBM Opinions are my own and I do not work for any company anymore.