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
Merged
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
13 changes: 10 additions & 3 deletions etc/docker/enterprise-gateway/start-enterprise-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ export EG_LOG_LEVEL=${EG_LOG_LEVEL:-DEBUG}
export EG_CULL_IDLE_TIMEOUT=${EG_CULL_IDLE_TIMEOUT:-43200} # default to 12 hours
export EG_CULL_INTERVAL=${EG_CULL_INTERVAL:-60}
export EG_CULL_CONNECTED=${EG_CULL_CONNECTED:-False}
EG_KERNEL_WHITELIST=${EG_KERNEL_WHITELIST:-"'r_docker','python_docker','python_tf_docker','scala_docker','spark_r_docker','spark_python_docker','spark_scala_docker'"}
EG_KERNEL_WHITELIST=${EG_KERNEL_WHITELIST:-"null"}
export EG_KERNEL_WHITELIST=`echo ${EG_KERNEL_WHITELIST} | sed 's/[][]//g'` # sed is used to strip off surrounding brackets as they should no longer be included.
export EG_DEFAULT_KERNEL_NAME=${EG_DEFAULT_KERNEL_NAME:-python_docker}

# Determine whether the kernels-allowed list should be added to the start command.
# This is conveyed via a 'null' value for the env - which indicates no kernel names
# were used in the helm chart or docker-compose yaml.
allowed_kernels_option=""
if [ "${EG_KERNEL_WHITELIST}" != "null" ]; then
allowed_kernels_option="--KernelSpecManager.whitelist=[${EG_KERNEL_WHITELIST}]"
fi


echo "Starting Jupyter Enterprise Gateway..."

exec jupyter enterprisegateway \
--log-level=${EG_LOG_LEVEL} \
--KernelSpecManager.whitelist=[${EG_KERNEL_WHITELIST}] \
--log-level=${EG_LOG_LEVEL} ${allowed_kernels_option} \
--RemoteMappingKernelManager.cull_idle_timeout=${EG_CULL_IDLE_TIMEOUT} \
--RemoteMappingKernelManager.cull_interval=${EG_CULL_INTERVAL} \
--RemoteMappingKernelManager.cull_connected=${EG_CULL_CONNECTED} \
Expand Down
4 changes: 3 additions & 1 deletion etc/kubernetes/helm/enterprise-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ kernel:
launchTimeout: 60
# Timeout for an idle kernel before its culled in seconds. Default is 1 hour.
cullIdleTimeout: 3600
# List of kernel names that are available for use.
# List of kernel names that are available for use. To allow additional kernelspecs without
# requiring redeployment (and assuming kernelspecs are mounted or otherwise accessible
# outside the pod), comment out (or remove) the entries, leaving only `whitelist:`.
whitelist:
- r_kubernetes
- python_kubernetes
Expand Down