jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
617 stars 222 forks source link

Enable ability to not filter kernels in container deployments #1131

Closed kevin-bates closed 2 years ago

kevin-bates commented 2 years ago

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