autolab / autolab-oneclick

Apache License 2.0
6 stars 17 forks source link

Tango needs access to docker socket and volumes for vmms/localDocker.py #15

Open bobbens opened 5 years ago

bobbens commented 5 years ago

I was unable to get Tango working out of the box. After quite a bit of debugging and digging I found the changes I made below worked, although they are fairly hacky.

The Tango vmms/localDocker.py requires you to mount /var/run/docker.sock to the docker container so it can use the docker command on the host (rather unsafe though). Furthermore, the autograding_image seems to mount /opt/TangoService/Tango/volumes, however, this image is run on the host and the path is for the container. This can be "fixed" by creating the directory /opt/TangoService/Tango/volumes and mounting it on the container. This can by modifying the docker-compose.yaml to be the following (the part about volumes):

tango:
  build: ./Tango
  command: sh start.sh
  ports:
    - '8600:8600'
  privileged: true
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - /opt/TangoService/Tango/volumes:/opt/TangoService/Tango/volumes

I would like to know if I am overlooking anything or if there is a more simple way to handle this.

datamove commented 5 years ago

@bobbens I was able to get Tango working with a custom image but loggininto a running tango container (e.g. docker exec -it local_tango_1 bash) and pulling my own image inside it. So, i.t's docker inside docker, but hey, it works. don't forget to commit container changes to the image.