Model deployment (Decision Optimization)

To deploy a model, create a model ready for deployment in your deployment space and then upload your model as an archive. Once deployed you can submit jobs to your model and monitor job states.

Before you begin

First create a deployment space in Watson Machine Learning.

About this task

These instructions assume that you have already built your Decision Optimization model.

Procedure

To deploy a Decision Optimization model:

  1. Package your Decision Optimization model with your common data (optional) ready for deployment as a tar.gz or .zip file.
    Your archive can include the following optional files:
    1. Your model files
    2. Settings (see Solve parameters for more information)
    3. Common data
    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.
  2. Create a model ready for deployment in Watson Machine Learning providing the following information:
    • the hardware specification for the available configuration sizes (small S, medium M, large L, extra large XL). See configurations.
    • the software specification (Decision Optimization runtime version):
      • do_22.1 runtime is based on CPLEX 22.1
      • do_20.1 runtime is based on CPLEX 20.1

      You can extend the software specification provided by Watson Machine Learning. See the ExtendWMLSoftwareSpec notebook in the jupyter folder of the DO-samples. Select the relevant product and version subfolder.

      Updating CPLEX runtimes
      Important:

      If you have already deployed your model with a CPLEX runtime that is no longer supported, you can update your existing deployed model using either the REST API or the UI.

    • 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 or 3.9 (deprecated)

      (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.)

  3. Upload your model archive (tar.gz or .zip file) on Watson Machine Learning. See Model input and output data file formats (Decision Optimization) for information about input file types.
    You obtain a model-URL. Your Watson Machine Learning model can then be used in one or multiple deployments.
  4. Deploy your model using the model-URL and specify the number of nodes to be used (the default value is 1).
    You obtain a deployment-id.
  5. Monitor the deployment using the deployment-id. Deployment states can be: initializing, updating, ready, or failed.

Example

See the Deploying a DO model with WML sample for an example of how to deploy aDecision Optimization model, create and monitor jobs, and get solutions 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 as well as the RunDeployedModel and ExtendWMLSoftwareSpec notebooks are located in the jupyter folder of the DO-samples. Select the relevant product and version subfolder. Once downloaded, you can add these Jupyter notebooks to your project.

See also the REST API example (Decision Optimization) example.