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

[FAST_BUILD] No sudo when run with rootless triplet #2132

Merged
merged 4 commits into from
Aug 11, 2024

Conversation

benz0li
Copy link
Contributor

@benz0li benz0li commented Aug 9, 2024

  • rootless triplet: -e NB_USER=root -e NB_UID=0 -e NB_GID=0

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests
  • I will try not to use force-push to make the review process easier for reviewers
  • I have updated the documentation for significant changes

-  rootless triplet: -e NB_USER=root -e NB_UID=0 -e NB_GID=0
@benz0li
Copy link
Contributor Author

benz0li commented Aug 9, 2024

@mathbunnyru For edge cases like

which require -e JUPYTER_ALLOW_INSECURE_WRITES=true in addition.

@benz0li
Copy link
Contributor Author

benz0li commented Aug 9, 2024

@benz0li benz0li marked this pull request as draft August 10, 2024 05:18
@benz0li benz0li marked this pull request as ready for review August 10, 2024 05:42
@mathbunnyru
Copy link
Member

@benz0li may I ask you to write a test for this?

@benz0li
Copy link
Contributor Author

benz0li commented Aug 11, 2024

@benz0li may I ask you to write a test for this?

Done.

environment=["NB_USER=root", "NB_UID=0", "NB_GID=0"],
command=["env"],
)
assert "SUDO" not in logs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this in capital letters?

Copy link
Contributor Author

@benz0li benz0li Aug 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check if any of

SUDO_GID=0
SUDO_COMMAND=/usr/local/bin/start-notebook.py
SUDO_USER=root
SUDO_UID=0

is set in the environment.

That is the case, when the container is started with sudo – but should not in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks!

@mathbunnyru
Copy link
Member

Thanks, @benz0li 👍

@mathbunnyru mathbunnyru merged commit 6f74c72 into jupyter:main Aug 11, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants