Deployment spaces (Watson Machine Learning)
You can use deployment spaces to deploy models and manage your deployments.
Deployment spaces allow you to create deployments for machine learning models and functions and view and manage all of the activity and assets for the deployments, including data connections, data refinery flows, and connected data assets. You can:
- View deployed assets
- Create a deployment space
- Promote assets to a space
- Import a PMML model to a space
- Create deployments
- Export a deployment space
You configure and manage the deployment of a set of related assets in a space. A space contains an overview of deployment status, the deployable assets, deployments, associated input and output data, and the associated environments.
To view the deployment space associated with a project, open the Settings page for the project and view the associated deployment space. Click the space name to open it and view details. To view all deployment spaces that you can access, click Deployments on the navigation menu.
Creating a deployment space
A deployment space does not need to be associated with a project. You can deploy assets from multiple projects to a space. For example, you might have a test space for evaluating deployments, and a production space for deployments you want to deploy in business applications.
- In the navigation menu, click Deployments.
- Click New deployment space
- Choose whether to create a new space or import an existing one.
- Choose Create an empty space to create a new space.
- Choose Create a space from a file to import a space that was saved as a .zip file. You can add the file from your file system. Note: If you get an error importing a space file, try clearing your browser cookies then try again.
- Enter the details for the space, then click Create.
View details about the space, including the space ID, from the Settings tab.
Promoting assets to a deployment space
The following assets can be promoted to a deployment space:
- Saved models
- Data assets for use in model deployments
- Data refinery flows and dependent assets
- Connections defined in your project
- Shiny apps
Promote or add assets to a deployment space in the following ways:
- To upload or add an asset: from the deployment space, choose Add to space and choose an asset type, such as data or a machine learning model. Follow the prompt.
- To promote an asset to a deployment space: in the project Assets page, from the action menu for the asset, choose Promote.
Note: Promoting assets and their dependents from a project to a space using the Watson Studio user interface is the recommended method for guaranteeing that the promotion flow results in a complete asset definition. For example, relying on the Catalog Assets Management Service (CAMS) API to manage promotion flow of a Watson Machine Learning asset with dependencies from a project to a space can result in the promoted asset being inaccessible from the space.
For details on adding data to a space, see Adding data sources to a space.
Importing a model into the space
If you have a trained model saved in Predictive Model Markup Language (PMML) format in an .xml file, you can import that model directly into a deployment space and create a deployment for the model.
- From the Assets tab of your deployment space, click Add to space and choose Model from file.
- In the Import model dialog that displays, enter a name and optional description for the model.
- Drop or upload the PMML file in the Model content box, then click Import.
- Create a deployment for the model.
Notes and restrictions
- Online is the only supported deployment type for PMML models.
- PMML models cannot be used in an SPSS stream flow.
- The PMML file must not contain a prolog. Depending on the library you are using when you save your model, a prolog might be added to the top of the file by default. For example, if your file contains a prolog string such as
spark-mllib-lr-model-pmml.xml, remove the string before you import the PMML file to the deployment space.
Creating a new deployment
When you promote a model to a space, components required for a successful deployment, such as a training library, model definition, or pipeline definition are automatically promoted as well. After promoting a model and data assets to a deployment space, you can create a deployment in the space.
- Click the name of the saved model in the deployment space.
- Click the Deployments tab.
- Click Create deployment to create a deployment.
- Choose the deployment type and fill out the specifics for the deployment. For details, see deploying from a space.
Notes and restrictions
Deploying a script to run on a Hadoop environment is not currently supported.
Exporting a deployment space
You can export a deployment space so that you can share the space with others or reuse the assets in another space.
To export a space:
- From the space, click the export space () icon.
Click New export file, specify a file name and optional description.
- Click Create to create the export file.
- Click Download to save the file.
You can reuse this space by choosing Create a space from a file when you create a new space.
Sample notebook for exporting and importing a space
To see an example of how to export and import a deployment space using the Watson Machine Learning Python client, view or download this sample notebook.