Skip to main content
Version: 2.0.0

Edge Agent Setup

In this section we provide an example configuration of a Tributech Edge Agent services running on Docker / Docker Compose runtime. We also provide a fully automated setup for Azure.

To manage and handle Docker services of the Tributech Edge Agent (e.g. start/stop services, check logs of service) we provide some sample Docker-Compose commands.

Prerequisite

Recent Linux based system meeting our requirements, e.g. our automated setup creates an Ubuntu 20.04 based Linux virtual machine on Azure. To access the client secrets and some other information required in the next steps we require Api Keys.

Docker

Install Docker based on the desired option from the official Docker documentation. e.g. for Ubuntu using the Official Docker Repository. Optional: Allow to manage Docker as non-root user.

sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Docker-Compose

We recommend the installation of docker-compose via package manager (e.g. Ubuntu apt-get):

sudo apt-get install docker-compose

Setup the Tributech Edge Agent

The following steps describe the tasks required to get the main Edge services (Tributech-agent and mosquitto-server) up and running on a system.

Accessing the private Docker Registry

In order to allow retrieval of Tributech Edge Docker images we need to login to the private Docker Registry using the Client ID and Client Secret from the "Docker Registry Token (DSK Edge)" area.

echo <Client Secret> | docker login --username <Client ID> --password-stdin tributech.azurecr.io

Configure the Agent Environment

Copy and adapt the .env environment configuration file. The "LOKI_PROMTAIL_PW" can be retrieved from the Promtail (Loki push API)" password field in the DataSpace-Admin API Keys area. See the automated setup for detailed parameter description and Docker for general information about the .env file.

.env
AGENT_TAG=2.1.1
SOURCE_TAG=2.1.0
AGENT_ID=305ed1ad-46e0-4b1b-85c4-aa0268e612db
AGENT_NAME=dev-agent-a1
NODE_NAME=dev-node-a
HUB_NAME=dev
LOKI_PROMTAIL_PW=<YourSecurePassword123!>

Configure Docker Compose

Copy the docker-compose.yml file into the folder containing the .env configuration file.

docker-compose.yml
version: "3.3"

services:
# DSK agent
dsk-agent:
image: ${DOCKER_REGISTRY-tributech.azurecr.io/}dsk-agent:${AGENT_TAG:-latest}
depends_on:
- mosquitto-server
environment:
- Logging__LogLevel__Default=Information
- MqttOptions__MQTTHost=mosquitto-server
# general DSK edge agent configuration
- EdgeDeviceOptions__AgentID=${AGENT_ID:?"The variable AGENT_ID needs to be configured in the .env file."}
- EdgeDeviceOptions__ValueSink=Cloud
# push logs to Loki at server via promtail
- TelemetryOptions__LokiUrl=https://promtail-push.${NODE_NAME:?"The variable NODE_NAME needs to be configured in the .env file."}.dataspace-node.com
- TelemetryOptions__LokiUser=tributech
- TelemetryOptions__LokiPassword=${LOKI_PROMTAIL_PW:?"The variable LOKI_PROMTAIL_PW needs to be configured in the .env file."}
- TelemetryOptions__ServiceName=${AGENT_NAME:?"The variable AGENT_NAME needs to be configured in the .env file."}
- TelemetryOptions__ServiceId=${AGENT_ID:?"The variable AGENT_ID needs to be configured in the .env file."}
networks:
- edge-net
ports:
- "5000:80" # enable access to agent REST-API (e.g. for configuration with Agent-Companion)
volumes:
- ./volumes/dsk-agent/:/app/data # volume mapping for permanent storage of keys and datatwin file
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"

# MQTT broker/server
mosquitto-server:
image: eclipse-mosquitto:1.6
networks:
- edge-net
# Expose ports for development and testing purposes
#ports:
# - "127.0.0.1:1883:1883" # MQTT
# - "127.0.0.1:9001:9001" # web-socket
volumes:
- mosquitto_config:/mosquitto/config
- mosquitto_data:/mosquitto/data
- mosquitto_log:/mosquitto/log
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "2m"
max-file: "5"

networks:
edge-net:

volumes:
mosquitto_config:
mosquitto_data:
mosquitto_log:

Run Edge services

Startup the Tributech Edge services (will automatically retrieve the Docker images, if not check the Docker authentication). To check the status or shutdown the services revisit Docker management commands.

docker-compose up -d

You can now continue to link and configure the Tributech Edge Agent to a Tributech Node with the help of the Tributech Agent Companion. In Order to send data to the Tributech Node a Source must be connected to the agent.