alan-turing-institute / DTBase

A starting point from which digital twins can be developed.
MIT License
10 stars 4 forks source link
hut23 hut23-1234 hut23-1374

DTBase

A starting point from which digital twins can be developed.

Development On Pause

The Research Engineering Group at the Alan Turing Institute has paused development of DTBase as of 2024-04-12. We've done our best to leave the codebase in a working state that should be easy to pick up and develop from. Please feel free to fork it and do so. Do note though that any new issues are unlikely to be attended to by the previous core developers.

What DTBase is

DTBase is a software package that developers can fork to develop their own digital twins with minimal effort. Digital twins mean quite different things to different people, and thus we should clarify. DTBase has

Some things DTBase does not, currently, have:

DTBase may not be for you if

DTBase may be for you if

You may choose to only use parts of the infrastructure that DTBase offers. For instance, the frontend doesn't offer any functionality that the backend API doesn't have, so you can choose to only use the backend, and develop your own frontend from scratch.

We have designed the codebase so that as many of DTBase's features as possible can be deployed either locally or on Azure. There is no reason that DTBase couldn't be deployed on other cloud services, but for historical reasons Azure is what we provide an infrastructure-as-code configuration for.

Structure

diagram illustrating the structure of DTBase

The above diagram illustrates the different parts of DTBase, which one talks to which, and how the code gets deployed when you make edits. This assumes DTBase is deployed on Azure using the Pulumi infrastructure-as-code configuration in the infrastructure folder.

Each of the boxes on the right with the Docker symbol in the corner is a separate Docker container, built by a GitHub Action every time there's a new commit in the main branch, and pushed to Docker Hub, from where Azure loads it. Only the backend interacts with the database, everything else interacts with the backend. Services are here shown as Azure Functions, which is a convenient way to deploy your own services, but a service can also be any other external API endpoint that you can call to trigger something to run, hosted separately from your DTBase deployment.

The three Docker containers are defined by Docker files in the dockerfiles folder, called Dockerfile.backend, Dockerfile.frontend, and Dockerfile.functions. There's also a compose.yaml for running the three containers locally. Please refer to the developer docs for more.

Tech stack

More Details

More documentation on the different parts of DTBase can be found in the following files.

History/The CROP project

The DTBase package is based on CROP, a digital twin for an indoor farm. Some of the defining aspects of the CROP digital twin are:

All of this makes use of cloud-based infrastructure, and can be easily deployed on Microsoft Azure using Pulumi.

DTBase grew out of the CROP codebase. It aims to replicate most (but not all) of the features of CROP, but generalize the code to be agnostic to the use case.