Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
fix(worker): dockerfile + helm updates#3818
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| {{- if .Values.worker.enabled }} | ||
| {{- include "sim.validateSecrets" . }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "sim.fullname" . }}-worker | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "sim.worker.labels" . | nindent 4 }} | ||
| spec: | ||
| replicas: {{ .Values.worker.replicaCount }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "sim.worker.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| {{- with .Values.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "sim.worker.selectorLabels" . | nindent 8 }} | ||
| {{- with .Values.podLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| serviceAccountName: {{ include "sim.serviceAccountName" . }} | ||
| {{- include "sim.podSecurityContext" .Values.worker | nindent 6 }} | ||
| {{- include "sim.nodeSelector" .Values.worker | nindent 6 }} | ||
| {{- include "sim.tolerations" .Values | nindent 6 }} | ||
| {{- include "sim.affinity" .Values | nindent 6 }} | ||
icecrasher321 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| containers: | ||
| - name: worker | ||
| image: {{ include "sim.image" (dict "context" . "image" .Values.worker.image) }} | ||
| imagePullPolicy: {{ .Values.worker.image.pullPolicy }} | ||
| command: ["bun", "apps/sim/dist/worker.cjs"] | ||
| ports: | ||
| - name: health | ||
| containerPort: {{ .Values.worker.healthPort }} | ||
| protocol: TCP | ||
| env: | ||
| - name: DATABASE_URL | ||
| value: {{ include "sim.databaseUrl" . | quote }} | ||
| {{- if .Values.app.env.REDIS_URL }} | ||
| - name: REDIS_URL | ||
| value: {{ .Values.app.env.REDIS_URL | quote }} | ||
| {{- end }} | ||
| - name: WORKER_PORT | ||
| value: {{ .Values.worker.healthPort | quote }} | ||
| {{- if .Values.telemetry.enabled }} | ||
| - name: OTEL_EXPORTER_OTLP_ENDPOINT | ||
| value: "http://{{ include "sim.fullname" . }}-otel-collector:4318" | ||
| - name: OTEL_SERVICE_NAME | ||
| value: sim-worker | ||
| - name: OTEL_SERVICE_VERSION | ||
| value: {{ .Chart.AppVersion | quote }} | ||
| - name: OTEL_RESOURCE_ATTRIBUTES | ||
| value: "service.name=sim-worker,service.version={{ .Chart.AppVersion }},deployment.environment={{ .Values.worker.env.NODE_ENV }}" | ||
| {{- end }} | ||
| {{- range $key, $value := .Values.worker.env }} | ||
| {{- if ne $key "WORKER_PORT" }} | ||
| - name: {{ $key }} | ||
| value: {{ $value | quote }} | ||
| {{- end }} | ||
icecrasher321 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| {{- end }} | ||
| {{- with .Values.extraEnvVars }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| envFrom: | ||
| - secretRef: | ||
| name: {{ include "sim.appSecretName" . }} | ||
| {{- if .Values.postgresql.enabled }} | ||
| - secretRef: | ||
| name: {{ include "sim.postgresqlSecretName" . }} | ||
| {{- else if .Values.externalDatabase.enabled }} | ||
| - secretRef: | ||
| name: {{ include "sim.externalDbSecretName" . }} | ||
| {{- end }} | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /health/live | ||
| port: health | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 30 | ||
| timeoutSeconds: 5 | ||
| failureThreshold: 3 | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /health | ||
| port: health | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 30 | ||
| timeoutSeconds: 5 | ||
| failureThreshold: 3 | ||
| {{- include "sim.resources" .Values.worker | nindent 10 }} | ||
| {{- include "sim.securityContext" .Values.worker | nindent 10 }} | ||
| {{- end }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -358,6 +358,56 @@ realtime: | ||
| extraVolumes: [] | ||
| extraVolumeMounts: [] | ||
| # BullMQ worker configuration (processes background jobs when Redis is available) | ||
| # Uses the same image as the main app with a different command | ||
| worker: | ||
| # Enable/disable the worker deployment (requires REDIS_URL to be set in app.env) | ||
| enabled: false | ||
icecrasher321 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| # Image configuration (defaults to same image as app) | ||
| image: | ||
| repository: simstudioai/simstudio | ||
| tag: latest | ||
| pullPolicy: Always | ||
| # Number of replicas | ||
| replicaCount: 1 | ||
| # Health check port (worker exposes a lightweight HTTP health server) | ||
| healthPort: 3001 | ||
| # Resource limits and requests | ||
| resources: | ||
| limits: | ||
| memory: "4Gi" | ||
| cpu: "1000m" | ||
| requests: | ||
| memory: "2Gi" | ||
| cpu: "500m" | ||
| # Node selector for pod scheduling | ||
| nodeSelector: {} | ||
| # Pod security context | ||
| podSecurityContext: | ||
| fsGroup: 1001 | ||
| # Container security context | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 1001 | ||
| # Environment variables (worker-specific tuning) | ||
| env: | ||
| NODE_ENV: "production" | ||
| WORKER_CONCURRENCY_WORKFLOW: "50" | ||
| WORKER_CONCURRENCY_WEBHOOK: "30" | ||
| WORKER_CONCURRENCY_SCHEDULE: "20" | ||
| WORKER_CONCURRENCY_MOTHERSHIP_JOB: "10" | ||
| WORKER_CONCURRENCY_CONNECTOR_SYNC: "5" | ||
| WORKER_CONCURRENCY_DOCUMENT_PROCESSING: "20" | ||
| WORKER_CONCURRENCY_NOTIFICATION_DELIVERY: "10" | ||
| # Database migrations job configuration | ||
| migrations: | ||
| # Enable/disable migrations job | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.