Skip to content

T-Haeussermann/UniTwinFramework

Repository files navigation

UniTwin

Framework for providing universal containerized Digital Twins with modular structure in Kubernetes.
This Fraemwork was published in the following Papers. If you find it useful for your research, please consider citing it.

URL Title Stage
10.1109 Conceptual Architecture for the Provision and Aggregation of Universal Digital Twins within Containerization Environments Concept

Architecture

Prequisits

  1. Running Kubernetes-Cluster
  2. Private Docker Registry in the cluster
  3. Kubernetes Secret for Registry in namespace docker-registry

    If you need help setting up th Kubernetes-Custer and Registry have a look at:
    Kubernetes-Cluster-Setup

Installation

  1. Build images: UniTwin and DTPS
  • Modify buildUmages.py
  • Change Private Docker Registry Endpoint, User and Password
  • Set dtps, unitwin and chatmodelprovider to True
  • Set pushonly to False
  • Change Private Docker Registry Endpoint in class_kube_twin.py
  • Run the script to Build the images and push them to your Private Docker Registry run buildUmages.py
python3 Scripts/buildImages.py
  1. Deploy to your Kubernetes-Clusters
python3 Scripts/apply.py

Usage

  1. Create the configuration for your required Digital Twin
  • Use the JSON Builder for convenience. It is serverd under: http://0.0.0.0:32000/dtps/
  • add and remove classes for needed functionalities in the class section
  • customize class instances in the JSON Output section
  • Publish Subscribe mechanism can be added to the classes.
    _subscribers: adds subscribers to class instance.
    Key = name of subscriber class instance, value = subscriber class instances subscription method
  • _subscriptions: subscribes class instance to other class instance
    Key = name of publisher class instance, value = subscriber class instances subscription method
  1. Deploy the Digital Twin to the Cluster
    a) Use DTPS Swagger UI under DTPS
    Use method createTwin
    b) curl -X 'POST'
    'http://0.0.0.0:32000/dtps/createTwin?conf={YourConfig}&version=1.0&assignNode=false'
    -H 'accept: application/json'
    -d ''
  2. Interact with your Digital Twins API Endpoints under: http://0.0.0.0:32000/{DigitalTwinsUID}/docs#
  3. Use the chat interface under http://0.0.0.0:32000/{DigitalTwinsUID}/ to get attributes and run commands
  • examples: What is your uid? What are your children? Use child class_MQTT-I1 and run method publish with parameters Topic=Test, Payload=Test

Customization

  1. Create your own class for your need and place it in DTPS/Modules
  • Name of the file must match the classes name and contain the following imports and structure:
from .class_ComponentABC import Component
from .class_Event import Event

class class_MQTT(Component):
  1. Define base configuration to use in JSON Builder
  • Filename should be class_yourName.json
  1. Rebuild and Redeploy DTPS

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published