This repository contains two simulation setups that demonstrate the deployment of the mosaik co-simulation framework with Docker. To run these examples, packages mosaik-docker and Docker have to be installed. For running the examples from JupyterLab, package mosaik-docker-jl needs to be installed.
To set up a dockerized mosaik simulation setup you need to provide the following:
- add a mosaik scenario that
- starts the simulators
- instantiates models within the simulators
- connects the model instances of different simulators to establish the data flow between them
- add a Dockerfile for running the mosaik scenario
- add Dockerfiles for running the simulators (optional)
- add additional resources, e.g., data files (optional)
- add a mosaik-docker simulation setup configuration
There are two approaches for containerizing a mosaik co-simulation:
- Monolithic approach: The mosaik scenario file, all simulators and all aditional resources can be added to a single Docker image. When running a simulation, a single container is instantiated from this image and executed on its own.
- Distributed approach: The mosaik scenario file and the simulators can be added to separate Docker images. When running a simulation, an individual container is instantiated from each of these images. At runtime, these containers are executed in parallel and communicate with each other (via the mosaik API).
Two simple examples based on the mosaik demo are available:
- A monolithic setup is available in folder
monolithic
. - A distributed setup is available in folder
distributed
.