From 1f2de759dda22282f3f8a5f78009ad71c68f2052 Mon Sep 17 00:00:00 2001 From: Avi Moondra Date: Tue, 6 Feb 2024 14:01:41 -0500 Subject: [PATCH] enable code executor by default for image tags >=3.20.15 (#145) --- charts/retool/Chart.yaml | 2 +- charts/retool/templates/_helpers.tpl | 35 +++++++++++++++---- .../retool/templates/deployment_backend.yaml | 2 +- .../templates/deployment_code_executor.yaml | 2 +- .../deployment_workflows_worker.yaml | 2 +- charts/retool/values.yaml | 7 ++-- values.yaml | 7 ++-- 7 files changed, 41 insertions(+), 16 deletions(-) diff --git a/charts/retool/Chart.yaml b/charts/retool/Chart.yaml index b0e46802..c96f675e 100644 --- a/charts/retool/Chart.yaml +++ b/charts/retool/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: retool description: A Helm chart for Kubernetes type: application -version: 6.0.13 +version: 6.0.14 maintainers: - name: Retool Engineering email: engineering+helm@retool.com diff --git a/charts/retool/templates/_helpers.tpl b/charts/retool/templates/_helpers.tpl index bdebae6c..6302db3b 100644 --- a/charts/retool/templates/_helpers.tpl +++ b/charts/retool/templates/_helpers.tpl @@ -141,13 +141,11 @@ Usage: (include "retool.workflows.enabled" .) */}} {{- define "retool.workflows.enabled" -}} {{- $output := "" -}} -{{- if or - (eq (toString (default "" .Values.workflows.enabled)) "true") - (eq .Values.workflows.enabled true) - (eq (toString (default "" .Values.workflows.enabled)) "false") - (eq .Values.workflows.enabled false) +{{- if or + (eq (toString .Values.workflows.enabled) "true") + (eq (toString .Values.workflows.enabled) "false") -}} - {{- if eq .Values.workflows.enabled true -}} + {{- if (eq (toString .Values.workflows.enabled) "true") -}} {{- $output = "1" -}} {{- else -}} {{- $output = "" -}} @@ -164,6 +162,31 @@ Usage: (include "retool.workflows.enabled" .) {{- $output -}} {{- end -}} +{{/* +Set Code Executor enabled +Usage: (include "retool.codeExecutor.enabled" .) +*/}} +{{- define "retool.codeExecutor.enabled" -}} +{{- $output := "" -}} +{{- if or + (eq (toString .Values.codeExecutor.enabled) "true") + (eq (toString .Values.codeExecutor.enabled) "false") +-}} + {{- if (eq (toString .Values.codeExecutor.enabled) "true") -}} + {{- $output = "1" -}} + {{- else -}} + {{- $output = "" -}} + {{- end -}} +{{- else if empty .Values.codeExecutor.image.tag -}} + {{- $output = "" -}} +{{- else if semverCompare ">= 3.20.15" .Values.codeExecutor.image.tag -}} + {{- $output = "1" -}} +{{- else -}} + {{- $output = "" -}} +{{- end -}} +{{- $output -}} +{{- end -}} + {{/* Set Temporal frontend host */}} diff --git a/charts/retool/templates/deployment_backend.yaml b/charts/retool/templates/deployment_backend.yaml index 6b2e71a1..fd998c52 100644 --- a/charts/retool/templates/deployment_backend.yaml +++ b/charts/retool/templates/deployment_backend.yaml @@ -132,7 +132,7 @@ spec: {{- end }} {{- end }} {{- end }} - {{- if .Values.codeExecutor.enabled }} + {{- if include "retool.codeExecutor.enabled" . }} - name: CODE_EXECUTOR_INGRESS_DOMAIN value: http://{{ template "retool.codeExecutor.name" . }} {{- end }} diff --git a/charts/retool/templates/deployment_code_executor.yaml b/charts/retool/templates/deployment_code_executor.yaml index d520d73a..40209647 100644 --- a/charts/retool/templates/deployment_code_executor.yaml +++ b/charts/retool/templates/deployment_code_executor.yaml @@ -1,4 +1,4 @@ -{{- if .Values.codeExecutor.enabled }} +{{- if include "retool.codeExecutor.enabled" . }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/retool/templates/deployment_workflows_worker.yaml b/charts/retool/templates/deployment_workflows_worker.yaml index 4353178c..06ac3c2f 100644 --- a/charts/retool/templates/deployment_workflows_worker.yaml +++ b/charts/retool/templates/deployment_workflows_worker.yaml @@ -125,7 +125,7 @@ spec: value: {{ template "retool.postgresql.user" . }} - name: POSTGRES_SSL_ENABLED value: {{ template "retool.postgresql.ssl_enabled" . }} - {{- if .Values.codeExecutor.enabled }} + {{- if include "retool.codeExecutor.enabled" . }} - name: CODE_EXECUTOR_INGRESS_DOMAIN value: http://{{ template "retool.codeExecutor.name" . }} {{- end }} diff --git a/charts/retool/values.yaml b/charts/retool/values.yaml index 4fe33f5b..ea6479f3 100644 --- a/charts/retool/values.yaml +++ b/charts/retool/values.yaml @@ -406,9 +406,10 @@ dbconnector: enabled: false codeExecutor: - # Enable this for Python support and running code more securely within a separate - # sandboxed environment - enabled: false + # enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards + # explicitly set other fields as needed + + # enabled: true replicaCount: 1 diff --git a/values.yaml b/values.yaml index 4fe33f5b..ea6479f3 100644 --- a/values.yaml +++ b/values.yaml @@ -406,9 +406,10 @@ dbconnector: enabled: false codeExecutor: - # Enable this for Python support and running code more securely within a separate - # sandboxed environment - enabled: false + # enabled by default from Chart version 6.0.15 and Retool image 3.20.15 onwards + # explicitly set other fields as needed + + # enabled: true replicaCount: 1