-
Notifications
You must be signed in to change notification settings - Fork 1
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
setup jupyterhub config #78
Conversation
@@ -0,0 +1,9 @@ | |||
#!/bin/bash | |||
|
|||
USERNAME=${JUPYTERHUB_USER} |
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.
JUPYTERHUB_USER
will be set in custom_spawner.py in later PRs.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 48.76% 49.60% +0.83%
==========================================
Files 4 5 +1
Lines 121 125 +4
==========================================
+ Hits 59 62 +3
- Misses 62 63 +1 ☔ View full report in Codecov by Sentry. |
USERNAME=${JUPYTERHUB_USER} | ||
|
||
echo "Starting Jupyter Notebook for user: $USERNAME" | ||
cd $JUPYTERHUB_USER_HOME/$USERNAME |
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.
User home dir will also be created in custom_spawner.py
in future PRs.
@@ -82,6 +98,10 @@ ENV CDM_SHARED_DIR=/cdm_shared_workspace | |||
RUN mkdir -p ${CDM_SHARED_DIR} && chmod -R 777 ${CDM_SHARED_DIR} | |||
RUN chown -R spark_user:spark $CDM_SHARED_DIR | |||
|
|||
# Allow spark_user to use sudo without a password |
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.
JupyterHub requires the presence of system users for its operations. Configuring JupyterHub with a non-root user is a lot challenging, as this user must manage other system users (home dir, virtual env, etc). As a tmp solution, I want to provide sudo access for the spark_user
. I am actually consider switching to root
if it becomes too cumbersome.
# Set the authenticator class | ||
# TODO: Change the authenticator class to a secure one (e.g. GitHubOAuthenticator) | ||
c.JupyterHub.authenticator_class = 'jupyterhub.auth.DummyAuthenticator' | ||
c.Authenticator.allowed_users = {'spark_user', 'test_user1', 'test_user2'} |
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.
Non-existent system users (test_user1
, test_user2
) will be automatically created later in custom_spawner.py
.
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.
Eventually I want to switch to OAuth and phase out user/password auth completely. Maybe only allow admin users to use password.
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.
Presumably long term we'd swap out all the auth systems for KBase auth
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.
yea. That's the plan to use KBase auth eventually.
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.
I don't really understand enough about how jupyterhub works to properly review this. What prevents user A from reading from or writing to user B's environment?
Upon logging in, we need to ensure user's home directory is properly created and permissioned which will be done by |
No description provided.