Skip to content

A docker-compose setup of MACI with pluggable workers, supporting MiniNet, NS-3 and CORE

Notifications You must be signed in to change notification settings

umr-ds/maci-docker-compose

 
 

Repository files navigation

MACI Docker

This repository provides a set of instructions to create Docker containers to start a full working set of the MACI framework published on https://maci-research.net/

The service is launched with Docker Compose initiating and connecting different Containers:

  • maci-backend running the management framework based on .Net
  • jupyter for analyzing experiments
  • _*worker to run experiments (multiple instances can be started, however, be aware of side effects when executing parallel network experiments on the same host).

Getting Started

Setup Docker

#run as root
apt-get update
apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update
apt-get install docker-ce
curl -L https://github.com/docker/compose/releases/download/1.15.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
service docker start
  • macOS

    Install Docker (e.g., following these instructions)

  • Windows

    Install Docker (e.g., following these instructions).

Load Submodules

The MACI framework is loaded as a git submodule and needs to be loaded before starting the container:

git submodule init
git submodule update --remote

Start Backend with a Mininet Worker

The command below starts all required containers. Replace <WORKER> with the worker you wish. The MACI WebUI will be available at http://localhost:63658

docker-compose -f docker-compose.yml -f mininet.yml up

Stop Backend

docker-compose -f docker-compose.yml -f mininet.yml down

Configuring Workers

Bootstraping Methods

  • From DockerHub to circumvent the long build process of the images:
docker pull maciresearch/maci-backend
docker pull maciresearch/core_worker
docker pull macireserach/ns3_worker
docker pull maciresearch/mininet_worker
  • Build images from Dockerfiles:
docker build -t maciresearch/maci-backend maci-backend/
docker build -t maciresearch/mininet_worker mininet_worker/
docker build -t maciresearch/core_worker core_worker/
docker build -t maciresearch/ns3_worker ns3_worker/

Scale Number of local Workers

Run instances of one (core | ns3 | mininet | ...).

docker-compose -f docker-compose.yml -f <WORKER>.yml --scale <WORKER>=<N> up

Start remote workers

  1. Build or pull the Docker images as before.
  2. Run a worker and provide the backend address from the worker's perspectiveand idle shutdown time (optional):
docker run --rm --privileged  -v /lib/modules:/lib/modules -e BACKEND=<BACKEND_ADDRESS> -e IDLE=3600 -d maciresearch/mininet_worker
CORE Worker: In addition to the extended privileges it also needs NET_ADMIN linux kernel capabilities and access to the kernel modules:
docker run --rm --privileged  -v /lib/modules:/lib/modules -e BACKEND=<BACKEND_ADDRESS> -e IDLE=3600 -d  --cap-add=NET_ADMIN maciresearch/core_worker

For development purposes there is a core-gui adaption. The container tries to connect to an x server running on your desktop. Important: authorize the host to connect: xhost + <DOCKER_HOST_IP>, Docker for mac users can use the hostname docker.for.mac.localhost.

docker run --rm --privileged  -v /lib/modules:/lib/modules -it --cap-add=NET_ADMIN -e DISPLAY=docker.for.mac.localhost:0 maciresearch/core_worker
Mininet WiFi: In addition to the granted privileges mininet-wifi needs also access to the host network and a mounted /sys folder:
docker run --rm --privileged --net=host -v /sys:/sys -e BACKEND=<BACKEND_ADDRESS> -e IDLE=3600 -d --cap-add=ALL maciresearch/mininet-wifi_worker

Stop the container

... using the id provided after start:

docker stop <CONTAINER_ID>

Contact

About

A docker-compose setup of MACI with pluggable workers, supporting MiniNet, NS-3 and CORE

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 64.7%
  • Dockerfile 26.9%
  • Shell 8.4%