113 lines
No EOL
3.3 KiB
YAML
113 lines
No EOL
3.3 KiB
YAML
apiVersion: serving.knative.dev/v1
|
|
kind: Service
|
|
metadata:
|
|
name: accessible-video-worker
|
|
annotations:
|
|
run.googleapis.com/ingress: internal
|
|
run.googleapis.com/execution-environment: gen2
|
|
autoscaling.knative.dev/minScale: "0"
|
|
autoscaling.knative.dev/maxScale: "5"
|
|
spec:
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
autoscaling.knative.dev/maxScale: "5"
|
|
autoscaling.knative.dev/minScale: "0"
|
|
run.googleapis.com/execution-environment: gen2
|
|
run.googleapis.com/cpu-throttling: "false"
|
|
spec:
|
|
containerConcurrency: 1
|
|
timeoutSeconds: 3600
|
|
serviceAccountName: accessible-video-worker@PROJECT_ID.iam.gserviceaccount.com
|
|
containers:
|
|
- image: gcr.io/PROJECT_ID/accessible-video-worker:latest
|
|
env:
|
|
- name: APP_ENV
|
|
value: "prod"
|
|
- name: PYTHONPATH
|
|
value: "/app"
|
|
- name: PYTHONUNBUFFERED
|
|
value: "1"
|
|
- name: PYTHONDONTWRITEBYTECODE
|
|
value: "1"
|
|
- name: C_FORCE_ROOT
|
|
value: "1"
|
|
- name: MONGODB_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-url
|
|
key: latest
|
|
- name: REDIS_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: redis-url
|
|
key: latest
|
|
- name: GEMINI_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: gemini-api-key
|
|
key: latest
|
|
- name: ELEVENLABS_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: elevenlabs-api-key
|
|
key: latest
|
|
- name: GCS_BUCKET_NAME
|
|
value: "accessible-video-storage"
|
|
- name: GOOGLE_CLOUD_PROJECT
|
|
value: "PROJECT_ID"
|
|
# OpenTelemetry configuration
|
|
- name: OTEL_SERVICE_NAME
|
|
value: "accessible-video-worker"
|
|
- name: OTEL_SERVICE_VERSION
|
|
value: "1.0.0"
|
|
- name: OTEL_TRACES_EXPORTER
|
|
value: "gcp_trace"
|
|
- name: OTEL_METRICS_EXPORTER
|
|
value: "prometheus"
|
|
- name: OTEL_LOGS_EXPORTER
|
|
value: "none"
|
|
# Sentry configuration
|
|
- name: SENTRY_DSN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: sentry-dsn
|
|
key: latest
|
|
- name: SENTRY_ENVIRONMENT
|
|
value: "production"
|
|
# Celery configuration
|
|
- name: CELERY_BROKER_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: redis-url
|
|
key: latest
|
|
- name: CELERY_RESULT_BACKEND
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: redis-url
|
|
key: latest
|
|
resources:
|
|
limits:
|
|
memory: "4Gi"
|
|
cpu: "4000m"
|
|
requests:
|
|
memory: "2Gi"
|
|
cpu: "2000m"
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- python
|
|
- -c
|
|
- "from celery import Celery; app=Celery('app'); print('Worker healthy')"
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 120
|
|
timeoutSeconds: 15
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- python
|
|
- -c
|
|
- "from celery import Celery; app=Celery('app'); print('Worker ready')"
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 60
|
|
timeoutSeconds: 10 |