Edge Deployments#
In OctaiPipe there are several ways to deploy machine learning workloads to edge devices. This guide covers the standard edge deployment process using OctaiPipe’s built-in tools.
Before running an edge deployment, ensure that you have registered a device, following the guide for Device Registration.
Edge Deployments are a way for OctaiPipe users to deploy OctaiPipe pipeline steps to the edge. This is done using Docker containers that run a pipeline step together with a defined configuration file.
Configuring the Edge Deployment#
To configure an edge deployment, you will need to create a deployment config file. An example config YAML file is shown below:
1 name: deployment_config
2
3 device_ids: ["device_1", "device_2", "device_3", "device_4"] # list of edge device ids on which to deploy services
4
5 datasources:
6 environment: # common environment variables to be passed from edge device to all services specified below
7 - INFLUX_ORG
8 - INFLUX_URL
9 - INFLUX_TOKEN
10 - INFLUX_DEFAULT_BUCKET
11
12 grafana_deployment: edge # can be edge, cloud or kept empty if no Grafana instance is needed
13
14 env: {} # additional environment variables to be passed to all services
15
16 pipelines:
17 - preprocessing: # service_name, same as the container name
18 config_path: ./configs/preprocessing_inference.yml # must be inside ./configs on user machine
19 - model_inference: # service_name
20 config_path: ./configs/model_inference.yml
21 - data_drift:
22 config_path: ./configs/data_drift.yml
23 - local_custom_step1:
24 local_step_path: ./custom_steps/model_train_custom_step.py
25 config_path: ./test/deployments/configs/local_custom_step1.yml
26 - registered_custom_step1:
27 config_path: ./test/deployments/configs/registered_custom_step1.yml
28 version: 2 # optional version field for registered custom steps, leaving empty will get latest version
Running the Edge Deployment#
To run an edge deployment, use the deploy_to_edge function from the octaipipe.deployment module.
from octaipipe.deployment import deploy_to_edge
deployment_config_path: str = './path/to/deployment_config.yml'
deployment_name: str = 'My Edge Deployment'
deployment_description: str = 'This is my edge deployment description.'
deploy_to_edge(config_path=deployment_config_path,
name=deployment_name,
description=deployment_description)
Removing a deployment#
To remove an edge deployment from your registered devices, use the down_deployment function from the octaipipe.deployment module.
from octaipipe.deployment import down_deployment
deployment_id: str = 'your_deployment_id_here'
down_deployment(deployment_id=deployment_id)
Tracking deployments#
You can also track deployments and their containers from the Portal UI. Under the Deployments tab, you can find your deployment by ID, name or description (you can also filter by time or created by user).
From the specific deployment page you can see the status of the deployment along with any containers that have been created as part of the deployment. You can also view logs from each container and stop or remove containers from this page.