Skip to content

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(prod,infra): Add prod values and clean up infra (#8238)

Aarushif6b5e13c2f76
diff --git a/autogpt_platform/infra/helm/autogpt-server/templates/backendconfig.yaml b/autogpt_platform/infra/helm/autogpt-server/templates/backendconfig.yaml
new file mode 100644
index 0000000000..da23ed215b
--- /dev/null
+++ b/autogpt_platform/infra/helm/autogpt-server/templates/backendconfig.yaml
@@ -0,0 +1,26 @@
+apiVersion: cloud.google.com/v1
+kind: BackendConfig
+metadata:
+ name: {{ include "autogpt-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:{{ .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 }}
+ timeoutSec: 1800
+ connectionDraining:
+ drainingTimeoutSec: 1800
\ No newline at end of file
diff --git a/autogpt_platform/infra/helm/autogpt-server/templates/deployment-executor.yaml b/autogpt_platform/infra/helm/autogpt-server/templates/deployment-executor.yaml
new file mode 100644
index 0000000000..b8f239e7e2
--- /dev/null
+++ b/autogpt_platform/infra/helm/autogpt-server/templates/deployment-executor.yaml
@@ -0,0 +1,68 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "autogpt-server.fullname" . }}-executor
+ labels:
+ app.kubernetes.io/component: executor
+spec:
+ {{- if not .Values.autoscaling.enabled }}
+ replicas: {{ .Values.replicaCount }}
+ {{- end }}
+ selector:
+ matchLabels:
+ app.kubernetes.io/component: executor
+ template:
+ metadata:
+ {{- with .Values.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ labels:
+ app.kubernetes.io/component: executor
+ {{- with .Values.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- with .Values.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ serviceAccountName: {{ include "autogpt-server.serviceAccountName" . }}
+ securityContext:
+ {{- toYaml .Values.podSecurityContext | nindent 8 }}
+ containers:
+ - name: {{ .Chart.Name }}
+ envFrom:
+ - configMapRef:
+ name: {{ include "autogpt-server.fullname" . }}-config
+ securityContext:
+ {{- toYaml .Values.securityContext | nindent 12 }}
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ command: ["poetry", "run", "executor"]
+ ports:
+ - name: http
+ containerPort: {{ .Values.serviceExecutor.port }}
+ protocol: TCP
+ resources:
+ {{- toYaml .Values.resources | nindent 12 }}
+ {{- with .Values.volumeMounts }}
+ volumeMounts:
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- with .Values.volumes }}
+ volumes:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.affinity }}
+ affinity:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
diff --git a/autogpt_platform/infra/helm/autogpt-server/templates/deployment.yaml b/autogpt_platform/infra/helm/autogpt-server/templates/deployment.yaml
index 78b4aed66e..f706105f19 100644
--- a/autogpt_platform/infra/helm/autogpt-server/templates/deployment.yaml
+++ b/autogpt_platform/infra/helm/autogpt-server/templates/deployment.yaml
@@ -44,6 +44,9 @@ spec:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
+ - name: pyro
+ containerPort: 8004
+ protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
@@ -54,15 +57,6 @@ spec:
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
- - name: cloud-sql-proxy
- image: "{{ .Values.cloudSqlProxy.image.repository }}:{{ .Values.cloudSqlProxy.image.tag }}"
- args:
- - "--structured-logs"
- {{- if .Values.cloudSqlProxy.usePrivateIp }}
- - "--private-ip"
- {{- end }}
- - "--port={{ .Values.cloudSqlProxy.port }}"
- - "{{ .Values.cloudSqlProxy.instanceConnectionName }}"
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
diff --git a/autogpt_platform/infra/helm/autogpt-server/templates/service-executor.yaml b/autogpt_platform/infra/helm/autogpt-server/templates/service-executor.yaml
new file mode 100644
index 0000000000..36ef560b22
--- /dev/null
+++ b/autogpt_platform/infra/helm/autogpt-server/templates/service-executor.yaml
@@ -0,0 +1,19 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "autogpt-server.fullname" . }}-executor
+ labels:
+ app.kubernetes.io/component: executor
+ {{- with .Values.service.annotations }}
+ annotations:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ type: {{ .Values.serviceExecutor.type }}
+ ports:
+ - port: {{ .Values.serviceExecutor.port }}
+ targetPort: http
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/component: executor
diff --git a/autogpt_platform/infra/helm/autogpt-server/templates/service.yaml b/autogpt_platform/infra/helm/autogpt-server/templates/service.yaml
index 53d970dbc9..b944873174 100644
--- a/autogpt_platform/infra/helm/autogpt-server/templates/service.yaml
+++ b/autogpt_platform/infra/helm/autogpt-server/templates/service.yaml
@@ -15,5 +15,11 @@ spec:
targetPort: http
protocol: TCP
name: http
+ {{- if .Values.service.pyroDaemonPort }}
+ - port: {{ .Values.service.pyroDaemonPort }}
+ targetPort: pyro
+ protocol: TCP
+ name: pyro
+ {{- end }}
selector:
- {{- include "autogpt-server.selectorLabels" . | nindent 4 }}
+ {{- include "autogpt-server.selectorLabels" . | nindent 4 }}
\ No newline at end of file
diff --git a/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml b/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml
index 5d17aa4078..fa7de98731 100644
--- a/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml
+++ b/autogpt_platform/infra/helm/autogpt-server/values.dev.yaml
@@ -12,10 +12,18 @@ serviceAccount:
service:
type: ClusterIP
- port: 8000
- targetPort: 8000
+ port: 8006
+ pyroDaemonPort: 8004
annotations:
cloud.google.com/neg: '{"ingress": true}'
+ beta.cloud.google.com/backend-config: '{"default": "autogpt-server-backend-config"}'
+
+serviceExecutor:
+ type: ClusterIP
+ port: 8002
+ targetPort: 8002
+ annotations:
+ beta.cloud.google.com/backend-config: '{"default": "autogpt-server-backend-config"}'
ingress:
enabled: true
@@ -33,12 +41,12 @@ ingress:
backend:
service:
name: autogpt-server
- port: 8000
+ port: 8006
defaultBackend:
service:
name: autogpt-server
port:
- number: 8000
+ number: 8006
resources:
requests:
@@ -46,12 +54,12 @@ resources:
memory: 256Mi
limits:
cpu: 2
- memory: 2Gi
+ memory: 10Gi
livenessProbe:
httpGet:
path: /docs
- port: 8000
+ port: 8006
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
@@ -59,7 +67,7 @@ livenessProbe:
readinessProbe:
httpGet:
path: /docs
- port: 8000
+ port: 8006
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
@@ -67,28 +75,39 @@ readinessProbe:
domain: "dev-server.agpt.co"
-cloudSqlProxy:
- image:
- repository: gcr.io/cloud-sql-connectors/cloud-sql-proxy
- tag: 2.11.4
- instanceConnectionName: "agpt-dev:us-central1:agpt-server-dev"
- port: 5432
- resources:
- requests:
- memory: "2Gi"
- cpu: "1"
+cors:
+ allowOrigin: "https://dev-builder.agpt.co"
+ allowMethods:
+ - "GET"
+ - "POST"
+ - "PUT"
+ - "DELETE"
+ - "OPTIONS"
+ allowHeaders:
+ - "Content-Type"
+ - "Authorization"
+ maxAge: 3600
+ allowCredentials: true
env:
APP_ENV: "dev"
PYRO_HOST: "0.0.0.0"
- NUM_GRAPH_WORKERS: 100
- NUM_NODE_WORKERS: 5
+ ENABLE_AUTH: "true"
REDIS_HOST: "redis-dev-master.redis-dev.svc.cluster.local"
REDIS_PORT: "6379"
+ OPENAI_API_KEY: ""
+ SUPABASE_JWT_SECRET: ""
+ REDIS_PASSWORD: "password"
+ NUM_GRAPH_WORKERS: 10
+ NUM_NODE_WORKERS: 5
+ DATABASE_URL: ""
+ SENTRY_DSN: ""
+ ENABLE_CREDIT: "true"
BACKEND_CORS_ALLOW_ORIGINS: '["https://dev-builder.agpt.co"]'
SUPABASE_SERVICE_ROLE_KEY: ""
GITHUB_CLIENT_ID: ""
GITHUB_CLIENT_SECRET: ""
- FRONTEND_BASE_URL: ""
- SUPABASE_URL: ""
- SUPABASE_JWT_SECRET: ""
+ FRONTEND_BASE_URL: "https://dev-builder.agpt.co/"
+ SUPABASE_URL: "https://adfjtextkuilwuhzdjpf.supabase.co"
+ AGENTSERVER_HOST: "autogpt-server.dev-agpt.svc.cluster.local"
+ EXECUTIONMANAGER_HOST: "autogpt-server-executor.dev-agpt.svc.cluster.local"
\ No newline at end of file
diff --git a/autogpt_platform/infra/helm/autogpt-server/values.prod.yaml b/autogpt_platform/infra/helm/autogpt-server/values.prod.yaml
new file mode 100644
index 0000000000..cafbe2f1dc
--- /dev/null
+++ b/autogpt_platform/infra/helm/autogpt-server/values.prod.yaml
@@ -0,0 +1,113 @@
+# prod values, overwrite base values as needed.
+
+image:
+ repository: us-east1-docker.pkg.dev/agpt-prod/agpt-backend-prod/agpt-backend-prod
+ pullPolicy: Always
+ tag: "latest"
+
+serviceAccount:
+ annotations:
+ iam.gke.io/gcp-service-account: "[email protected]"
+ name: "prod-agpt-server-sa"
+
+service:
+ type: ClusterIP
+ port: 8006
+ pyroDaemonPort: 8004
+ annotations:
+ cloud.google.com/neg: '{"ingress": true}'
+ beta.cloud.google.com/backend-config: '{"default": "autogpt-server-backend-config"}'
+
+serviceExecutor:
+ type: ClusterIP
+ port: 8002
+ targetPort: 8002
+ annotations:
+ beta.cloud.google.com/backend-config: '{"default": "autogpt-server-backend-config"}'
+
+ingress:
+ enabled: true
+ className: "gce"
+ annotations:
+ kubernetes.io/ingress.class: gce
+ kubernetes.io/ingress.global-static-ip-name: "agpt-prod-agpt-backend-ip"
+ networking.gke.io/managed-certificates: "autogpt-server-cert"
+ networking.gke.io/v1beta1.FrontendConfig: "autogpt-server-frontend-config"
+ hosts:
+ - host: backend.agpt.co
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: autogpt-server
+ port: 8006
+ defaultBackend:
+ service:
+ name: autogpt-server
+ port:
+ number: 8006
+
+resources:
+ requests:
+ cpu: 200m
+ memory: 256Mi
+ limits:
+ cpu: 2
+ memory: 10Gi
+
+cors:
+ allowOrigin: "https://platform.agpt.co"
+ allowMethods:
+ - "GET"
+ - "POST"
+ - "PUT"
+ - "DELETE"
+ - "OPTIONS"
+ allowHeaders:
+ - "Content-Type"
+ - "Authorization"
+ maxAge: 3600
+ allowCredentials: true
+
+livenessProbe:
+ httpGet:
+ path: /docs
+ port: 8006
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 6
+readinessProbe:
+ httpGet:
+ path: /docs
+ port: 8006
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ timeoutSeconds: 5
+ failureThreshold: 6
+
+domain: "backend.agpt.co"
+
+env:
+ APP_ENV: "prod"
+ PYRO_HOST: "0.0.0.0"
+ ENABLE_AUTH: "true"
+ REDIS_HOST: "redis-prod-master.redis-prod.svc.cluster.local"
+ REDIS_PORT: "6379"
+ OPENAI_API_KEY: ""
+ REDIS_PASSWORD: ""
+ NUM_GRAPH_WORKERS: 10
+ NUM_NODE_WORKERS: 5
+ ENABLE_CREDIT: "true"
+ BACKEND_CORS_ALLOW_ORIGINS: '["https://platform.agpt.co"]'
+ SUPABASE_JWT_SECRET: ""
+ DATABASE_URL: ""
+ SENTRY_DSN: ""
+ SUPABASE_SERVICE_ROLE_KEY: ""
+ FRONTEND_BASE_URL: "https://platform.agpt.co/"
+ SUPABASE_URL: "https://bgwpwdsxblryihinutbx.supabase.co"
+ AGENTSERVER_HOST: "autogpt-server.prod-agpt.svc.cluster.local"
+ EXECUTIONMANAGER_HOST: "autogpt-server-executor.prod-agpt.svc.cluster.local"
+ GITHUB_CLIENT_ID: ""
+ GITHUB_CLIENT_SECRET: ""
diff --git a/autogpt_platform/infra/helm/autogpt-server/values.yaml b/autogpt_platform/infra/helm/autogpt-server/values.yaml
index 3bdfd8515a..8296416ef7 100644
--- a/autogpt_platform/infra/helm/autogpt-server/values.yaml
+++ b/autogpt_platform/infra/helm/autogpt-server/values.yaml
@@ -45,17 +45,9 @@ resources:
cpu: 100m
memory: 128Mi
limits:
- cpu: 500m
- memory: 512Mi
-
-livenessProbe:
- httpGet:
- path: /
- port: http
-readinessProbe:
- httpGet:
- path: /
- port: http
+ cpu: 1
+ memory: 1Gi
+
autoscaling:
enabled: false
@@ -75,6 +67,21 @@ affinity: {}
domain: ""
+cors:
+ allowOrigins:
+ - "https://dev-builder.agpt.co"
+ allowMethods:
+ - "GET"
+ - "POST"
+ - "PUT"
+ - "DELETE"
+ - "OPTIONS"
+ allowHeaders:
+ - "Content-Type"
+ - "Authorization"
+ maxAge: 3600
+ allowCredentials: true
+
cloudSqlProxy:
image:
repository: gcr.io/cloud-sql-connectors/cloud-sql-proxy