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

add new internal worker + worker/temporal validations #129

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
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.17
version: 6.0.18
maintainers:
- name: Retool Engineering
email: [email protected]
Expand Down
25 changes: 16 additions & 9 deletions charts/retool/ci/kubeconform-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@ config:
# clientSecretSecretKey is the key in the k8s secret, default: google-client-secret
# clientSecretSecretKey:
domain:
encryptionKey: '0000000000'
encryptionKey: "0000000000"
# encryptionKeySecretName is the name of the secret where the encryption key is stored (can be used instead of encryptionKey)
# encryptionKeySecretName:
# encryptionKeySecretKey is the key in the k8s secret, default: encryption-key
# encryptionKeySecretKey:
jwtSecret: '0000000000'
jwtSecret: "0000000000"
# jwtSecretSecretName is the name of the secret where the jwt secret is stored (can be used instead of jwtSecret)
# jwtSecretSecretName:
# jwtSecretSecretKey is the key in the k8s secret, default: jwt-secret
# jwtSecretSecretKey:

# IMPORTANT: Incompatible with postgresql subchart
# Please disable the subchart in order to use a managed or external postgres instance.
postgresql: {}
postgresql:
{}
# Specify if postgresql subchart is disabled
# host:
# port:
Expand All @@ -56,7 +57,8 @@ env: {}

# Optionally specify additional environment variables to be populated from Kubernetes secrets.
# Useful for passing in SCIM_AUTH_TOKEN or other secret environment variables from Kubernetes secrets.
environmentSecrets: []
environmentSecrets:
[]
# - name: SCIM_AUTH_TOKEN
# secretKeyRef:
# name: retool-scim-auth-token
Expand All @@ -68,7 +70,8 @@ environmentSecrets: []

# Optionally specify environmental variables. Useful for variables that are not key-value, as env: {} above requires.
# Can also include environment secrets here instead of in environmentSecrets
environmentVariables: []
environmentVariables:
[]
# - name: SCIM_AUTH_TOKEN
# valueFrom:
# secretKeyRef:
Expand Down Expand Up @@ -98,7 +101,8 @@ externalSecrets:
# Default set to AWS Secrets Manager.
backendType: secretsManager
# Array of name/path key/value pairs to use for the External Secrets Objects.
secretRef: []
secretRef:
[]
# - name: retool-config
# path: global-retool-config
# - name: retool-db
Expand Down Expand Up @@ -134,9 +138,9 @@ ingress:
kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: retool.example.com
paths:
- path: /
- host: retool.example.com
paths:
- path: /
tls:
# - secretName: retool.example.com
# hosts:
Expand Down Expand Up @@ -302,3 +306,6 @@ extraManifests: []
securityGroupPolicy:
enabled: false
groupIds: []

internalWorker:
enabled: true
4 changes: 3 additions & 1 deletion charts/retool/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ Alternatively, you can fetch the randomly generated password and set the value i
echo $(kubectl --namespace {{ .Release.Namespace }} get secret/{{ include "retool.fullname" . }}-postgresql -o jsonpath='{.data.postgres-password}' | base64 -d)
We highly recommend you do NOT use this subchart as is to run Postgres in a container for your production instance of Retool. It is only suitable for proof-of-concepts. Please use a managed Postgres, or self-host more permanantly.
***************************************************************************
{{- end }}
{{- end }}

{{- include "retool.validationRules" . }}
27 changes: 27 additions & 0 deletions charts/retool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ Usage: (include "retool.codeExecutor.enabled" .)
{{- $output -}}
{{- end -}}

{{/*
Set Temporal enabled
Usage: (include "retool.temporal.enabled" .)
*/}}
{{- define "retool.temporal.enabled" -}}
{{- $output := "" -}}
{{- if or (index .Values "retool-temporal-services-helm" "enabled") (.Values.workflows.temporal.enabled) -}}
{{- $output = "1" -}}
{{- else -}}
{{- $output = "" -}}
{{- end -}}
{{- $output -}}
{{- end -}}

{{/*
Set Temporal frontend host
Expand Down Expand Up @@ -258,3 +271,17 @@ Usage: (template "retool.codeExecutor.image.tag" .)
{{- fail "Please set a value for .Values.image.tag" }}
{{- end -}}
{{- end -}}

{{/*
Set Worker enabled
Usage: (include "retool.worker.enabled" .)
*/}}
{{- define "retool.worker.enabled" -}}
{{- $output := "" -}}
{{- if or (include "retool.workflows.enabled" .) (.Values.internalWorker.enabled) -}}
{{- $output = "1" -}}
{{- else -}}
{{- $output = "" -}}
{{- end -}}
{{- $output -}}
{{- end -}}
17 changes: 17 additions & 0 deletions charts/retool/templates/_validations.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{/* Compile all validation warnings into a single message and call fail. */}}
{{- define "retool.validationRules" -}}
{{- $messages := list -}}
{{- $messages = append $messages (include "retool.validationRules.internalWorker" .) -}}
{{- $messages = without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
{{- end -}}
{{- end -}}

{{- define "retool.validationRules.internalWorker" -}}
{{- if not (or (not (.Values.internalWorker.enabled)) (and (.Values.internalWorker.enabled) (or (include "retool.temporal.enabled" .) (include "retool.workflows.enabled" .)))) -}}
internalWorker:
Internal worker is enabled (via internalWorker.enabled), but Temporal is not enabled via retool-temporal-services-helm.enabled or workflows.temporal.enabled or via Retool's Managed Temporal for Retool Workflows (via workflows.enabled explicitly, or workflows.enabled implicitly based on image.tag > 3.6.11)
{{- end -}}
Copy link
Contributor Author

@avimoondra avimoondra Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if internalWorker is NOT enabled - validation ✅

if internalWork is enabled AND (some temporal is enabled OR workflows is enabled, with potential of using retool-managed temporal configured in-app) - validation ✅

{{- end -}}
16 changes: 8 additions & 8 deletions charts/retool/templates/deployment_backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ spec:
- name: DBCONNECTOR_QUERY_TIMEOUT_MS
value: {{ .Values.config.dbConnectorTimeout | quote }}
{{- end }}
{{- if and (include "retool.workflows.enabled" .) (or (index .Values "retool-temporal-services-helm" "enabled") (.Values.workflows.temporal.enabled)) }}
- name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_HOST
value: {{ template "retool.temporal.host" . }}
- name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_PORT
value: {{ template "retool.temporal.port" . }}
- name: WORKFLOW_TEMPORAL_CLUSTER_NAMESPACE
value: {{ template "retool.temporal.namespace" . }}
{{- end }}
{{- if and (include "retool.workflows.enabled" .) (include "retool.temporal.enabled" .) }}
- name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_HOST
value: {{ template "retool.temporal.host" . }}
- name: WORKFLOW_TEMPORAL_CLUSTER_FRONTEND_PORT
value: {{ template "retool.temporal.port" . }}
- name: WORKFLOW_TEMPORAL_CLUSTER_NAMESPACE
value: {{ template "retool.temporal.namespace" . }}
{{- end }}
{{- if include "retool.workflows.enabled" . }}
- name: WORKFLOW_BACKEND_HOST
value: http://{{ template "retool.fullname" . }}-workflow-backend
Expand Down
Loading
Loading