You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should be able to use Docker Compose projects in their Containerlab labs.
Motivation
At the moment, it requires some finesse and ext-container usage to be able to inject a project created via Docker Compose to a given container lab. Many of the more complex network applications require spinning up multiple containers for their dependencies, such as akvorado, and are made available as a Docker compose project.
To ease the creation of labs that include such applications, a new type of Kind, compose, could be introduced.
New compose kind
The compose kind should be very easy to use, like docker compose is. Specify a Docker Compose project (a YAML file), and you should have your Compose project running and connected into the lab's management network.
The Docker API used in the docker runtime implementation already includes Docker Compose functionality. The first, initial implementation of this feature should be able to load a given YAML file containing a Docker Compose project. The project's network, subnet and gateway config should be adjusted to match the lab's own, before passing it to the API's equivalent of docker compose up -d.
For tearing down the lab, one can just use the docker compose down API equivalent -- since Docker's Compose functionality does not require storing state, it can just re-use the specified compose project file.
The tricky parts are: data plane links to the composed application's containers, and of course, overriding regular single-container behaviour that default nodes exhibit.
The latter can be done by looking at ext-container's code and doing a similar approach (e.g. override GetContainers to return multiple containers associated with the Compose Project).
Limitations
There are some projects where a Docker Compose project is made out of multiple files, or to use overrides/envvars for templating. Data-plane links is also a hard problem to solve. The initial implementation should not be required to support these.
The text was updated successfully, but these errors were encountered:
Users should be able to use Docker Compose projects in their Containerlab labs.
Motivation
At the moment, it requires some finesse and
ext-container
usage to be able to inject a project created via Docker Compose to a given container lab. Many of the more complex network applications require spinning up multiple containers for their dependencies, such asakvorado
, and are made available as a Docker compose project.To ease the creation of labs that include such applications, a new type of Kind,
compose
, could be introduced.New
compose
kindThe
compose
kind should be very easy to use, likedocker compose
is. Specify a Docker Compose project (a YAML file), and you should have your Compose project running and connected into the lab's management network.Implementation
The Docker API used in the docker runtime implementation already includes Docker Compose functionality. The first, initial implementation of this feature should be able to load a given YAML file containing a Docker Compose project. The project's network, subnet and gateway config should be adjusted to match the lab's own, before passing it to the API's equivalent of
docker compose up -d
.For tearing down the lab, one can just use the
docker compose down
API equivalent -- since Docker's Compose functionality does not require storing state, it can just re-use the specified compose project file.The tricky parts are: data plane links to the composed application's containers, and of course, overriding regular single-container behaviour that default nodes exhibit.
The latter can be done by looking at
ext-container
's code and doing a similar approach (e.g. override GetContainers to return multiple containers associated with the Compose Project).Limitations
There are some projects where a Docker Compose project is made out of multiple files, or to use overrides/envvars for templating. Data-plane links is also a hard problem to solve. The initial implementation should not be required to support these.
The text was updated successfully, but these errors were encountered: