To deploy a Decision Optimization model, create a model ready for deployment in your deployment space and then upload your model as an archive. When deployed, you can submit jobs to your model and monitor job states.
Before you begin
- Log in to IBM Cloud.
- Create your API key. Copy or download it from the API key successfully created open window (you cannot access it again when you close this window).
- Create or select a Machine Learning service. Copy the service instance name, GUID, and CRN from the information pane for your instance in the Resource List>Services view on IBM Cloud. (Expand the list of services in the Resource List window. Click anywhere in the row next to your Machine Learning Service name, but not on the name itself. The information pane then opens in the same window.)
- Create or select a Cloud Object Storage. Copy the Cloud Object Storage instance name and CRN from the information pane for your instance in the Resource List>Storage view on IBM Cloud.
- Create a deployment space, from the user interface. Then view it and copy your Space ID from the settings tab. For more information, see Deployment spaces.
About this task
These instructions assume that you have already built your Decision Optimization model.
To deploy a Decision Optimization model:
- Package your Decision
Optimization model formulation with your common data
(optional) ready for deployment as a
.jarfile.Your archive can include the following optional files:
Note: For Python models with multiple .py files, put all files in the same folder in your archive. The same folder must contain a main file called main.py. Do not use subfolders.
- Your model files
- Settings (For more information, see Solve parameters )
- Common data
Create a model ready for deployment in Watson Machine Learning
providing the following information:
You obtain a MODEL-ID. Your Watson Machine Learning model can then be used in one or multiple deployments.
- Machine Learning service instance
- Deployment space instance
- Software specification (Decision
- do_22.1 runtime is based on CPLEX 184.108.40.206
- do_20.1 runtime is based on CPLEX 220.127.116.11
- The model type:
- opl (do-opl_<runtime version>)
- cplex (do-cplex_<runtime version>)
- cpo (do-cpo_<runtime version>)
- docplex (do-docplex_<runtime version>) using Python 3.10
(The Runtime version can be one of the available runtimes so, for example, an opl model with runtime 22.1 would have the model type do-opl_22.1.)
- Upload your model archive (
.jarfile) on Watson Machine Learning. See Model input and output data file formats for information about input file types.
- Deploy your model by using the MODEL-ID, SPACE-ID, and the hardware
specification for the available configuration sizes (small S, medium M, large L, extra large
XL). See configurations. You obtain a DEPLOYMENT-ID.
- Monitor the deployment by using the DEPLOYMENT-ID. Deployment states can
- Submit jobs to your deployment. You obtain a JOB-ID.
- Monitor your jobs by using the JOB-ID.
See the Deploying a DO model with WML sample for an example of how to deploy a Decision Optimization model, create and monitor jobs, and get solutions by using the Watson Machine Learning Python Client. This notebook uses the diet sample for the Decision Optimization model and takes you through the whole procedure without using the Decision Optimization experiment UI. This sample and the RunDeployedModel and ExtendWMLSoftwareSpec notebooks are located in the jupyter folder of the DO-samples. Select the relevant product and version subfolder. When downloaded, you can add these Jupyter notebooks to your project.
See also the REST API example example.