From 6e0715f5b010150608ee47a60bd9a99ed231853f Mon Sep 17 00:00:00 2001 From: Jules Belveze <32683010+JulesBelveze@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:20:17 +0100 Subject: [PATCH] Revert "[core] - feature: support `eu-cluster-0` in Qdrant" (#9634) * Revert "[core] - feature: support `eu-cluster-0` in Qdrant (#9625)" This reverts commit 69c48d371dfbfda86648ac8f8b34dd30a0883be8. * [core] - refactor: simplify Qdrant cluster variants array - Removed redundant QdrantCluster enum variant to streamline cluster management --- core/src/data_sources/qdrant.rs | 8 +------- front/lib/api/config.ts | 4 ---- front/lib/api/data_sources.ts | 3 ++- front/pages/api/w/[wId]/data_sources/managed.ts | 3 ++- .../api/w/[wId]/spaces/[spaceId]/data_sources/index.ts | 3 ++- types/package.json | 2 +- types/src/core/data_source.ts | 3 ++- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/core/src/data_sources/qdrant.rs b/core/src/data_sources/qdrant.rs index 83a9b45d54f6..829e1e4900da 100644 --- a/core/src/data_sources/qdrant.rs +++ b/core/src/data_sources/qdrant.rs @@ -23,21 +23,17 @@ use super::data_source::EmbedderConfig; pub enum QdrantCluster { #[serde(rename = "cluster-0")] Cluster0, - #[serde(rename = "eu-cluster-0")] - EUCluster0, } // See: https://www.notion.so/dust-tt/Design-Doc-Qdrant-re-arch-d0ebdd6ae8244ff593cdf10f08988c27 pub const SHARD_KEY_COUNT: u64 = 24; -static QDRANT_CLUSTER_VARIANTS: &[QdrantCluster] = - &[QdrantCluster::Cluster0, QdrantCluster::EUCluster0]; +static QDRANT_CLUSTER_VARIANTS: &[QdrantCluster] = &[QdrantCluster::Cluster0]; impl fmt::Display for QdrantCluster { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { QdrantCluster::Cluster0 => write!(f, "cluster-0"), - QdrantCluster::EUCluster0 => write!(f, "eu-cluster-0"), } } } @@ -47,7 +43,6 @@ impl FromStr for QdrantCluster { fn from_str(s: &str) -> Result { match s { "cluster-0" => Ok(QdrantCluster::Cluster0), - "eu-cluster-0" => Ok(QdrantCluster::EUCluster0), _ => Err(ParseError::with_message("Unknown QdrantCluster"))?, } } @@ -56,7 +51,6 @@ impl FromStr for QdrantCluster { pub fn env_var_prefix_for_cluster(cluster: QdrantCluster) -> &'static str { match cluster { QdrantCluster::Cluster0 => "QDRANT_CLUSTER_0", - QdrantCluster::EUCluster0 => "QDRANT_EU_CLUSTER_0", } } diff --git a/front/lib/api/config.ts b/front/lib/api/config.ts index b65a20253922..e6b72be97ef0 100644 --- a/front/lib/api/config.ts +++ b/front/lib/api/config.ts @@ -1,4 +1,3 @@ -import type { QdrantCluster } from "@dust-tt/types"; import { EnvironmentConfig } from "@dust-tt/types"; export const PRODUCTION_DUST_API = "https://dust.tt"; @@ -162,9 +161,6 @@ const config = { getStatusPageApiToken: (): string => { return EnvironmentConfig.getEnvVariable("STATUS_PAGE_API_TOKEN"); }, - getQdrantCluster: (): QdrantCluster => { - return EnvironmentConfig.getEnvVariable("QDRANT_CLUSTER") as QdrantCluster; - }, }; export default config; diff --git a/front/lib/api/data_sources.ts b/front/lib/api/data_sources.ts index 246ba3320307..847f6b5b5344 100644 --- a/front/lib/api/data_sources.ts +++ b/front/lib/api/data_sources.ts @@ -25,6 +25,7 @@ import { ConnectorsAPI, CoreAPI, DEFAULT_EMBEDDING_PROVIDER_ID, + DEFAULT_QDRANT_CLUSTER, dustManagedCredentials, EMBEDDING_CONFIGS, Err, @@ -849,7 +850,7 @@ export async function createDataSourceWithoutProvider( projectId: dustProject.value.project.project_id.toString(), config: { qdrant_config: { - cluster: config.getQdrantCluster(), + cluster: DEFAULT_QDRANT_CLUSTER, shadow_write_cluster: null, }, embedder_config: { diff --git a/front/pages/api/w/[wId]/data_sources/managed.ts b/front/pages/api/w/[wId]/data_sources/managed.ts index 2c69becbc511..1dbb8a3d3dfd 100644 --- a/front/pages/api/w/[wId]/data_sources/managed.ts +++ b/front/pages/api/w/[wId]/data_sources/managed.ts @@ -9,6 +9,7 @@ import { ConnectorsAPI, CoreAPI, DEFAULT_EMBEDDING_PROVIDER_ID, + DEFAULT_QDRANT_CLUSTER, dustManagedCredentials, EMBEDDING_CONFIGS, ioTsParsePayload, @@ -276,7 +277,7 @@ async function handler( }, }, qdrant_config: { - cluster: config.getQdrantCluster(), + cluster: DEFAULT_QDRANT_CLUSTER, shadow_write_cluster: null, }, }, diff --git a/front/pages/api/w/[wId]/spaces/[spaceId]/data_sources/index.ts b/front/pages/api/w/[wId]/spaces/[spaceId]/data_sources/index.ts index a0210d723d40..d708723d6438 100644 --- a/front/pages/api/w/[wId]/spaces/[spaceId]/data_sources/index.ts +++ b/front/pages/api/w/[wId]/spaces/[spaceId]/data_sources/index.ts @@ -11,6 +11,7 @@ import { ConnectorsAPI, CoreAPI, DEFAULT_EMBEDDING_PROVIDER_ID, + DEFAULT_QDRANT_CLUSTER, dustManagedCredentials, EMBEDDING_CONFIGS, ioTsParsePayload, @@ -363,7 +364,7 @@ const handleDataSourceWithProvider = async ({ }, }, qdrant_config: { - cluster: config.getQdrantCluster(), + cluster: DEFAULT_QDRANT_CLUSTER, shadow_write_cluster: null, }, }, diff --git a/types/package.json b/types/package.json index 1d686b3feda0..cc19cca84d17 100644 --- a/types/package.json +++ b/types/package.json @@ -47,4 +47,4 @@ "hot-shots": false, "child_process": false } -} +} \ No newline at end of file diff --git a/types/src/core/data_source.ts b/types/src/core/data_source.ts index 90c4c2ab1221..411e9178722d 100644 --- a/types/src/core/data_source.ts +++ b/types/src/core/data_source.ts @@ -1,4 +1,5 @@ -export type QdrantCluster = "cluster-0" | "eu-cluster-0"; +export type QdrantCluster = "cluster-0"; +export const DEFAULT_QDRANT_CLUSTER: QdrantCluster = "cluster-0"; export interface EmbedderType { provider_id: string;