Remote environment workflow overview¶
To use the MLOps agent with a remote deployment environment, you must provide:
The URL of DataRobot MLOps.
An API token from DataRobot. You can do this through the UI by going to the Developer Tools tab under account settings and finding the API Keys section.
MLOps agent and prediction reporting setup¶
The following sections outline how to configure both the machine using the MLOps agent to upload data, and the machine using the MLOps library to report predictions.
MLOps agent configuration¶
Complete the following workflow for each machine using the MLOps agent to upload data to DataRobot MLOps. This setup only needs to be performed once for each deployment environment.
- Ensure that Java (version 8) is installed.
- Download the MLOps agent tarball, available through the Developer Tools tab. The tarball includes the agent and library software, example code, and associated scripts.
- Change the directory to the unpacked directory.
- Install the MLOps agent.
- Configure the MLOps agent.
- Run the agent service.
For each machine using the MLOps library to report predictions, ensure that appropriate libraries and requirements are installed. There are two locations where you can obtain the libraries:
Download the MLOps agent tarball and install the libraries:
Java: The Java library is included in the .tar file in
Python: The Python version of the library is included in the .tar file in
lib\datarobot_mlops-*-py2.py3-none-any.whl. This works for both Python2 and Python3. You can install it using:
pip install lib\datarobot_mlops-*-py2.py3-none-any.whl
.tar file includes several end-to-end examples in various languages.
Create and deploy a model package¶
A model package stores metadata about your external model: the problem type (e.g., regression), the training data used, and more. You can create a model package using the Model Registry and deploy it.
In the deployment's Integrations tab, you can view example code as well as the values for the
MLOPS_MODEL_ID that are necessary to report statistics from your deployment.
If you wish to instead create a model package with the API, use the helper scripts for creating model packages and deployments in the examples directory. Every example has its own script to create the related model package and deployment in a
create_deployment.sh script. This script interacts with DataRobot MLOps directly and so must be run on a machine with connectivity to it. When run, it returns a deployment ID and model ID that you will need to instrument your deployment.
Instrument deployments with the MLOps agent¶
To instrument the MLOps agent with each deployment:
- Locate the MLOps library and sample code. These are included within the MLOps .tar file distribution.
- Configure the deployment ID and model ID in your environment.
- Instrument your code with MLOps calls as shown in the sample code provided for your programming language.
- To report results to DataRobot MLOps, you must configure the library to use the same channel as is configured in the agent. For testing, you can configure the library to output to stdout though these calls will not be forwarded to the agent or DataRobot MLOps. Configure the library via the :ref:
mlops API <mlops-lib>.
- You can view your deployment in the DataRobot MLOps UI under the Deployments tab.