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

Enable ability to not filter kernels in container deployments #1131

Merged
merged 3 commits into from
Jul 18, 2022

Conversation

kevin-bates
Copy link
Member

As discussed in #1127, there is currently no way to easily enable dynamic kernelspec additions to containerized deployments because the deployment scripts always specific kernelspec entries. Since dynamic kernelspec additions are default behaviors (when kernelspecs are not explicitly listed in the configuration), we should enable similar support in containerized deployments. This pull request enables that functionality.

The start-enterprise-gateway.sh that is the CMD in the enterprise-gateway image has been modified to detect if the EG_KERNEL_WHITELIST env has a value of null. When that value is detected, the --KernelSpecManager.whitelist command-line option is omitted, thereby exposing all kernelspecs configured into the image. It is presumed that deployments wishing to dynamically add kernelspec definitions have mounted the /usr/local/share/jupyter/kernels directory (or otherwise made its update available). Updates made to that directory will be automatically picked up when kernelspecs are refreshed.

A value of null was used for EG_KERNEL_WHITELIST to make this determination because that is the value Helm will set when the whitelist: entry of the values.yaml has no entries. This allows operators to easily remove (or comment out) all existing kernelspec entries to enable this functionality.

Resolves: #1127

Copy link
Contributor

@bloomsa bloomsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this! this directly improves my deployment of EG. 👍

etc/docker/enterprise-gateway/start-enterprise-gateway.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@bloomsa bloomsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one change requested for readability

Comment on lines 36 to 39
allowed_kernels_option="--KernelSpecManager.whitelist=[${EG_KERNEL_WHITELIST}]"
if [ "${EG_KERNEL_WHITELIST}" == 'null' ]; then
allowed_kernels_option=""
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to have allowed_kernels_option default to "". Then change the if to check if "${EG_KERNEL_WHITELIST}" != 'null' and set the flag inside the if.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I also switched the default value to null since I found that the docker-compose.yaml script includes the Docker-based kernel specs.

@kevin-bates kevin-bates merged commit 0505bc1 into jupyter-server:main Jul 18, 2022
@kevin-bates kevin-bates deleted the no-k8s-kernel-whitelist branch July 18, 2022 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support dynamic load new kernel spec
2 participants