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

Jupyterhub: allow users created before Cowbird was enabled to spawn jupyterlab #480

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@
[Unreleased](https://github.com/bird-house/birdhouse-deploy/tree/master) (latest)
------------------------------------------------------------------------------------------------------------------

[//]: # (list changes here, using '-' for each new entry, remove this when items are added)
## Fixes

- Jupyterhub: allow users created before Cowbird was enabled to spawn jupyterlab

Users created before Cowbird was enabled will not have a "workspace directory" created. A workspace directory
is a symlink to the directory that contains their Jupyterhub data.

When Cowbird is enabled, Jupyterhub checks if the workspace directory exists and raises an error if it doesn't.

This change allows Jupyterhub to create the symlink if it doesn't exist instead of raising an error.
This means that users without a "workspace directory" will be able to continue using Jupyterhub as they did
before without the need for manual intervention by a system administrator who would otherwise need to manually
create the symlink for them.

[2.6.1](https://github.com/bird-house/birdhouse-deploy/tree/2.6.1) (2024-11-22)
------------------------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ def create_dir_hook(spawner):
# to have working volume mounts with the DockerSpawner.
workspace_user_dir = join(os.environ['WORKSPACE_DIR'], username)
if not os.path.exists(workspace_user_dir):
raise FileNotFoundError(f"The user {username}'s workspace doesn't exist in the workspace directory, "
"but should have been created by Cowbird already.")
os.symlink(jupyterhub_user_dir, workspace_user_dir, target_is_directory=True)
subprocess.call(["chown", f"{os.environ['USER_WORKSPACE_UID']}:{os.environ['USER_WORKSPACE_GID']}",
workspace_user_dir])

Expand Down
Loading