Edinburgh-Genome-Foundry / CAB

:oncoming_taxi: The friendly Computational App Boilerplate. Django + Vue.JS + Redis queues + NginX
Other
22 stars 4 forks source link

docker-compose up failing at end on mac? permissions with cab_rqworker_1? #7

Open bgriffen opened 4 years ago

bgriffen commented 4 years ago

I'm not sure if I've done anything wrong at my end, but when I simply clone repo and follow instructions running docker-compose up, the build fails right at the end? I tried running as sudo but it still faults with same error. I'm running OSX Mojave (10.14.6).

...
  Build complete.

  Tip: built files are meant to be served over an HTTP server.
  Opening index.html over file:// won't work.

Removing intermediate container d9593cafbe15
 ---> 007732ad8c04
Successfully built 007732ad8c04
Successfully tagged cab_vue:latest
WARNING: Image for service vue was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating cab_vue_1 ... 
Creating cab_redis_1 ... done
Creating cab_rqworker_1 ... error
Creating cab_vue_1      ... done
ERROR: for cab_rqworker_1  Cannot start service rqworker: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"./rqworker_reload.sh\": permission denied": unknown

ERROR: for rqworker  Cannot start service rqworker: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"./rqworker_reload.sh\": permission denied": unknown
ERROR: Encountered errors while bringing up the project.

Thank you for any help!

Zulko commented 4 years ago

I'm wondering if this file has the wrong associated permission in the git repo, at which case typing this in a terminal should solve it: chmod +x ./backend/worker_reload.sh.

Would CUBA build and launch correctly on your machine? Because in this case you could also start from CUBA and strip the apps away, and you'd get basically the same as CAB.

bgriffen commented 4 years ago

Thanks for your quick response! CUBA had the same issue but I didn't strip the apps back. Regarding permissions, indeed that looks like it was the issue, though a new challenge:

CAB $docker-compose up
cab_redis_1 is up-to-date
cab_vue_1 is up-to-date
Starting cab_rqworker_1 ... done
Creating cab_django_1   ... done
Creating cab_nginx_1    ... error

ERROR: for cab_nginx_1  Cannot start service nginx: Mounts denied: 
The path /var/log/nginx_cuba
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.
ERROR: for nginx  Cannot start service nginx: Mounts denied: 
The path /var/log/nginx_cuba
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
.
ERROR: Encountered errors while bringing up the project.

I believe I should adjust this in my Docker preferences? Just letting you know as a "test subject" coming to the repo for the first time.

Zulko commented 4 years ago

Yeah you could either change that /var/log/nginx_cuba folder path so it points to any empty folder on your computer (it will write the logs there) or you could create /var/log/nginx_cuba on your machine.

bgriffen commented 4 years ago

Thanks! That appeared to do the trick. For others even less versed than I... Inside docker-compose.yml, change the /var/log component to be another empty folder as Zulko said.

    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.template
      - /var/log/nginx_cuba:/var/log/nginx

It builds and I get the example scenario working via http://0.0.0.0/example_scenario. FYI I will also add that the fonts don't build during the docker-compose up step either. I downloaded them manually and installed them. Not sure if it was a mac permissions thing again. I believe this was the error (sorry for tangent):

Archive:  Raleway.zip
ERROR: Service 'rqworker' failed to build: The command '/bin/sh -c wget -O "Raleway.zip" "https://fonts.google.com/download?family=Raleway"     && unzip -u "Raleway.zip" -d /Library/Fonts/     && rm -f "Raleway.zip"' returned a non-zero code: 2

Perhaps some minor tweaks to README needed and to adjust permissions of those backend files. Thanks!