Skip to content
Snippets Groups Projects

[tep-virtual-plc] production ready monitoring component

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Wallner, Steffen

    Bootstrap the system by running the following steps.

    Login to docker registry

    docker login gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc

    Pull the latest images

    docker-compose -f prod.yml pull

    Write url to OPC UA Server to prod.env file

    echo TABLESORT_OPCUA_URL=opc.tcp://${DomainOrIpToServer}:54229 > prod.env

    If the OPC UA Server is running on the same host, it is a little bit tricky to determine the right value for DomainOrIpToServer. On Docker for Windows you should set DomainOrIpToServer to the string host.docker.internal. On Docker on Linux you should set DomainOrIpToServer the Ip of the docker0 Bridge. Execute

    docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}'

    to get it. You must also allow in-coming connections from containers to host. E.g. execute

    sudo ufw allow from 172.0.0.0/8 to any port 54229

    if you use ufw.

    Starte Compose

    Download an start the yaml file.

    docker-compose -f prod.yml up

    Init InfluxDB

    Must be down only once, because the data will be stored in a persistent volume.

    docker exec vplc-influxdb influx setup --bucket raw-data \
           --org oe121 --username ${ui_user} --password ${ui_pass} --retention 0 --force

    You can find here more information on how to use the monitoring system. After a while the other components will recognize that the influx is initialized and they will start working properly, too.

    Edited
    prod.yml 3.21 KiB
    # Bootstrap the system by running the following steps.
    
    # 0. Login to docker registry
    #    `docker login gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc`
    
    # 1. Pull the latest images
    #    `docker-compose -f prod.yml pull`
    
    # 2. Write url to OPC UA Server to prod.env file
    #    `echo TABLESORT_OPCUA_URL=opc.tcp://${DomainOrIpToServer}:54229 > prod.env`
    #    If the OPC UA Server is running on the same host, it is a little bit tricky
    #    to determine the right value for `DomainOrIpToServer`. On Docker for Windows
    #    you should set `DomainOrIpToServer` to the string `host.docker.internal`. 
    #    On Docker on Linux you should set `DomainOrIpToServer` the Ip of the docker0 Bridge.
    #     Execute `docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}'` to get it.
    #     You must also allow in-coming connections from containers to host.
    #     E.g. execute `sudo ufw allow from 172.0.0.0/8 to any port 54229`, if you use ufw.
    
    # 3. Starte Tablesort and Compose
    #    The TableSort OPC UA Server should run and inspect already.
    #    Order.StartDate should be a realistic date.
    #    `docker-compose -f prod.yml up`
    
    # 4. Init InfluxDB (once)
    #    `docker exec vplc-influxdb influx setup --bucket raw-data --org oe121 --username ${ui user} --password ${ui pass} --retention 0 --force
    
    # After a while the other components will recognize that the influx is initialized
    # and they will start working properly, too.
    
    version: '3'
    services: 
      influxdb:
        container_name: vplc-influxdb
        image: quay.io/influxdb/influxdb:2.0.0-rc
        ports:
          - 9999:8086
        volumes:
          - vplc-volume:/root/.influxdbv2
        restart: always
      opcua-to-influxdb:
        image: gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc/opcua-to-influxdb
        depends_on:
          - influxdb
        env_file:
          - prod.env
        environment:
          INFLUXDB_V2_URL: http://vplc-influxdb:8086/
          no_proxy: vplc-influxdb
          INFLUXDB_CONFIG_PATH: /root/.influxdbv2/configs
        volumes:
          - vplc-volume:/root/.influxdbv2
        restart: always
      use-case-a:
        image: gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc/data-processing/use-case-a
        depends_on:
          - influxdb
        env_file:
          - prod.env
        environment:
          INFLUXDB_V2_URL: http://vplc-influxdb:8086/
          no_proxy: vplc-influxdb
          INFLUXDB_CONFIG_PATH: /root/.influxdbv2/configs
        volumes:
          - vplc-volume:/root/.influxdbv2
        restart: always
      dashboard-objects:
        image: gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc/data-processing/dashboard-objects
        depends_on:
          - influxdb
        env_file:
          - prod.env
        environment:
          INFLUXDB_V2_URL: http://vplc-influxdb:8086/
          no_proxy: vplc-influxdb
          INFLUXDB_CONFIG_PATH: /root/.influxdbv2/configs
        volumes:
          - vplc-volume:/root/.influxdbv2
        restart: always
      dashboard-valves:
        image: gitlab-ext.iosb.fraunhofer.de:4567/oe121/tep-virtual-plc/data-processing/dashboard-valves
        depends_on:
          - influxdb
        env_file:
          - prod.env
        environment:
          INFLUXDB_V2_URL: http://vplc-influxdb:8086/
          no_proxy: vplc-influxdb
          INFLUXDB_CONFIG_PATH: /root/.influxdbv2/configs
        volumes:
          - vplc-volume:/root/.influxdbv2
        restart: always
    
    volumes:
      vplc-volume:
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment