AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(infra,prod): Add prod values builder and ws (#8262)
Aarushif811a6ffc0fd
diff --git a/autogpt_platform/infra/helm/autogpt-builder/templates/configmap.yaml b/autogpt_platform/infra/helm/autogpt-builder/templates/configmap.yamlnew file mode 100644index 0000000000..0841631cfb--- /dev/null+++ b/autogpt_platform/infra/helm/autogpt-builder/templates/configmap.yaml@@ -0,0 +1,11 @@+apiVersion: v1+kind: ConfigMap+metadata:+ name: {{ include "autogpt-builder.fullname" . }}-config+ labels:+ {{- include "autogpt-builder.labels" . | nindent 4 }}+data:+ .env.local: |-+ {{- range $key, $value := .Values.env }}+ {{ $key }}={{ $value }}+ {{- end }}\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-builder/templates/frontendconfig.yaml b/autogpt_platform/infra/helm/autogpt-builder/templates/frontendconfig.yamlindex ee9ae97034..853bc15de3 100644--- a/autogpt_platform/infra/helm/autogpt-builder/templates/frontendconfig.yaml+++ b/autogpt_platform/infra/helm/autogpt-builder/templates/frontendconfig.yaml@@ -5,4 +5,4 @@ metadata:spec:redirectToHttps:enabled: true- responseCodeName: 301\ No newline at end of file+ responseCodeName: MOVED_PERMANENTLY_DEFAULT\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-builder/templates/managedcert.yaml b/autogpt_platform/infra/helm/autogpt-builder/templates/managedcert.yamlindex c1d9372478..1f32c4d7ed 100644--- a/autogpt_platform/infra/helm/autogpt-builder/templates/managedcert.yaml+++ b/autogpt_platform/infra/helm/autogpt-builder/templates/managedcert.yaml@@ -4,4 +4,5 @@ metadata:name: {{ include "autogpt-builder.fullname" . }}-certspec:domains:- - {{ .Values.domain }}\ No newline at end of file+ - {{ .Values.domain }}+ - {{ .Values.wwwDomain }}\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-builder/values.dev.yaml b/autogpt_platform/infra/helm/autogpt-builder/values.dev.yamlindex 9c81de1db7..5a4ff9121d 100644--- a/autogpt_platform/infra/helm/autogpt-builder/values.dev.yaml+++ b/autogpt_platform/infra/helm/autogpt-builder/values.dev.yaml@@ -53,13 +53,17 @@ livenessProbe: nullreadinessProbe: nulldomain: "dev-builder.agpt.co"+wwwDomain: "www.dev-builder.agpt.co"env:APP_ENV: "dev"- NEXT_PUBLIC_AGPT_SERVER_URL: ["http://agpt-server:8000/api"]+ NEXT_PUBLIC_AGPT_SERVER_URL: ""GOOGLE_CLIENT_ID: ""GOOGLE_CLIENT_SECRET: ""NEXT_PUBLIC_SUPABASE_URL: ""NEXT_PUBLIC_SUPABASE_ANON_KEY: ""- NEXT_PUBLIC_BEHAVE_AS: "CLOUD"\ No newline at end of file+ SENTRY_AUTH_TOKEN: ""+ NEXT_PUBLIC_AUTH_CALLBACK_URL: "https://dev-server.agpt.co/auth/callback"+ NEXT_PUBLIC_AGPT_WS_SERVER_URL: "wss://dev-ws-server.agpt.co/ws"+ NEXT_PUBLIC_AGPT_MARKETPLACE_URL: "https://dev-market.agpt.co/api/v1/market"\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-builder/values.prod.yaml b/autogpt_platform/infra/helm/autogpt-builder/values.prod.yamlnew file mode 100644index 0000000000..f1f3a90efc--- /dev/null+++ b/autogpt_platform/infra/helm/autogpt-builder/values.prod.yaml@@ -0,0 +1,88 @@+# prod values, overwrite base values as needed.++image:+ repository: us-east1-docker.pkg.dev/agpt-prod/agpt-frontend-prod/agpt-frontend-prod+ pullPolicy: Always+ tag: "latest"++serviceAccount:+ annotations:+ iam.gke.io/gcp-service-account: "[email protected]"+ name: "prod-agpt-builder-sa"++service:+ type: ClusterIP+ port: 8000+ targetPort: 3000+ annotations:+ cloud.google.com/neg: '{"ingress": true}'++ingress:+ enabled: true+ className: "gce"+ annotations:+ kubernetes.io/ingress.class: gce+ kubernetes.io/ingress.global-static-ip-name: "agpt-prod-agpt-frontend-ip"+ networking.gke.io/managed-certificates: "autogpt-builder-cert"+ kubernetes.io/ingress.allow-http: "true"+ networking.gke.io/v1beta1.FrontendConfig: "autogpt-builder-frontend-config"+ hosts:+ - host: platform.agpt.co+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: autogpt-builder+ port: 8000+ - host: www.platform.agpt.co+ paths:+ - path: /+ pathType: Prefix+ backend:+ service:+ name: autogpt-builder+ port: 8000+ defaultBackend:+ service:+ name: autogpt-builder+ port:+ number: 8000++resources:+ requests:+ cpu: 100m+ memory: 128Mi+ limits:+ cpu: 500m+ memory: 512Mi++livenessProbe: null+readinessProbe: null++domain: "platform.agpt.co"+wwwDomain: "www.platform.agpt.co"++volumes:+ - name: env-config+ configMap:+ name: 'autogpt-builder-config'++volumeMounts:+ - name: env-config+ mountPath: /app/.env.local+ subPath: .env.local+ readonly: true+++env:+ APP_ENV: "prod"+ NEXT_PUBLIC_AUTH_CALLBACK_URL: "https://backend.agpt.co/auth/callback"+ NEXT_PUBLIC_AGPT_SERVER_URL: "https://backend.agpt.co/api"+ NEXT_PUBLIC_AGPT_WS_SERVER_URL: "wss://ws-backend.agpt.co/ws"+ NEXT_PUBLIC_AGPT_MARKETPLACE_URL: "https://market.agpt.co/api/v1/market"+ NEXT_PUBLIC_SUPABASE_ANON_KEY: ""+ NEXT_PUBLIC_SUPABASE_URL: "https://bgwpwdsxblryihinutbx.supabase.co"+ GOOGLE_CLIENT_ID: ""+ GOOGLE_CLIENT_SECRET: ""+ SENTRY_AUTH_TOKEN: ""\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-websocket-server/templates/backendconfig.yaml b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/backendconfig.yamlnew file mode 100644index 0000000000..cfc16c820d--- /dev/null+++ b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/backendconfig.yaml@@ -0,0 +1,26 @@+apiVersion: cloud.google.com/v1+kind: BackendConfig+metadata:+ name: {{ include "autogpt-websocket-server.fullname" . }}-backend-config+spec:+ customRequestHeaders:+ headers:+ - "Access-Control-Allow-Origin:{{ .Values.cors.allowOrigin }}"+ - "Access-Control-Allow-Methods:{{ .Values.cors.allowMethods | join "," }}"+ - "Access-Control-Allow-Headers:{{ .Values.cors.allowHeaders | join "," }}"+ - "Access-Control-Max-Age:{{ .Values.cors.maxAge }}"+ {{- if .Values.cors.allowCredentials }}+ - "Access-Control-Allow-Credentials:true"+ {{- end }}+ customResponseHeaders:+ headers:+ - "Access-Control-Allow-Origin:https://dev-builder.agpt.co"+ - "Access-Control-Allow-Methods:{{ .Values.cors.allowMethods | join "," }}"+ - "Access-Control-Allow-Headers:{{ .Values.cors.allowHeaders | join "," }}"+ - "Access-Control-Max-Age:{{ .Values.cors.maxAge }}"+ {{- if .Values.cors.allowCredentials }}+ - "Access-Control-Allow-Credentials:true"+ {{- end }}+ timeoutSec: 1800+ connectionDraining:+ drainingTimeoutSec: 1800\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-websocket-server/templates/frontendconfig.yaml b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/frontendconfig.yamlnew file mode 100644index 0000000000..bfb91591d7--- /dev/null+++ b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/frontendconfig.yaml@@ -0,0 +1,6 @@+apiVersion: networking.gke.io/v1beta1+kind: FrontendConfig+metadata:+ name: {{ include "autogpt-websocket-server.fullname" . }}-frontend-config+spec:+ timeoutSec: 1800diff --git a/autogpt_platform/infra/helm/autogpt-websocket-server/templates/service.yaml b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/service.yamlindex e1c89caa90..d30a6d0bfc 100644--- a/autogpt_platform/infra/helm/autogpt-websocket-server/templates/service.yaml+++ b/autogpt_platform/infra/helm/autogpt-websocket-server/templates/service.yaml@@ -4,6 +4,10 @@ metadata:name: {{ include "autogpt-websocket-server.fullname" . }}labels:{{- include "autogpt-websocket-server.labels" . | nindent 4 }}+ {{- with .Values.service.annotations }}+ annotations:+ {{- toYaml . | nindent 4 }}+ {{- end }}spec:type: {{ .Values.service.type }}ports:diff --git a/autogpt_platform/infra/helm/autogpt-websocket-server/values.dev.yaml b/autogpt_platform/infra/helm/autogpt-websocket-server/values.dev.yamlindex 529dc6f179..e899d2b7c3 100644--- a/autogpt_platform/infra/helm/autogpt-websocket-server/values.dev.yaml+++ b/autogpt_platform/infra/helm/autogpt-websocket-server/values.dev.yaml@@ -8,6 +8,9 @@ image:service:type: ClusterIPport: 8001+ annotations:+ cloud.google.com/neg: '{"ingress": true}'+ beta.cloud.google.com/backend-config: '{"default": "autogpt-websocket-server-backend-config"}'ingress:enabled: true@@ -19,7 +22,7 @@ ingress:hosts:- host: dev-ws-server.agpt.copaths:- - path: /+ - path: /wspathType: Prefixbackend:service:@@ -44,6 +47,20 @@ resources:autoscaling:enabled: false+cors:+ allowOrigins: "https://dev-builder.agpt.co"+ allowMethods:+ - "GET"+ - "POST"+ - "PUT"+ - "DELETE"+ - "OPTIONS"+ allowHeaders:+ - "Content-Type"+ - "Authorization"+ maxAge: 3600+ allowCredentials: true+readinessProbe:httpGet:path: /@@ -60,5 +77,4 @@ livenessProbe:env:REDIS_HOST: "redis-dev-master.redis-dev.svc.cluster.local"REDIS_PORT: "6379"- REDIS_PASSWORD: "password"- BACKEND_CORS_ALLOW_ORIGINS: "https://dev-builder.agpt.co"\ No newline at end of file+ REDIS_PASSWORD: "password"\ No newline at end of filediff --git a/autogpt_platform/infra/helm/autogpt-websocket-server/values.prod.yaml b/autogpt_platform/infra/helm/autogpt-websocket-server/values.prod.yamlnew file mode 100644index 0000000000..8acdabe187--- /dev/null+++ b/autogpt_platform/infra/helm/autogpt-websocket-server/values.prod.yaml@@ -0,0 +1,81 @@+replicaCount: 1 # not scaling websocket server for now++image:+ repository: us-east1-docker.pkg.dev/agpt-prod/agpt-backend-prod/agpt-backend-prod+ tag: latest+ pullPolicy: Always++service:+ type: ClusterIP+ port: 8001+ annotations:+ cloud.google.com/neg: '{"ingress": true}'+ beta.cloud.google.com/backend-config: '{"default": "autogpt-websocket-server-backend-config"}'++ingress:+ enabled: true+ className: "gce"+ annotations:+ kubernetes.io/ingress.class: gce+ kubernetes.io/ingress.global-static-ip-name: "agpt-prod-agpt-ws-backend-ip"+ networking.gke.io/managed-certificates: "autogpt-websocket-server-cert"+ hosts:+ - host: ws-backend.agpt.co+ paths:+ - path: /ws+ pathType: Prefix+ backend:+ service:+ name: autogpt-websocket-server+ port: 8001+ defaultBackend:+ service:+ name: autogpt-websocket-server+ port:+ number: 8001++domain: "ws-backend.agpt.co"++resources:+ limits:+ cpu: 200m+ memory: 256Mi+ requests:+ cpu: 100m+ memory: 128Mi++autoscaling:+ enabled: false++cors:+ allowOrigins: "https://platform.agpt.co"+ allowMethods:+ - "GET"+ - "POST"+ - "PUT"+ - "DELETE"+ - "OPTIONS"+ allowHeaders:+ - "Content-Type"+ - "Authorization"+ maxAge: 3600+ allowCredentials: true++readinessProbe:+ httpGet:+ path: /+ port: 8001+ initialDelaySeconds: 10+ periodSeconds: 5+livenessProbe:+ httpGet:+ path: /+ port: 8001+ initialDelaySeconds: 15+ periodSeconds: 10++env:+ REDIS_HOST: "redis-prod-master.redis-prod.svc.cluster.local"+ REDIS_PORT: "6379"+ REDIS_PASSWORD: ""+ BACKEND_CORS_ALLOW_ORIGINS: '["https://platform.agpt.co"]'\ No newline at end of file