Sudo in live renkulab session

Hi,
I know that one gets root rights in the Docker file, but I’m currently debugging a complex situation and this involves rebuilding the entire project any time I need to either install a package or run some command. Is there a simpler way to do that? Is there any way to get access to sudo/root from the live session on Renkulab?
Guillaume

1 Like

I believe that getting access to root from a RenkuLab session is not allowed because of the potential security implications (someone else will have to confirm this).

If you can clone the repo to a machine that you can run docker on (in my case, my laptop), then you do have some options for improving the image-building workflow. In that case, you can modify the dockerfile, build it and test it locally.

E.g., run the following in the directory with the dockerfile:

docker build -t some_nice_name .

Then you can try out the repo with:

docker run --rm -p"8888:8888" -it some_nice_name

This will start JupyterLab and print out some information to the console. You can connect to the instance using the URL http://localhost:8888/lab

You will be prompted for the token which you can find in the information logged to the console at startup.

If you would really like to have root access within your JupyterLab session, this is also possible, but requires the following changes to the end of the Dockerfile:

USER root
CMD [ "jupyter", "server", "--ip", "0.0.0.0", "--allow-root" ]
1 Like

Thanks for the detailed explanation, that will definitely be useful for certain cases! My issues depend on the hardware used in a given session (I’m trying to get a software to use a GPU for rendering on a remote desktop) and therefore this doesn’t entirely solve that problem as I can’t “replicate” the setup locally. But I also fear that there isn’t a good solution in this specific case.

Ah, I see. Yes, that is a bit more complex of a situation, and I do not myself know of a more convenient way to handle that. Maybe someone else will chime in with a suggestion.