Skip to content

Commit

Permalink
Jupyterhub: allow users created before Cowbird was enabled to spawn j…
Browse files Browse the repository at this point in the history
…upyterlab (#480)

## Overview

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.

## Changes

**Non-breaking changes**
- changes jupyterhub configuration

**Breaking changes**
None

## Related Issue / Discussion

- Resolves #425

## Additional Information

## CI Operations

<!--
The test suite can be run using a different DACCS config with
``birdhouse_daccs_configs_branch: branch_name`` in the PR description.
To globally skip the test suite regardless of the commit message use
``birdhouse_skip_ci`` set to ``true`` in the PR description.

Using ``[<cmd>]`` (with the brackets) where ``<cmd> = skip ci`` in the
commit message will override ``birdhouse_skip_ci`` from the PR
description.
Such commit command can be used to override the PR description behavior
for a specific commit update.
However, a commit message cannot 'force run' a PR which the description
turns off the CI.
To run the CI, the PR should instead be updated with a ``true`` value,
and a running message can be posted in following PR comments to trigger
tests once again.
-->

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false
  • Loading branch information
mishaschwartz authored Jan 16, 2025
2 parents 5d0522c + 0997bf3 commit 7f5756d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.7.1
current_version = 2.7.2
commit = True
tag = False
tag_name = {new_version}
Expand Down Expand Up @@ -30,11 +30,11 @@ search = {current_version}
replace = {new_version}

[bumpversion:file:RELEASE.txt]
search = {current_version} 2024-12-20T14:08:42Z
search = {current_version} 2025-01-16T18:35:17Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2024-12-20T14:08:42Z
values = 2025-01-16T18:35:17Z

[bumpversion:file(version):birdhouse/components/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
17 changes: 17 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,25 @@
[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)

[2.7.2](https://github.com/bird-house/birdhouse-deploy/tree/2.7.2) (2025-01-16)
------------------------------------------------------------------------------------------------------------------

## 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.

- Add resolver for http nginx configuration

Nginx requires a resolver to be explicity defined when using `proxy_pass` with a variable in the argument passed
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generic variables
override SHELL := bash
override APP_NAME := birdhouse-deploy
override APP_VERSION := 2.7.1
override APP_VERSION := 2.7.2

# utility to remove comments after value of an option variable
override clean_opt = $(shell echo "$(1)" | $(_SED) -r -e "s/[ '$'\t'']+$$//g")
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ for a full-fledged production platform.
* - citation
- | |citation|

.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/2.7.1.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/bird-house/birdhouse-deploy/2.7.2.svg
:alt: Commits since latest release
:target: https://github.com/bird-house/birdhouse-deploy/compare/2.7.1...master
:target: https://github.com/bird-house/birdhouse-deploy/compare/2.7.2...master

.. |latest-version| image:: https://img.shields.io/badge/tag-2.7.1-blue.svg?style=flat
.. |latest-version| image:: https://img.shields.io/badge/tag-2.7.2-blue.svg?style=flat
:alt: Latest Tag
:target: https://github.com/bird-house/birdhouse-deploy/tree/2.7.1
:target: https://github.com/bird-house/birdhouse-deploy/tree/2.7.2

.. |readthedocs| image:: https://readthedocs.org/projects/birdhouse-deploy/badge/?version=latest
:alt: ReadTheDocs Build Status (latest version)
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1 2024-12-20T14:08:42Z
2.7.2 2025-01-16T18:35:17Z
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ SERVICES = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '2.7.1',
'releaseTime': '2024-12-20T14:08:42Z',
'version': '2.7.2',
'releaseTime': '2025-01-16T18:35:17Z',
'institution': '${BIRDHOUSE_INSTITUTION}',
'researchSubject': '${BIRDHOUSE_SUBJECT}',
'supportEmail': '${BIRDHOUSE_SUPPORT_EMAIL}',
Expand Down Expand Up @@ -141,8 +141,8 @@ PLATFORMS = {
# NOTE:
# Below version and release time auto-managed by 'make VERSION=x.y.z bump'.
# Do NOT modify it manually. See 'Tagging policy' in 'birdhouse/README.rst'.
'version': '2.7.1',
'releaseTime': '2024-12-20T14:08:42Z',
'version': '2.7.2',
'releaseTime': '2025-01-16T18:35:17Z',
'institution': '${BIRDHOUSE_INSTITUTION}',
'researchSubject': '${BIRDHOUSE_SUBJECT}',
'supportEmail': '${BIRDHOUSE_SUPPORT_EMAIL}',
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
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
# built documents.
#
# The short X.Y version.
version = '2.7.1'
version = '2.7.2'
# The full version, including alpha/beta/rc tags.
release = '2.7.1'
release = '2.7.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 7f5756d

Please sign in to comment.