-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix spurious warnings when using docker run --user=X #1546
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@maresb could you please merge latest master to your branch? |
maresb
force-pushed
the
fix-spurious-warning
branch
from
December 14, 2021 20:12
812420b
to
8958ba7
Compare
@mathbunnyru, sure! 😄 |
mathbunnyru
approved these changes
Dec 14, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, thanks @maresb!
mathbunnyru
approved these changes
Dec 15, 2021
I think this is a great change, merging this one. |
tlvu
added a commit
to Ouranosinc/PAVICS-e2e-workflow-tests
that referenced
this pull request
Dec 21, 2021
The reason why the old startup CMD was hanging was because the new script assumed user jovyan exists in the docker image. The script was using "set -e" so any errors just make the script exit immediately. So we rollback before this commit jupyter/docker-stacks@c772e98. The commit was part of this PR jupyter/docker-stacks#1546. Error with the new script: it just stops there: ``` (birdy) jenkins@e4c447185b3b:/$ /usr/local/bin/start-notebook.sh + set -e + [[ -n '' ]] + wrapper= + [[ '' == \y\e\s ]] + [[ -n '' ]] + echo 'WARNING: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice.' WARNING: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice. + exec /usr/local/bin/start.sh jupyter notebook + set -e + _log 'Entered start.sh with args:' jupyter notebook + [[ Entered start.sh with args: jupyter notebook == \E\R\R\O\R\:* ]] + [[ Entered start.sh with args: jupyter notebook == \W\A\R\N\I\N\G\:* ]] + [[ '' == '' ]] + echo 'Entered start.sh with args:' jupyter notebook Entered start.sh with args: jupyter notebook + '[' 2 -eq 0 ']' + cmd=("$@") + run-hooks /usr/local/bin/start-notebook.d + [[ ! -d /usr/local/bin/start-notebook.d ]] + return ++ id -u + '[' 1000 == 0 ']' + [[ '' == \1 ]] + [[ '' == \y\e\s ]] ++ id -u jovyan + JOVYAN_UID= ```
This was referenced Mar 13, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1520
During tests, I now check for unexpected ERROR/WARNING messages.
I added a few tests to check for expected warning messages regarding
/etc/passwd
becauseuid != 0
/home/jovyan
because user not inusers(100)
groupI also improved the warning messages to suggest solutions in both cases.
To suppress the spurious warnings from #1520, I warn only when the defaults change, which is in-line with the old logic.
I removed the "test for nonempty" tests
-n "${NB_USER}"
,-n "${NB_UID}"
,-n "${NB_GID}"
, because these variables all have nonempty default values, so they should never be empty in the first place.Finally, if the user goes through the trouble of setting it, I allow the
jovyan
user to be replaced in/etc/passwd
with${NB_USER}
instead of justjovyan
, because we can.