From 813cf32817b62c625a2f6384cc2ef089988fe44a Mon Sep 17 00:00:00 2001 From: wendrul Date: Wed, 16 Oct 2024 14:19:42 +0200 Subject: [PATCH 1/6] Update charts for tantivy search container --- charts/windmill/templates/indexer.yaml | 193 +++++++++++++++++++++++++ charts/windmill/templates/ingress.yaml | 12 ++ charts/windmill/values.yaml | 50 +++++++ 3 files changed, 255 insertions(+) create mode 100644 charts/windmill/templates/indexer.yaml diff --git a/charts/windmill/templates/indexer.yaml b/charts/windmill/templates/indexer.yaml new file mode 100644 index 0000000..9aa6df9 --- /dev/null +++ b/charts/windmill/templates/indexer.yaml @@ -0,0 +1,193 @@ +{{- if and .Values.enterprise.enabled .Values.windmill.indexer.enabled -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: windmill-indexer + labels: + app: windmill-indexer + app.kubernetes.io/name: windmill-indexer + chart: {{ template "windmill.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 3 + maxUnavailable: 0 + selector: + matchLabels: + app: windmill-indexer + template: + metadata: + labels: + app: windmill-indexer + app.kubernetes.io/name: windmill-indexer + container: windmill-indexer +{{- with .Values.windmill.indexer.labels }} +{{ toYaml . | indent 8 }} +{{- end }} +{{- with .Values.windmill.indexer.annotations }} + annotations: +{{ toYaml . | indent 8 }} + {{- end }} + spec: + {{ if .Values.windmill.imagePullSecrets }} + imagePullSecrets: + - name: {{ .Values.windmill.imagePullSecrets }} + {{ end }} + containers: + - name: windmill-indexer + securityContext: + {{- with .Values.windmill.indexer.containerSecurityContext }} + {{- toYaml . | nindent 10 }} + {{- end }} + image: {{ default "ghcr.io/windmill-labs/windmill-ee" .Values.windmill.image }}:{{ default "latest" .Values.windmill.tag }} + imagePullPolicy: Always + ports: + - containerPort: 8000 + readinessProbe: + timeoutSeconds: 1 + successThreshold: 1 + failureThreshold: 1 + httpGet: + host: + scheme: HTTP + path: / + httpHeaders: + - name: Host + value: localhost + port: 8000 + initialDelaySeconds: 5 + periodSeconds: 5 + env: + {{- with .Values.windmill.indexer.extraEnv }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{ if .Values.enterprise.enabled }} + - name : "METRICS_ADDR" + value: "true" + {{ end }} + {{ if .Values.windmill.databaseUrlSecretName }} + - name: "DATABASE_URL" + valueFrom: + secretKeyRef: + name: "{{ .Values.windmill.databaseUrlSecretName }}" + key: "{{ .Values.windmill.databaseUrlSecretKey }}" + {{ else }} + - name: "DATABASE_URL" + value: "{{ .Values.windmill.databaseUrl }}" + {{ end }} + - name: "BASE_URL" + value: "{{ .Values.windmill.baseProtocol }}://{{ .Values.windmill.baseDomain }}" + - name: "RUST_LOG" + value: "{{ .Values.windmill.rustLog }}" + - name: "MODE" + value: "indexer" + - name: "JSON_FMT" + value: "true" + {{ if .Values.windmill.instanceEventsWebhook }} + - name: "INSTANCE_EVENTS_WEBHOOK" + value: "true" + {{ end }} + {{ if .Values.enterprise.enabled }} + {{ if .Values.enterprise.licenseKeySecretName }} + - name: "LICENSE_KEY" + valueFrom: + secretKeyRef: + name: {{ .Values.enterprise.licenseKeySecretName }} + key: {{ .Values.enterprise.licenseKeySecretKey }} + {{ else }} + - name: "LICENSE_KEY" + value: "{{ .Values.enterprise.licenseKey }}" + {{ end }} + {{ if .Values.enterprise.samlMetadata }} + - name: "SAML_METADATA" + value: "{{ .Values.enterprise.samlMetadata }}" + {{ end }} + {{ if $.Values.enterprise.enabledS3DistributedCache }} + - name: "S3_CACHE_BUCKET" + value: "{{ $.Values.enterprise.s3CacheBucket }}" + {{ end }} + {{if .Values.enterprise.scimTokenSecretName}} + - name: "SCIM_TOKEN" + valueFrom: + secretKeyRef: + name: "{{ .Values.enterprise.scimTokenSecretName }}" + key: "{{ .Values.enterprise.scimTokenSecretKey }}" + {{ else if .Values.enterprise.scimToken}} + - name: "SCIM_TOKEN" + value: "{{ .Values.enterprise.scimToken }}" + {{ end }} + {{ end }} + {{ if .Values.windmill.openaiAzureBasePath}} + - name: OPENAI_AZURE_BASE_PATH + value: "{{ .Values.windmill.openaiAzureBasePath }}" + {{ end }} + {{ if .Values.windmill.cookieDomain }} + - name: "COOKIE_DOMAIN" + value: "{{ .Values.windmill.cookieDomain }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyMaxIndexedJobLogSize__mb }} + - name: "TANTIVY_MAX_INDEXED_JOB_LOG_SIZE__MB" + value: "{{ .Values.windmill.indexer.tantivyMaxIndexedJobLogSize__mb }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyS3BackupPeriod__s }} + - name: "TANTIVY_S3_BACKUP_PERIOD__S" + value: "{{ .Values.windmill.indexer.tantivyS3BackupPeriod__s }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyIndexWriterMemoryBudget__mb }} + - name: "TANTIVY_INDEX_WRITER_MEMORY_BUDGET__MB" + value: "{{ .Values.windmill.indexer.tantivyIndexWriterMemoryBudget__mb }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyRefreshIndexPeriod__s }} + - name: "TANTIVY_REFRESH_INDEX_PERIOD__S" + value: "{{ .Values.windmill.indexer.tantivyRefreshIndexPeriod__s }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyDocCommitMaxBatchSize }} + - name: "TANTIVY_DOC_COMMIT_MAX_BATCH_SIZE" + value: "{{ .Values.windmill.indexer.tantivyDocCommitMaxBatchSize }}" + {{ end }} + {{ if .Values.windmill.indexer.tantivyShowMemoryEvery }} + - name: "TANTIVY_SHOW_MEMORY_EVERY" + value: "{{ .Values.windmill.indexer.tantivyShowMemoryEvery }}" + {{ end }} + + resources: +{{ toYaml .Values.windmill.indexer.resources | indent 12 }} + {{- with .Values.windmill.indexer.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.windmill.indexer.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.windmill.indexer.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.windmill.indexer.podSecurityContext }} + securityContext: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.windmill.indexer.securityContext }} + securityContext: +{{ toYaml . | indent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: windmill-indexer +spec: + ports: + - port: 8000 + protocol: TCP + targetPort: 8000 + selector: + app.kubernetes.io/name: windmill-indexer + sessionAffinity: ClientIP + type: ClusterIP +{{- end -}} diff --git a/charts/windmill/templates/ingress.yaml b/charts/windmill/templates/ingress.yaml index b07ea6f..01c25cc 100644 --- a/charts/windmill/templates/ingress.yaml +++ b/charts/windmill/templates/ingress.yaml @@ -43,6 +43,18 @@ spec: name: windmill-multiplayer port: number: 3002 + {{ if .Values.windmill.indexer.enabled }} + - host: {{ .Values.windmill.baseDomain | quote }} + http: + paths: + - path: /api/srch/ + pathType: Prefix + backend: + service: + name: windmill-indexer + port: + number: 8000 + {{ end }} {{ if .Values.hub.enabled }} - host: {{ .Values.hub.baseDomain | quote }} http: diff --git a/charts/windmill/values.yaml b/charts/windmill/values.yaml index 97d825c..49be99b 100644 --- a/charts/windmill/values.yaml +++ b/charts/windmill/values.yaml @@ -369,6 +369,56 @@ windmill: # -- target CPU utilization targetCPUUtilizationPercentage: 80 + # indexer configuration + indexer: + tag: "latest" + + enabled: true + + # -- Annotations to apply to the pods + annotations: {} + + # -- Annotations to apply to the pods + labels: {} + + # -- Node selector to use for scheduling the pods + nodeSelector: {} + + # -- Tolerations to apply to the pods + tolerations: [] + + # -- legacy, use podSecurityContext instead + securityContext: + # -- Security context to apply to the pods + podSecurityContext: + # -- run as user. The default is 0 for root user + runAsUser: 0 + # -- run explicitly as a non-root user. The default is false. + runAsNonRoot: false + containerSecurityContext: {} + + # -- Affinity rules to apply to the pods + affinity: {} + + # -- Resource limits and requests for the pods + resources: {} + + # -- job logs bigger than this will be truncated before indexing + tantivyMaxIndexedJobLogSize__mb: 1 + # -- how often to backup the index into object storage in seconds + tantivyS3BackupPeriod__s: 3600 + # -- higher budget for higher indexing throughput + tantivyIndexWriterMemoryBudget__mb: 500 + # -- how often to start indexing new jobs + tantivyRefreshIndexPeriod__s: 300 + # -- how many documents to batch in one commit + tantivyDocCommitMaxBatchSize: 100000 + # -- log memory usage and progress every so many documents indexed + tantivyShowMemoryEvery: 10000 + + # -- Extra environment variables to apply to the pods + extraEnv: [] + ingress: # -- enable/disable included ingress resource enabled: true From bff3b3467a30a5477ef53226d710308eee27f0d3 Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:34:00 +0100 Subject: [PATCH 2/6] Update indexer.yaml --- charts/windmill/templates/indexer.yaml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/charts/windmill/templates/indexer.yaml b/charts/windmill/templates/indexer.yaml index 9aa6df9..f5628b8 100644 --- a/charts/windmill/templates/indexer.yaml +++ b/charts/windmill/templates/indexer.yaml @@ -129,31 +129,7 @@ spec: - name: "COOKIE_DOMAIN" value: "{{ .Values.windmill.cookieDomain }}" {{ end }} - {{ if .Values.windmill.indexer.tantivyMaxIndexedJobLogSize__mb }} - - name: "TANTIVY_MAX_INDEXED_JOB_LOG_SIZE__MB" - value: "{{ .Values.windmill.indexer.tantivyMaxIndexedJobLogSize__mb }}" - {{ end }} - {{ if .Values.windmill.indexer.tantivyS3BackupPeriod__s }} - - name: "TANTIVY_S3_BACKUP_PERIOD__S" - value: "{{ .Values.windmill.indexer.tantivyS3BackupPeriod__s }}" - {{ end }} - {{ if .Values.windmill.indexer.tantivyIndexWriterMemoryBudget__mb }} - - name: "TANTIVY_INDEX_WRITER_MEMORY_BUDGET__MB" - value: "{{ .Values.windmill.indexer.tantivyIndexWriterMemoryBudget__mb }}" - {{ end }} - {{ if .Values.windmill.indexer.tantivyRefreshIndexPeriod__s }} - - name: "TANTIVY_REFRESH_INDEX_PERIOD__S" - value: "{{ .Values.windmill.indexer.tantivyRefreshIndexPeriod__s }}" - {{ end }} - {{ if .Values.windmill.indexer.tantivyDocCommitMaxBatchSize }} - - name: "TANTIVY_DOC_COMMIT_MAX_BATCH_SIZE" - value: "{{ .Values.windmill.indexer.tantivyDocCommitMaxBatchSize }}" - {{ end }} - {{ if .Values.windmill.indexer.tantivyShowMemoryEvery }} - - name: "TANTIVY_SHOW_MEMORY_EVERY" - value: "{{ .Values.windmill.indexer.tantivyShowMemoryEvery }}" - {{ end }} - + resources: {{ toYaml .Values.windmill.indexer.resources | indent 12 }} {{- with .Values.windmill.indexer.nodeSelector }} From 2d11f57d82d5b86ca9a0224e7781ad218a63d65a Mon Sep 17 00:00:00 2001 From: wendrul <53628737+wendrul@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:34:53 +0100 Subject: [PATCH 3/6] Update values.yaml --- charts/windmill/values.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/charts/windmill/values.yaml b/charts/windmill/values.yaml index 49be99b..7f8ff5e 100644 --- a/charts/windmill/values.yaml +++ b/charts/windmill/values.yaml @@ -403,19 +403,6 @@ windmill: # -- Resource limits and requests for the pods resources: {} - # -- job logs bigger than this will be truncated before indexing - tantivyMaxIndexedJobLogSize__mb: 1 - # -- how often to backup the index into object storage in seconds - tantivyS3BackupPeriod__s: 3600 - # -- higher budget for higher indexing throughput - tantivyIndexWriterMemoryBudget__mb: 500 - # -- how often to start indexing new jobs - tantivyRefreshIndexPeriod__s: 300 - # -- how many documents to batch in one commit - tantivyDocCommitMaxBatchSize: 100000 - # -- log memory usage and progress every so many documents indexed - tantivyShowMemoryEvery: 10000 - # -- Extra environment variables to apply to the pods extraEnv: [] From 88147d79fcb6c009243a65a74e3cdd624c59786b Mon Sep 17 00:00:00 2001 From: wendrul Date: Thu, 5 Dec 2024 09:48:44 +0100 Subject: [PATCH 4/6] Fix indexer template --- charts/windmill/templates/indexer.yaml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/charts/windmill/templates/indexer.yaml b/charts/windmill/templates/indexer.yaml index f5628b8..659d5f1 100644 --- a/charts/windmill/templates/indexer.yaml +++ b/charts/windmill/templates/indexer.yaml @@ -14,7 +14,7 @@ spec: strategy: type: RollingUpdate rollingUpdate: - maxSurge: 3 + maxSurge: 1 maxUnavailable: 0 selector: matchLabels: @@ -110,26 +110,7 @@ spec: - name: "S3_CACHE_BUCKET" value: "{{ $.Values.enterprise.s3CacheBucket }}" {{ end }} - {{if .Values.enterprise.scimTokenSecretName}} - - name: "SCIM_TOKEN" - valueFrom: - secretKeyRef: - name: "{{ .Values.enterprise.scimTokenSecretName }}" - key: "{{ .Values.enterprise.scimTokenSecretKey }}" - {{ else if .Values.enterprise.scimToken}} - - name: "SCIM_TOKEN" - value: "{{ .Values.enterprise.scimToken }}" - {{ end }} - {{ end }} - {{ if .Values.windmill.openaiAzureBasePath}} - - name: OPENAI_AZURE_BASE_PATH - value: "{{ .Values.windmill.openaiAzureBasePath }}" - {{ end }} - {{ if .Values.windmill.cookieDomain }} - - name: "COOKIE_DOMAIN" - value: "{{ .Values.windmill.cookieDomain }}" - {{ end }} - + resources: {{ toYaml .Values.windmill.indexer.resources | indent 12 }} {{- with .Values.windmill.indexer.nodeSelector }} From 2954936865accfdec0eaec5a4fd2e2508c6e0ec1 Mon Sep 17 00:00:00 2001 From: wendrul Date: Thu, 5 Dec 2024 11:06:09 +0100 Subject: [PATCH 5/6] Fix indexer template --- charts/windmill/templates/indexer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/windmill/templates/indexer.yaml b/charts/windmill/templates/indexer.yaml index 659d5f1..5824fb2 100644 --- a/charts/windmill/templates/indexer.yaml +++ b/charts/windmill/templates/indexer.yaml @@ -110,7 +110,7 @@ spec: - name: "S3_CACHE_BUCKET" value: "{{ $.Values.enterprise.s3CacheBucket }}" {{ end }} - + {{ end }} resources: {{ toYaml .Values.windmill.indexer.resources | indent 12 }} {{- with .Values.windmill.indexer.nodeSelector }} From e566f62ec889da0dc9ffa9e93e7c620db8540fdd Mon Sep 17 00:00:00 2001 From: wendrul Date: Thu, 5 Dec 2024 12:35:31 +0100 Subject: [PATCH 6/6] Bump chart version --- charts/windmill/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/windmill/Chart.yaml b/charts/windmill/Chart.yaml index a749f88..c9260d2 100644 --- a/charts/windmill/Chart.yaml +++ b/charts/windmill/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: windmill type: application -version: 2.0.324 +version: 2.0.325 appVersion: 1.434.2 dependencies: - condition: postgresql.enabled