-
Notifications
You must be signed in to change notification settings - Fork 99
Cloudsim Docker Compose
This setup replicates the cloud simulation setup for the SubT Virtual Testbed. We highly recommend developing and testing against a local replica of Cloudsim. Your turn-around time will be much faster, and you can easily introspect running simulations locally.
Docker Compose is a tool for defining and running multi-container Docker images. With Compose, you use a YAML file to configure the SubT Cloudsim on a local system.
Prerequisites
Docker Compose relies on Docker Engine, so make sure you have Docker Engine installed.
-
Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
-
Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose
-
Test the installation.
docker-compose --version`
docker-compose version 1.24.1, build 1110ad01
Note: If you have Docker Engine version >= 19.03 installed, then you need add the content below into the /etc/docker/daemon.json
file for --runtime=nvidia
to work. More info here.
cd /etc/docker/
sudo vim daemon.json
# Add this into the file:
{
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
sudo service docker restart
cd ~/subt_ws/src/subt/docker
./run_docker_compose.sh
The default docker-compose.yml file launches a SubT simulation image with two robots, two bridge images, and two solution images (one for each robot).
-
Modify the
sim
sevice'scommand:
line in the docker-compose.yml file to include the number and type of robots you need. -
Each robot requires both a
bridge
andsolution
container. Modify thebridge
container'scommand:
to include only one of the robots specified in thesim
command
. Modify thesolution
container'simage
to be your own solution. Also, create anotherrelay_net
for thebridge
andsolution
containers.
# Check if the /tmp/.docker.xauth files/directory exist:
ls -la /tmp | grep docker
# If you see instance listed, then remove them:
sudo rm -rfv /tmp/.docker.xauth
# Try to launch docker-compose again
# Pass the circuit name when launching docker-compose (e.g. tunnel, urban, cave)
./run_docker_compose.sh [circuit]