From f5ad4c8bd9055da00580bf64d42e26b64c742e44 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 27 Oct 2025 13:27:59 -0400 Subject: [PATCH] Remove PostgREST (#41299) This PR removes the PostgREST containers and deployments, as we're no longer using it. Release Notes: - N/A --- Procfile.postgrest | 2 - Procfile.web | 1 - compose.yml | 26 ---- crates/collab/k8s/postgrest.template.yml | 175 ----------------------- crates/collab/postgrest_app.conf | 4 - crates/collab/postgrest_llm.conf | 4 - script/deploy-postgrest | 20 --- 7 files changed, 232 deletions(-) delete mode 100644 Procfile.postgrest delete mode 100644 crates/collab/k8s/postgrest.template.yml delete mode 100644 crates/collab/postgrest_app.conf delete mode 100644 crates/collab/postgrest_llm.conf delete mode 100755 script/deploy-postgrest diff --git a/Procfile.postgrest b/Procfile.postgrest deleted file mode 100644 index acab58e086ca15426b58529e2055b4126f65467a..0000000000000000000000000000000000000000 --- a/Procfile.postgrest +++ /dev/null @@ -1,2 +0,0 @@ -app: postgrest crates/collab/postgrest_app.conf -llm: postgrest crates/collab/postgrest_llm.conf diff --git a/Procfile.web b/Procfile.web index 814055514498124d1f20b1fed51f23a5809819a9..63190fc2ee1f57b3576236fafa08554b9e67b575 100644 --- a/Procfile.web +++ b/Procfile.web @@ -1,2 +1 @@ -postgrest_llm: postgrest crates/collab/postgrest_llm.conf website: cd ../zed.dev; npm run dev -- --port=3000 diff --git a/compose.yml b/compose.yml index 00a5780b597738260f90020f139627e7d0b0107c..cee63e968b2153235bd47dec1429ccbc5a55db8e 100644 --- a/compose.yml +++ b/compose.yml @@ -33,32 +33,6 @@ services: volumes: - ./livekit.yaml:/livekit.yaml - postgrest_app: - image: docker.io/postgrest/postgrest - container_name: postgrest_app - ports: - - 8081:8081 - environment: - PGRST_DB_URI: postgres://postgres@postgres:5432/zed - volumes: - - ./crates/collab/postgrest_app.conf:/etc/postgrest.conf - command: postgrest /etc/postgrest.conf - depends_on: - - postgres - - postgrest_llm: - image: docker.io/postgrest/postgrest - container_name: postgrest_llm - ports: - - 8082:8082 - environment: - PGRST_DB_URI: postgres://postgres@postgres:5432/zed_llm - volumes: - - ./crates/collab/postgrest_llm.conf:/etc/postgrest.conf - command: postgrest /etc/postgrest.conf - depends_on: - - postgres - stripe-mock: image: docker.io/stripe/stripe-mock:v0.178.0 ports: diff --git a/crates/collab/k8s/postgrest.template.yml b/crates/collab/k8s/postgrest.template.yml deleted file mode 100644 index 4819408bffd629235d47fb6be930baf48d982c7b..0000000000000000000000000000000000000000 --- a/crates/collab/k8s/postgrest.template.yml +++ /dev/null @@ -1,175 +0,0 @@ ---- -kind: Service -apiVersion: v1 -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: postgrest - annotations: - service.beta.kubernetes.io/do-loadbalancer-name: "postgrest-${ZED_KUBE_NAMESPACE}" - service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443" - service.beta.kubernetes.io/do-loadbalancer-certificate-id: ${ZED_DO_CERTIFICATE_ID} - service.beta.kubernetes.io/do-loadbalancer-disable-lets-encrypt-dns-records: "true" -spec: - type: LoadBalancer - selector: - app: nginx - ports: - - name: web - protocol: TCP - port: 443 - targetPort: 8080 - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: nginx -spec: - replicas: 1 - selector: - matchLabels: - app: nginx - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:latest - ports: - - containerPort: 8080 - protocol: TCP - volumeMounts: - - name: nginx-config - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf - volumes: - - name: nginx-config - configMap: - name: nginx-config - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: nginx-config -data: - nginx.conf: | - events {} - - http { - server { - listen 8080; - - location /app/ { - proxy_pass http://postgrest-app:8080/; - } - - location /llm/ { - proxy_pass http://postgrest-llm:8080/; - } - } - } - ---- -apiVersion: v1 -kind: Service -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: postgrest-app -spec: - selector: - app: postgrest-app - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - ---- -apiVersion: v1 -kind: Service -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: postgrest-llm -spec: - selector: - app: postgrest-llm - ports: - - protocol: TCP - port: 8080 - targetPort: 8080 - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: postgrest-app -spec: - replicas: 1 - selector: - matchLabels: - app: postgrest-app - template: - metadata: - labels: - app: postgrest-app - spec: - containers: - - name: postgrest - image: "postgrest/postgrest" - ports: - - containerPort: 8080 - protocol: TCP - env: - - name: PGRST_SERVER_PORT - value: "8080" - - name: PGRST_DB_URI - valueFrom: - secretKeyRef: - name: database - key: url - - name: PGRST_JWT_SECRET - valueFrom: - secretKeyRef: - name: postgrest - key: jwt_secret - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: ${ZED_KUBE_NAMESPACE} - name: postgrest-llm -spec: - replicas: 1 - selector: - matchLabels: - app: postgrest-llm - template: - metadata: - labels: - app: postgrest-llm - spec: - containers: - - name: postgrest - image: "postgrest/postgrest" - ports: - - containerPort: 8080 - protocol: TCP - env: - - name: PGRST_SERVER_PORT - value: "8080" - - name: PGRST_DB_URI - valueFrom: - secretKeyRef: - name: llm-database - key: url - - name: PGRST_JWT_SECRET - valueFrom: - secretKeyRef: - name: postgrest - key: jwt_secret diff --git a/crates/collab/postgrest_app.conf b/crates/collab/postgrest_app.conf deleted file mode 100644 index 5d3b0e65b738ed2291c782f62d7e45a8b43c9895..0000000000000000000000000000000000000000 --- a/crates/collab/postgrest_app.conf +++ /dev/null @@ -1,4 +0,0 @@ -db-uri = "postgres://postgres@localhost/zed" -server-port = 8081 -jwt-secret = "the-postgrest-jwt-secret-for-authorization" -log-level = "info" diff --git a/crates/collab/postgrest_llm.conf b/crates/collab/postgrest_llm.conf deleted file mode 100644 index 3a0cdfa4933065f6ac4beeb6f5ec52b0c6cecf0a..0000000000000000000000000000000000000000 --- a/crates/collab/postgrest_llm.conf +++ /dev/null @@ -1,4 +0,0 @@ -db-uri = "postgres://postgres@localhost/zed_llm" -server-port = 8082 -jwt-secret = "the-postgrest-jwt-secret-for-authorization" -log-level = "info" diff --git a/script/deploy-postgrest b/script/deploy-postgrest deleted file mode 100755 index ca8f3686468e52c41977624e6198e69ca3718a25..0000000000000000000000000000000000000000 --- a/script/deploy-postgrest +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -set -eu -source script/lib/deploy-helpers.sh - -if [[ $# != 1 ]]; then - echo "Usage: $0 (postgrest not needed on preview or nightly)" - exit 1 -fi -environment=$1 - -export_vars_for_environment ${environment} - -export ZED_DO_CERTIFICATE_ID=$(doctl compute certificate list --format ID --no-header) -export ZED_KUBE_NAMESPACE=${environment} - -target_zed_kube_cluster -envsubst < crates/collab/k8s/postgrest.template.yml | kubectl apply -f - - -echo "deployed postgrest"