Local Agent
The RI Platform Agent can be installed on a local Kubernetes cluster using Kind or Minikube.
Reasons to Use a Local Agent
The local agent runs on your machine. You do not need access to a Kubernetes cluster running on your organization’s cloud.
Running locally also gives you full access and observability into the running tests for easy debugging and insight into resource usage.
The local agent can use data and model files from your local file system. You do not need to upload the data to cloud storage or grant the agent permissions to read from cloud storage.
Setting up your Local Cluster
Prerequisites
Directory on your local file system that will contain all the model and data files you wish to use with your local agent. You can put more files into this directory at any time, but you must decide on the path of the directory before installing the agent. For example:
/Users/name/Documents/my-data-directory
.-
Agent deployment requires docker to have access to 8GB+ of memory. This can be set via Docker Desktop in Preferences > Resources > Advanced > Memory.
Include the absolute path of the directory containing the data and model files you intend to use with the local agent in Docker’s File Sharing. This can be set via Docker Desktop in Preferences > Resources > File Sharing.
The local agent can run on any K8s cluster. We recommend using Kind or Minikube for simplicity and easy mounting of your local files to the virtual nodes.
Kind
Install Kind.
Create a configuration file for your Kind cluster that mounts the directory containing your data and models to
/ri-platform/local/
on the virtual nodes.
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: <ABSOLUTE PATH ON LOCAL FILESYSTEM>
containerPath: /ri-platform/local
With docker running, create the cluster:
kind create cluster --config <above config file>
Ensure your
kubectl
context is set to the cluster you created:kubectl config use-context kind
Follow the steps in Deployment to deploy an agent onto your Kind cluster.
Minikube
Install Minikube
With docker running, create the cluster:
minikube start
Ensure your
kubectl
context is set to the cluster you created:kubectl config use-context minikube
In a separate terminal, use a 9P mount to mount the directory containing your data and models to
/ri-platform/local
on the virtual nodes.minikube mount <ABSOLUTE PATH ON LOCAL FILESYSTEM>:/ri-platform/local
This will create a long running process that must be kept alive in order for the mount to work properly.
Follow the steps in Deployment to deploy an agent onto your Minikube cluster.
Using your Local Agent
When specifying paths to data or model files in test run configurations, replace the path to the directory on your local filesystem that you mounted with /ri-platform/local
.
For example, if you mounted /Users/name/Documents/my-data-directory
, and that directory contains:
data/
ref.csv
eval.csv
model.py
You would specify those files in a test configuration as:
config = {
"data_info": {
"ref_path": "/ri-platform/local/data/ref.csv",
"eval_path": "/ri-platform/local/data/eval.csv",
...
},
"model_info": {
"path": "/ri-platform/local/model.py"
},
...
}