From 90961ab9a0e6b2b43c22ca5d6673fb4575e7125d Mon Sep 17 00:00:00 2001 From: Luciano Resende Date: Mon, 19 Feb 2024 16:15:53 -0800 Subject: [PATCH] Expose kernel_info_timeout configuration (#1353) --- docs/source/operators/config-add-env.md | 4 ++++ etc/docker/docker-compose.yml | 1 + etc/docker/enterprise-gateway/start-enterprise-gateway.sh | 4 +++- .../helm/enterprise-gateway/templates/deployment.yaml | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/source/operators/config-add-env.md b/docs/source/operators/config-add-env.md index 519a3dcd7..14ac149da 100644 --- a/docs/source/operators/config-add-env.md +++ b/docs/source/operators/config-add-env.md @@ -32,6 +32,10 @@ Besides those environment variables associated with configurable options, the fo startup attempt will take place. If a second timeout occurs, Enterprise Gateway will report a failure to the client. + EG_KERNEL_INFO_TIMEOUT=60 + The time (in seconds) Enterprise Gateway will wait for kernel info response + before deeming the request a failure. + EG_SENSITIVE_ENV_KEYS="" A comma separated list (e.g. "secret,pwd,auth") of sensitive environment variables. Any environment variables that contain any of the words from this diff --git a/etc/docker/docker-compose.yml b/etc/docker/docker-compose.yml index 5a17c5ae3..178caf68d 100644 --- a/etc/docker/docker-compose.yml +++ b/etc/docker/docker-compose.yml @@ -21,6 +21,7 @@ services: environment: - "EG_DOCKER_NETWORK=${EG_DOCKER_NETWORK:-enterprise-gateway_enterprise-gateway}" - "EG_KERNEL_LAUNCH_TIMEOUT=${EG_KERNEL_LAUNCH_TIMEOUT:-60}" + - "EG_KERNEL_INFO_TIMEOUT=${EG_KERNEL_INFO_TIMEOUT:-60}" - "EG_CULL_IDLE_TIMEOUT=${EG_CULL_IDLE_TIMEOUT:-3600}" # Use double-defaulting for B/C. Support for EG_KERNEL_WHITELIST will be removed in a future release - "EG_ALLOWED_KERNELS=${EG_ALLOWED_KERNELS:-${EG_KERNEL_WHITELIST:-'r_docker','python_docker','python_tf_docker','python_tf_gpu_docker','scala_docker'}}" diff --git a/etc/docker/enterprise-gateway/start-enterprise-gateway.sh b/etc/docker/enterprise-gateway/start-enterprise-gateway.sh index 1ad25bc1f..81c77afc8 100755 --- a/etc/docker/enterprise-gateway/start-enterprise-gateway.sh +++ b/etc/docker/enterprise-gateway/start-enterprise-gateway.sh @@ -29,6 +29,7 @@ export EG_CULL_CONNECTED=${EG_CULL_CONNECTED:-False} EG_ALLOWED_KERNELS=${EG_ALLOWED_KERNELS:-${EG_KERNEL_WHITELIST:-"null"}} export EG_ALLOWED_KERNELS=`echo ${EG_ALLOWED_KERNELS} | 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} +export EG_KERNEL_INFO_TIMEOUT=${EG_KERNEL_INFO_TIMEOUT:-60} # 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 @@ -46,4 +47,5 @@ exec jupyter enterprisegateway \ --RemoteMappingKernelManager.cull_idle_timeout=${EG_CULL_IDLE_TIMEOUT} \ --RemoteMappingKernelManager.cull_interval=${EG_CULL_INTERVAL} \ --RemoteMappingKernelManager.cull_connected=${EG_CULL_CONNECTED} \ - --RemoteMappingKernelManager.default_kernel_name=${EG_DEFAULT_KERNEL_NAME} + --RemoteMappingKernelManager.default_kernel_name=${EG_DEFAULT_KERNEL_NAME} \ + --RemoteMappingKernelManager.kernel_info_timeout=${EG_KERNEL_INFO_TIMEOUT} diff --git a/etc/kubernetes/helm/enterprise-gateway/templates/deployment.yaml b/etc/kubernetes/helm/enterprise-gateway/templates/deployment.yaml index fd6d09b27..771318a6a 100644 --- a/etc/kubernetes/helm/enterprise-gateway/templates/deployment.yaml +++ b/etc/kubernetes/helm/enterprise-gateway/templates/deployment.yaml @@ -71,6 +71,8 @@ spec: value: {{ .Values.logLevel }} - name: EG_KERNEL_LAUNCH_TIMEOUT value: !!str {{ .Values.kernel.launchTimeout }} + - name: EG_KERNEL_INFO_TIMEOUT + value: !!str {{ .Values.kernel.infoTimeout }} - name: EG_ALLOWED_KERNELS value: {{ toJson .Values.kernel.allowedKernels | squote }} - name: EG_DEFAULT_KERNEL_NAME