Skip to content

Commit

Permalink
enable code executor by default for image tags >=3.20.15 (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
avimoondra authored Feb 6, 2024
1 parent 5349f37 commit 1f2de75
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 16 deletions.
2 changes: 1 addition & 1 deletion charts/retool/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
Expand Down
35 changes: 29 additions & 6 deletions charts/retool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "" -}}
Expand All @@ -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
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/retool/templates/deployment_code_executor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.codeExecutor.enabled }}
{{- if include "retool.codeExecutor.enabled" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/retool/templates/deployment_workflows_worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 4 additions & 3 deletions charts/retool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1f2de75

Please sign in to comment.