This guide explains how to setup, configure, and run the device-agent binary.
The device-agent is responsible for managing and executing workloads on a device. It applies configurations and runs workloads based on the provided setup.
This guide specifically covers the device-agent binary.
The binary requires:
- Configuration file (
config.yaml) - Certificates
Ensure the following before proceeding:
- Required certificates are available
- Ensure the required backend service (e.g., WFM, if used) is running
- Observability stack should be available as part of the Margo ecosystem (e.g., OTEL Collector, Grafana, Jaeger, Prometheus, etc.)
👉 Note: Device-agent is not strictly dependent on the observability stack, but skipping it may result in non-compliance with Margo device requirements.
The device-agent is lightweight and can run on low-resource systems.
Approximate runtime footprint:
- CPU: ~1–2 vCPU
- Memory: ~200–500 MB
- Disk: ~500 MB
👉 Note: These values are recommended for running the device-agent in a stable environment.
If other components (e.g., WFM) are running on the same machine, additional resources should be allocated accordingly.
mkdir -p $HOME/certs
cd $HOME/certs
openssl genrsa -out device-private.key 2048
openssl req -new -x509 \
-key device-private.key \
-out device-public.crt \
-days 365 \
-subj "/C=IN/ST=GGN/L=Sector 48/O=Margo/CN=margo-device"mkdir -p $HOME/certs
cd $HOME/certs
openssl ecparam -genkey -name prime256v1 -out device-ecdsa.key
openssl req -new -x509 \
-key device-ecdsa.key \
-out device-ecdsa.crt \
-days 365 \
-subj "/C=IN/ST=GGN/L=Sector 48/O=Margo/CN=margo-device"cp <path-to-wfm-cert>/ca-cert.pem ./config && \
cp <path-to-your-device-certs>/* ./configThe device-agent uses a config.yaml file to define its runtime behavior.
This file typically includes:
- Certificate paths
- Runtime configuration (Docker / Kubernetes)
- Connection or service settings
👉 Before running the binary, review the default configuration and update values based on your environment.
Ensure:
- Certificate paths are correct
- Required runtime is properly configured
./device-agent --config config/config.yamlps -ef | grep device-agentExample output:
root 7978 ... ./device-agent -config /config/config.yaml
👉 If the process is visible, it confirms that the device-agent is running.
- Generate certificates (if required)
- Copy certificates to
config/ - Configure
config.yaml - Run the binary
- Verify using process or logs
- Ensure correct paths in
config.yaml - Missing certificates will cause startup failure
- Verify certificates before running
- Use logs for debugging issues