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).
-
Linux (Ubuntu 16.06)
Docker-CE and Docker compose need to be installed, see https://docs.docker.com/compose/install/
#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).
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
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
docker-compose -f docker-compose.yml -f mininet.yml down
- 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/
Run instances of one (core | ns3 | mininet | ...).
docker-compose -f docker-compose.yml -f <WORKER>.yml --scale <WORKER>=<N> up
- Build or pull the Docker images as before.
- 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
... using the id provided after start:
docker stop <CONTAINER_ID>