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 |
- Running Kubernetes-Cluster
- Private Docker Registry in the cluster
- 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
- 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
- Deploy to your Kubernetes-Clusters
- Modify yaml files in Kubernetes: change Private Docker Registry Endpoint in 01-dtps-k8.yaml and 01-dtps-k8.yaml) run buildUmages.py
python3 Scripts/apply.py
- 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
- 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 '' - Interact with your Digital Twins API Endpoints under: http://0.0.0.0:32000/{DigitalTwinsUID}/docs#
- 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
- 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):
- Define base configuration to use in JSON Builder
- Filename should be class_yourName.json
- Rebuild and Redeploy DTPS