Skip to main content
Version: 1.10.0

Docker Compose Setup

The simply get started with the DSK Edge Agent services using the Docker / Docker Compose runtime we provide a fully automated option which deploys a Linux virtual machine on Azure with everything pre-installed/configured and the Tributech DSK Edge services up and running. For the manual setup on your device and Docker runtime we provide according instructions and sample files.

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

Automated setup

Use the "Deploy to Azure" button directly below to create a Linux virtual machine on Azure with everything pre-installed/configured and the Tributech DSK Edge services up and running. Preview the Azure resources that will be created with the "Visualize" button.
Deploy to Azure Visualize

  • Select desired Azure Subscription/Resource Group/Region and define the name for the Agent related Azure resources (VM, Network security group,...). The Agent name must be unique within your Resource Group. Agent deployment - Provide basic data

  • Define virtual machine Size and authentication related properties.
    The Size needs to meet our Hardware Requirements. We recommend e.g. Standard_B1ms or Standard_DS1_v2.
    SSH access allows to connect to the VM for management purposes and to support SSH tunneling/port forwarding used for connections to the DSK Agent from the Agent Companion (see Connect to Edge Agent).
    Agent deployment - Provide VM data

  • Provide DSK related configuration:

    • To access the client secrets and some other information required in the next steps:
      • Login to the DataspaceAdmin
      • Click on your account (top right) and than Administration API Keys - 1
      • Go to API Keys API Keys - 2
    • DSK Agent id: globally unique identifier (UUID) for the Agent
    • DSK Hub name: The name of the DSK Hub to which your DSK Node is connected.
      (e.g. your-hub for your-hub.dataspace-hub.com)
      note

      On our Playground Ecosystem this is play for play.dataspace-hub.com.

    • DSK Node name: The name of your DSK Node to which the DSK Agent will be linked.
      (e.g. your-node for your-node.dataspace-node.com)
    • Data-API client secret: The client secret for the authentication at the Data-API of the DSK Node.
    • Trust-API client secret: The client secret for the authentication at the Trust-API of the DSK Node.
    • Docker Registry Token (DSK Edge) name: The name of the token used for authentication at the private Docker Registry hosting the DSK Agent Docker images. Default: tributech-io-dsk-edge.
    • Docker Registry Token (DSK Edge) secret: The access token for authentication at the private Docker Registry hosting the DSK Agent Docker images.
    • Docker Image Tag: The Docker Image tag defining the DSK Agent version to be deployed.
    • Additional DSK Edge services:

    Agent deployment - Provide DSK data

  • Review terms and provided input and create the Azure resources. Agent deployment - Review + Create

  • Successful deployment🎉. Agent deployment - Successful deployment

  • Output of the deployment showing sample command to connect to the VM using SSH incl. port forwarding for access to the DSK Agent (e.g. for the Agent Companion). Agent deployment - Deployment output

  • You can now continue with connecting to, linking & configuring the DSK Edge Agent.

Manual setup

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

  • Prerequisite: Recent Linux based system meeting our requirements. Our automated setup creates e.g. a Ubuntu 20.04 based Linux virtual machine on Azure.

  • Install Docker based on the desired option from the official documentation. e.g. for Ubuntu using the Official Docker Repository https://docs.docker.com/engine/install/ubuntu/

    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
  • Install docker-compose We recommend the installation via package manager (e.g. Ubuntu apt-get):

    sudo apt-get install docker-compose
  • (Optional) Allow to manage Docker as non-root user

  • Login to the private Docker registry to allow retrieval of DSK Edge Docker images. (TODO credentials)

    echo <access-token> | docker login --username <token-name> --password-stdin tributech.azurecr.io
  • Copy and adapt the .env environment configuration file. See automated setup for detailed parameter description and Docker doc - The “.env” file for general information about the .env file.

    .env
    TAG=1.10.1
    AGENT_ID=305ed1ad-46e0-4b1b-85c4-aa0268e612db
    NODE_NAME=dev-node-a
    HUB_NAME=dev
    DATA_API_SECRET=<YourSecurePassword123!>
    TRUST_API_SECRET=<YourSecurePassword123!>
  • Copy the docker-compose.yml file.

    docker-compose.yml
    version: "3.3"

    services:
    # DSK agent
    dsk-agent:
    image: ${DOCKER_REGISTRY-tributech.azurecr.io/}dsk-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=HttpValueSink
    # configure DSK Data-API for value storage
    - DataApiValueSinkOptions__DataAPIBaseUrl=https://data-api.${NODE_NAME:?"The variable NODE_NAME needs to be configured in the .env file."}.dataspace-node.com/
    - DataApiValueSinkOptions__AuthUrl=https://auth.${HUB_NAME:?"The variable HUB_NAME needs to be configured in the .env file."}.dataspace-hub.com/auth/realms/${NODE_NAME:?"The variable NODE_NAME needs to be configured in the .env file."}/protocol/openid-connect/token
    - DataApiValueSinkOptions__ClientSecret=${DATA_API_SECRET:?"The variable DATA_API_SECRET needs to be configured in the .env file."}
    # configure DSK Trust-API for proof storage
    - ProofSinkOptions__TrustAPIBaseUrl=https://trust-api.${NODE_NAME:?"The variable NODE_NAME needs to be configured in the .env file."}.dataspace-node.com/
    - ProofSinkOptions__AuthUrl=https://auth.${HUB_NAME:?"The variable HUB_NAME needs to be configured in the .env file."}.dataspace-hub.com/auth/realms/${NODE_NAME:?"The variable NODE_NAME needs to be configured in the .env file."}/protocol/openid-connect/token
    - ProofSinkOptions__ClientSecret=${TRUST_API_SECRET:?"The variable TRUST_API_SECRET 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:
  • Startup the DSK Edge services (will automatically retrieve the Docker images).

    docker-compose up -d
  • You can now continue with connecting to, linking & configuring the DSK Edge Agent.

Docker Compose management commands

In the following we show some of the basic Docker Compose commands for the management of the Docker services of the DSK Edge Agent. Check the docker-compose CLI and Docker CLI documentation for a full overview of the commands.

asciicast

# pull docker images for all services
docker-compose pull

# create & start all services
docker-compose up -d

# check service status
docker-compose ps

# check logs of specific service (-f for following log output)
docker-compose logs -f -t --tail=500 dsk-agent

# stop all services
docker-compose stop
# stop single service
docker-compose stop dsk-agent
# restart single service
docker-compose restart dsk-agent
# start all services
docker-compose start
# start single service
docker-compose start dsk-agent

# remove services
docker-compose down

Depending on your environment the commands might need to be run as root using sudo.