Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File ownership when running renku session with uid different from 1000 #3394

Open
rawlik opened this issue Apr 12, 2023 · 4 comments
Open

File ownership when running renku session with uid different from 1000 #3394

rawlik opened this issue Apr 12, 2023 · 4 comments
Labels
kind/bug status/accepted Issue accepted for roadmap/fixing

Comments

@rawlik
Copy link

rawlik commented Apr 12, 2023

When running a renku session on an own machine as a user whose id is not 1000, renku runs as root:

Your user id is not 1000 and for Jupyter to work the session must be started as root.
Jupyter itself will run as your user.

This leads to some problems, however.

Typically, most files on the host machine are owned by the regular user who ran the renku clone command. New files created in the renku session, though, are owned by root. This leads to an inconsistent ownership within the folder. I would expect that if, as a user, I clone a renku project, start a session and work in the session, in the end all the files in the directory are owned by me.

Second, git commands and, in consequence, renku save, don’t work in the session:

# git status
fatal: detected dubious ownership in repository at '/home/jovyan/work/gict-of-human-breast'To add an exception for this directory, call:git config --global --add safe.directory /home/jovyan/work/gict-of-human-breast

The user in the container is also root, and not jovyan.

According to the documentation of the docker stacks one should set the correct username, group name, uid and gid with
-e NB_USER=<username> -e NB_UID=<numeric uid> -e NB_GROUP=<name> -e NB_GID=<numeric gid> or --user <numeric uid> --group-add users.

Related to #3321

@Panaetius
Copy link
Member

I tried the settings you posted in your documentation and while they work with the base jupyter images, the changes we do on top of them for renku prevent them from working. The only way I could get it working at all was with running as root.

I think this is the script that ultimately does the changes necessary, but for some reason those don't work in our docker files, even though from what I could tell, the start.sh script does get executed.

It is not clear to me what causes this issue and how it could be fixed.

@olevski @rokroskar maybe you have an idea?

@Panaetius Panaetius added status/accepted Issue accepted for roadmap/fixing and removed status/triage Issue needs to be triaged labels Apr 24, 2023
@Panaetius
Copy link
Member

Timeboxed to 3 days

@rokroskar
Copy link
Member

@Panaetius I'm pretty sure we don't execute start.sh anywhere?

@Panaetius
Copy link
Member

Panaetius commented Apr 26, 2023

The base jupyter image executes it through the start-notebook.sh which I think we do run somewhere. When I looked into this originally I changed our entrypoint to call that script directly but that also didn't work.

@Panaetius Panaetius moved this from Backlog to Ready in renku-python Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug status/accepted Issue accepted for roadmap/fixing
Projects
Status: Ready
Development

No branches or pull requests

3 participants