Remote environment workflow overview¶
To use the monitoring agent with a remote deployment environment, you must provide:
-
The URL of DataRobot MLOps.
-
An API key from DataRobot. You can configure this through the UI by going to the Developer Tools tab under account settings and finding the API Keys section.
Additionally, reference the documentation for creating and deploying a model package.
Monitoring agent and prediction reporting setup¶
The following sections outline how to configure both the machine using the monitoring agent to upload data, and the machine using the MLOps library to report predictions.
Monitoring agent configuration¶
Complete the following workflow for each machine using the monitoring 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 monitoring agent and library software, example code, and associated scripts.
- Change the directory to the unpacked directory.
- Install the monitoring agent.
- Configure the monitoring agent.
- Run the agent service.
Host predictions¶
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
lib/datarobot-mlops-<version>.jar
. -
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
Download the MLOps Python libraries from the Python Package Index site:
-
DataRobot MLOps metrics reporting library
- Download and then install:
pip install datarobot-mlops
- Download and then install:
-
DataRobot MLOps Connected client (mlops-cli)
- Download and then install:
pip install datarobot-mlops-connected-client
- Download and then install:
The MLOps agent .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_DEPLOYMENT_ID
and MLOPS_MODEL_ID
that are necessary to report statistics from your deployment.
If you wish to instead create a model package using the API, you can follow the pattern used in the helper scripts in the examples directory for creating model packages and deployments. Each example has its own create_deployment.sh
script to create the related model package and deployment. This script interacts with DataRobot MLOps directly and so must be run on a machine with connectivity to it. When run, each script outputs a deployment ID and model ID that are then used by the run_example.sh
script, in which the model inference and subsequent metrics reporting actually happens.
Instrument deployments with the monitoring agent¶
To configure the monitoring 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.