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 all deployment spaces that you can access, click View all spaces in the Deployment spaces section of the Watson Studio 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.
To create a space:
- Click Deployments ->View all spaces on the navigation menu.
- 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. Tip: If you get an error importing a space file, try clearing your browser cookies then try again.
- Choose Create a space from a sample or file to start from a sample space or import a space that was saved as a .zip file. You can add the file from your file system.
- Choose a Cloud Object Storage (COS) repository. All of the COS repositories associated with your IBM Cloud account are listed. If you do not have any repositories you are prompted to create one before proceeding.
- Choose a Machine Learning service instance. All valid instances associated with your IBM Cloud account are listed. If you do not have one, you can create the space, but you will have to create a service instance before you can create a deployment. For details on machine learning service instances, see Creating a Watson Machine Learning Service instance.
- Click Create.
Tip: to view any of the details about the space after you create it, such as the associated service instance or storage ID, click 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 deployments
- Connections defined in your project
- Connected data
Promote or add assets to a deployment space in the following ways:
- From the space, choose Add to space and choose an asset type, such as data or machine learning model. Follow the prompt to upload or add the asset.
From the project Assets page, choose Promote from the action menu for the asset to promote it to a deployment space.
- From the project, click the model name to open the model details page, then click Promote to deployment space. You can choose an existing space or create a new one. You can also add tags to help identify the promoted asset, and choose dependent assets to promote at the same time.
- Using the Python client, save an asset to a deployment space.
- Promote the data assets you need for deployments from the project or upload the data asset from the space.
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.
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.
- Select the assets you want to export with the space.
- 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.