From 813cf32817b62c625a2f6384cc2ef089988fe44a Mon Sep 17 00:00:00 2001 From: wendrul Date: Wed, 16 Oct 2024 14:19:42 +0200 Subject: [PATCH] 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