Skip to content

Commit

Permalink
Jupyterhub cull interval setting must be an integer (#391)
Browse files Browse the repository at this point in the history
## Overview

Previously, the default `jupyter_idle_kernel_cull_interval` setting is
calculated by dividing the `jupyter_idle_kernel_cull_timeout` setting by
2 using float division. This meant that the result was a float instead
of the expected integer value. This caused and error when the jupyterlab
server spawned. In order to fix this, the value is cast to an integer
after division.

## Changes

**Non-breaking changes**
- Bug fix

**Breaking changes**
None

## Related Issue / Discussion

## Additional Information

The error message encountered if the value is not cast to an integer is
as follows:

```
Bad config encountered during initialization: The 'cull_interval' trait of an AsyncMappingKernelManager instance expected an int, not the str '43200.0'.
```

This indicates that the value is read in as a string and checked whether
it is an integer or not (possibly with python's `str.isnumeric()`
method).

<!--
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: true`` in the PR description.
-->

birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false
  • Loading branch information
mishaschwartz authored Oct 18, 2023
2 parents 2b9f31e + 74ac479 commit ea48171
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 16 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 = 1.35.0
current_version = 1.35.1
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} 2023-10-16T14:37:32Z
search = {current_version} 2023-10-18T12:50:38Z
replace = {new_version} {utcnow:%Y-%m-%dT%H:%M:%SZ}

[bumpversion:part:releaseTime]
values = 2023-10-16T14:37:32Z
values = 2023-10-18T12:50:38Z

[bumpversion:file(version):birdhouse/config/canarie-api/docker_configuration.py.template]
search = 'version': '{current_version}'
Expand Down
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@

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

[1.35.1](https://github.com/bird-house/birdhouse-deploy/tree/1.35.1) (2023-10-18)
------------------------------------------------------------------------------------------------------------------

## Fixes

- Jupyterhub cull interval setting must be an integer:
- Previously, the default `jupyter_idle_kernel_cull_interval` setting is calculated by dividing the
`jupyter_idle_kernel_cull_timeout` setting by 2 using float division. This meant that the result was a float
instead of the expected integer value. This caused and error when the jupyterlab server spawned.
In order to fix this, the value is cast to an integer after division.

[1.35.0](https://github.com/bird-house/birdhouse-deploy/tree/1.35.0) (2023-10-16)
------------------------------------------------------------------------------------------------------------------

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 := 1.35.0
override APP_VERSION := 1.35.1

# 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 @@ -14,13 +14,13 @@ for a full-fledged production platform.
* - releases
- | |latest-version| |commits-since|

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

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

.. |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 @@
1.35.0 2023-10-16T14:37:32Z
1.35.1 2023-10-18T12:50:38Z
8 changes: 4 additions & 4 deletions birdhouse/config/canarie-api/docker_configuration.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,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': '1.35.0',
'releaseTime': '2023-10-16T14:37:32Z',
'version': '1.35.1',
'releaseTime': '2023-10-18T12:50:38Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down Expand Up @@ -142,8 +142,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': '1.35.0',
'releaseTime': '2023-10-16T14:37:32Z',
'version': '1.35.1',
'releaseTime': '2023-10-18T12:50:38Z',
'institution': 'Ouranos',
'researchSubject': 'Climatology',
'supportEmail': '${SUPPORT_EMAIL}',
Expand Down
2 changes: 1 addition & 1 deletion birdhouse/config/jupyterhub/jupyterhub_config.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jupyter_idle_kernel_cull_timeout = int("${JUPYTER_IDLE_KERNEL_CULL_TIMEOUT}" or
jupyter_idle_kernel_cull_interval = int("${JUPYTER_IDLE_KERNEL_CULL_INTERVAL}" or 0)
if jupyter_idle_kernel_cull_timeout:
if not jupyter_idle_kernel_cull_interval or jupyter_idle_kernel_cull_interval > jupyter_idle_kernel_cull_timeout:
jupyter_idle_kernel_cull_interval = jupyter_idle_kernel_cull_timeout / 2
jupyter_idle_kernel_cull_interval = max(1, int(jupyter_idle_kernel_cull_timeout / 2))
c.Spawner.args.extend([
'--MappingKernelManager.cull_idle_timeout={}'.format(jupyter_idle_kernel_cull_timeout),
'--MappingKernelManager.cull_interval={}'.format(jupyter_idle_kernel_cull_interval),
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 = '1.35.0'
version = '1.35.1'
# The full version, including alpha/beta/rc tags.
release = '1.35.0'
release = '1.35.1'

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

0 comments on commit ea48171

Please sign in to comment.