From fa4bb5ce925ba611dac09a3edb6be04031417760 Mon Sep 17 00:00:00 2001 From: Nicola Piga Date: Tue, 4 Jul 2023 23:55:33 +0200 Subject: [PATCH] [handover] Remove docker compose README.md and move yml file to root/dockercompose --- .../docker-compose.yml | 0 src/handover/dockercompose/README.md | 88 ------------------- 2 files changed, 88 deletions(-) rename {src/handover/dockercompose => dockercompose}/docker-compose.yml (100%) delete mode 100644 src/handover/dockercompose/README.md diff --git a/src/handover/dockercompose/docker-compose.yml b/dockercompose/docker-compose.yml similarity index 100% rename from src/handover/dockercompose/docker-compose.yml rename to dockercompose/docker-compose.yml diff --git a/src/handover/dockercompose/README.md b/src/handover/dockercompose/README.md deleted file mode 100644 index 147d8f3..0000000 --- a/src/handover/dockercompose/README.md +++ /dev/null @@ -1,88 +0,0 @@ -## Setup up the GPU-enabled swarm (once) - -### Manager -On the chosen manager machine please do: - -```console -docker swarm init -``` - -### Workers - -For each worker to be added, on the `manager` please do: - -```console -docker swarm join-token worker -``` - -The output will be something like -```console -docker swarm join --token : -``` - -Simply copy-paste, or use ssh to ease the process, the command **on the worker node**. However, please substitute the `` with its hostname. - -After that, we must add labels to nodes devoted to run ROFT and ML modules. - -For each worker providing ROFT, please do on the `manager`: - -```console -docker node update --label-add roft_deployer=true -``` - -For those providing ML modules, please do on the `manager`: - -```console -docker node update --label-add ycb_cv_deployer=true -``` - -### Configure GPUs on all machines (manager and workers) - -For each machine, please do the following. - -Find the GPU-ID first: - -```console -nvidia-smi -a | grep UUID | awk '{print substr($4,0,12)}' -``` - -You will get something like `GPU-xxxxxxx`. - -Then edit `/etc/docker/daemon.json` such that it looks like: -```json -{ - "runtimes": { - "nvidia": { - "path": "/usr/bin/nvidia-container-runtime", - "runtimeArgs": [] - } - }, - "default-runtime": "nvidia", - "node-generic-resources": [ - "NVIDIA-GPU=", - "NVIDIA-GPU=" - ] -} -``` - -Please add as many GPUs as desired. - -Then enable GPU advertising by uncommenting the line `swarm-resource = "DOCKER_RESOURCE_GPU"` in `/etc/nvidia-container-runtime/config.toml`. - -Finally, restart docker by issuing `sudo systemctl restart docker.service`. - -## Deploy the stack (for each run) - -```console -cd roft-samples/dockercompose -docker stack deploy -c docker-compose.yml roft-samples-handover-stack -``` - -After running the demo, stop all services and rm the stack: - -```console -docker service update --replicas 0 roft-samples-handover-stack_roft -docker service update --replicas 0 roft-samples-handover-stack_detectron2 -docker service update --replicas 0 roft-samples-handover-stack_dope -docker stack rm roft-samples-handover-stack -```