From a78aedee895dd813ed7f8a372788346bd92f2f57 Mon Sep 17 00:00:00 2001 From: Ben Eggers <64657842+beggers@users.noreply.github.com> Date: Thu, 28 Mar 2024 14:43:15 -0700 Subject: [PATCH] [CLN] Stop clearing the sysdb on each deploy (#1941) ## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - ... - New functionality - ... ## Test plan *How are these changes tested?* - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes *Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs repository](https://github.com/chroma-core/docs)?* --- go/migrations/20240313233558.sql | 13 ++++++++++--- go/migrations/atlas.sum | 10 +++++----- k8s/distributed-chroma/Chart.yaml | 2 +- .../templates/sysdb-migration.yaml | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/go/migrations/20240313233558.sql b/go/migrations/20240313233558.sql index d86bcf072c2..8251b659266 100644 --- a/go/migrations/20240313233558.sql +++ b/go/migrations/20240313233558.sql @@ -1,5 +1,3 @@ -CREATE SCHEMA "public"; - -- Create "collection_metadata" table CREATE TABLE "public"."collection_metadata" ( "collection_id" text NOT NULL, @@ -12,6 +10,7 @@ CREATE TABLE "public"."collection_metadata" ( "updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ("collection_id", "key") ); + -- Create "collections" table CREATE TABLE "public"."collections" ( "id" text NOT NULL, @@ -27,8 +26,10 @@ CREATE TABLE "public"."collections" ( "version" integer NULL DEFAULT 0, PRIMARY KEY ("id") ); + -- Create index "uni_collections_name" to table: "collections" CREATE UNIQUE INDEX "uni_collections_name" ON "public"."collections" ("name"); + -- Create "databases" table CREATE TABLE "public"."databases" ( "id" text NOT NULL, @@ -40,8 +41,10 @@ CREATE TABLE "public"."databases" ( "updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ("id") ); + -- Create index "idx_tenantid_name" to table: "databases" CREATE UNIQUE INDEX "idx_tenantid_name" ON "public"."databases" ("name", "tenant_id"); + -- Create "notifications" table CREATE TABLE "public"."notifications" ( "id" bigserial NOT NULL, @@ -50,6 +53,7 @@ CREATE TABLE "public"."notifications" ( "status" text NULL, PRIMARY KEY ("id") ); + -- Create "record_logs" table CREATE TABLE "public"."record_logs" ( "collection_id" text NOT NULL, @@ -58,6 +62,7 @@ CREATE TABLE "public"."record_logs" ( "record" bytea NULL, PRIMARY KEY ("collection_id", "id") ); + -- Create "segment_metadata" table CREATE TABLE "public"."segment_metadata" ( "segment_id" text NOT NULL, @@ -70,6 +75,7 @@ CREATE TABLE "public"."segment_metadata" ( "updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY ("segment_id", "key") ); + -- Create "segments" table CREATE TABLE "public"."segments" ( "collection_id" text NOT NULL, @@ -84,6 +90,7 @@ CREATE TABLE "public"."segments" ( "file_paths" text NULL DEFAULT '{}', PRIMARY KEY ("collection_id", "id") ); + -- Create "tenants" table CREATE TABLE "public"."tenants" ( "id" text NOT NULL, @@ -93,4 +100,4 @@ CREATE TABLE "public"."tenants" ( "updated_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, "last_compaction_time" bigint NOT NULL, PRIMARY KEY ("id") -); +); \ No newline at end of file diff --git a/go/migrations/atlas.sum b/go/migrations/atlas.sum index 088dd87ccf4..c721849212f 100644 --- a/go/migrations/atlas.sum +++ b/go/migrations/atlas.sum @@ -1,5 +1,5 @@ -h1:a7siLM7ZTF8njH6u0JLRctDcvTDu9/XNvTJ7hmLPyII= -20240313233558.sql h1:shyeY6BuLGJ1Ia/G/hH+NZS6HZqHxhBJ2Pfdoeerz7I= -20240321194713.sql h1:K5CAwiFb9kx+O8E/3Dq2C7jzMa7P+ZvqGL5HtLKe2YU= -20240327075032.sql h1:zE+/KCknuhtExHiKoZSfhFzahpbs2B7O/JgYbfxkjp0= -20240327172649.sql h1:hIFZlonLfEqJwmjC6nYn5xV6O8s8eA5y5JPc3BBbw+E= +h1:VbFQFcsAe42WZWS3v15Jp18vJIP/AYArDrUb5aMADIE= +20240313233558.sql h1:O7r3Z7JRfYqaWJKnYBKloTjWHd/cyFNP6l7s00d3tOk= +20240321194713.sql h1:3nBZIqllmYOaElhRP5wqJqArZZAVE3Zx+leQExleBw0= +20240327075032.sql h1:NphR9dlkaTW7Scc6gUa/EIf4UaIxhrH2cW+J3GkIVvw= +20240327172649.sql h1:cleZo0JtJMH3JxzUcH1tTJBGlzX6tRZFl+o1AgRywfk= diff --git a/k8s/distributed-chroma/Chart.yaml b/k8s/distributed-chroma/Chart.yaml index c6532e29e6f..f0a51511dd2 100644 --- a/k8s/distributed-chroma/Chart.yaml +++ b/k8s/distributed-chroma/Chart.yaml @@ -16,7 +16,7 @@ apiVersion: v2 name: distributed-chroma description: A helm chart for distributed Chroma type: application -version: 0.1.0 +version: 0.1.2 appVersion: "0.4.23" keywords: - chroma diff --git a/k8s/distributed-chroma/templates/sysdb-migration.yaml b/k8s/distributed-chroma/templates/sysdb-migration.yaml index 611d38a8d31..dc62d157603 100644 --- a/k8s/distributed-chroma/templates/sysdb-migration.yaml +++ b/k8s/distributed-chroma/templates/sysdb-migration.yaml @@ -14,7 +14,7 @@ spec: - command: - "/bin/sh" - "-c" - - "atlas schema clean --auto-approve --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}; atlas migrate apply --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" + - "atlas migrate apply --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" image: "{{ .Values.sysdbMigration.image.repository }}:{{ .Values.sysdbMigration.image.tag }}" imagePullPolicy: IfNotPresent name: migration