databio / hub.bulker.io

Bulker registry
http://hub.bulker.io
BSD 2-Clause "Simplified" License
5 stars 1 forks source link

rstudio server commands to waldronlab/bioconductor #8

Closed lwaldron closed 4 years ago

lwaldron commented 4 years ago

Doing this as a PR because I'm not sure it really works. I've also added -p and -e arguments to my bulker_config.yaml, ie::

28c28
<           docker_args: --volume=${HOME}/R/bioc-release:/usr/local/lib/R/host-site-library
---
>           docker_args: --volume=${HOME}/R/bioc-release:/usr/local/lib/R/host-site-library -e PASSWORD=rstudiopassword -p 8787:8787
30c30
<           docker_args: --volume=${HOME}/R/bioc-devel:/usr/local/lib/R/host-site-library
---
>           docker_args: --volume=${HOME}/R/bioc-devel:/usr/local/lib/R/host-site-library -e PASSWORD=rstudiopassword -p 8787:8788

Then I load & activate this new waldronlab/bioconductor crate, and do:

bulker-3.2$ rstudio-server start
WARNING: Published ports are discarded when using host network mode
bulker-3.2$ 

I can see that it indeed launched a container:

Levis-MBP:~ lwaldron$ docker ps
CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS               NAMES
51073b568e0e        bioconductor/bioconductor_full:release   "rstudio-server start"   26 minutes ago      Up 26 minutes                           ecstatic_lichterman
f2

Navigating to http://localhost:8787 however gives me an "Unable to connect" error. In contrast, if I do for example the following (within or without bulker):

docker run                                      \
      -e PASSWORD=your_password                   \
      -p 8787:8787                                \
      bioconductor/bioconductor_full:release

then the server can be found on localhost:8787 and I see the following from docker ps:

CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS              PORTS                    NAMES
28f01cc4a5ea        bioconductor/bioconductor_full:release   "/init"                  6 seconds ago       Up 4 seconds        0.0.0.0:8787->8787/tcp   relaxed_wilson

I did also try putting docker_command: /init or docker_command: " " in my bioconductor manifest, but that produced an additional warning, did not launch an image visible by docker ps, or start listening on on localhost:8787:

bulker-3.2$ rstudio-server
WARNING: Published ports are discarded when using host network mode
s6-mkdir: warning: unable to mkdir /var/run/s6: Permission denied

So I am at a loss of what to try next...

nsheff commented 4 years ago

Well, I found a few things... The reason is a bit complicated, but basically boils down to this: these rocker container images are based on s6, which appears to only be able to run the root user... bulker, on the other hand, is specifically set up to run everything as the user that is active in the bulker environment. So, you were on the right track with your setting docker_command: " ", because these are also entrypoint containers... but then the user is not set up correctly because bulker automatically maps your local user, and the rocker container is running /init and requiring you to be the root user. I don't really agree with the way they've set up the images here... in my opinion, they've complicated things by requiring the images to be run in a certain way. I think it would be better to go with a simpler, more basic rstudioserver image that doesn't specify these things. Are you aware of more generally usable rstudioserver images?

But anyway, I've gone ahead and adapted bulker so it can work with these kinds of images as well...

If you update your files in templates/docker_executable.jinja2 and templates/docker_shell.jinja2 to the ones on the dev branch (https://github.com/databio/bulker/tree/dev/bulker/templates), then my updates to your PR will work (I've added no_user and no_network options).

lwaldron commented 4 years ago

FYI I have raised the question about potentially building bioconductor_full from non-rocker images at https://github.com/Bioconductor/bioconductor_full/issues/19, in case you want to weigh in there.