A domain-specific language (DSL) for defining and generating containerized deployments for digital twins.
The Deployment Manager allows you to define deployments for digital twins using a simple, declarative syntax and automatically generates Docker configurations, including Dockerfiles, docker-compose files, and service configuration files.
- Declarative Service Definition: Define services with runtimes, dependencies, and communication patterns
- Automatic Docker Generation: Generate Dockerfiles with proper base images and package installations
- Service Communication: Model publish/subscribe patterns and HTTP endpoints
- Configuration Management: Automatic generation of service configuration files
- Multi-Hardware Support: Deploy services across different hardware environments
hardware "machine_name" {
service "service_name" {
runtime "python" {
version = "3.11"
packages = [
{ name = "numpy", version = "1.24.3" },
{ name = "flask", version = "2.3.2" }
]
}
sends = ["topic1"]
receives = ["topic2"]
ports = [8080]
executionCommand = "python3 app.py"
}
}
data {
"topic1" {
protocol = "http",
address = "http://service",
port = 8080,
endpoint = "/api/data"
}
}
- Python: Automatic pip package installation with version pinning
- Java: OpenJDK installation and configuration
- InfluxDB: Time-series database setup
- RabbitMQ: Message broker configuration
- Define your deployment in a
.depfile - Generate configurations using the main function:
main("your_deployment.dep")
- Deploy by copying the generated files to your environment and running:
docker-compose up
- Start the LSP server:
import Language;
produceLSP();- Dockerfiles: One per service with runtime setup and dependencies
- docker-compose.yml: Complete orchestration configuration
- config.json: Service-specific configuration files
- Network configuration: Automatic service discovery and communication setup
bouncingball.dep: Simulation service with dashboard frontendincubator.dep: Digital twin incubator with multiple services. For more details, see the incubator project and the associated paper
- The Dockerfiles and the config.json files should be placed in the same directory as the application they deploy.
- The docker-compose.yml file should be in the root directory of your project.
- The config.json files should be parsed by the application at runtime to configure the services.
- Install Rascal MPL
- Clone this repository
- Open in VS Code with Rascal extension
- Define your deployment in a
.depfile - Generate the output artifacts by running the main function:
import Main; main("your_deployment.dep");
- Copy the generated files to their respective directories (see above)
- Build the Docker images using the generated Dockerfiles:
docker build -t service_name path/to/service_directory
- Use
docker-compose upto deploy