Skip to content

Commit

Permalink
Revert "[core] - feature: support eu-cluster-0 in Qdrant" (#9634)
Browse files Browse the repository at this point in the history
* Revert "[core] - feature: support  `eu-cluster-0` in Qdrant (#9625)"

This reverts commit 69c48d3.

* [core] - refactor: simplify Qdrant cluster variants array

 - Removed redundant QdrantCluster enum variant to streamline cluster management
  • Loading branch information
JulesBelveze authored Dec 26, 2024
1 parent e32b106 commit 6e0715f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
8 changes: 1 addition & 7 deletions core/src/data_sources/qdrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
}
}
Expand All @@ -47,7 +43,6 @@ impl FromStr for QdrantCluster {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"cluster-0" => Ok(QdrantCluster::Cluster0),
"eu-cluster-0" => Ok(QdrantCluster::EUCluster0),
_ => Err(ParseError::with_message("Unknown QdrantCluster"))?,
}
}
Expand All @@ -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",
}
}

Expand Down
4 changes: 0 additions & 4 deletions front/lib/api/config.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
3 changes: 2 additions & 1 deletion front/lib/api/data_sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
ConnectorsAPI,
CoreAPI,
DEFAULT_EMBEDDING_PROVIDER_ID,
DEFAULT_QDRANT_CLUSTER,
dustManagedCredentials,
EMBEDDING_CONFIGS,
Err,
Expand Down Expand Up @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion front/pages/api/w/[wId]/data_sources/managed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
ConnectorsAPI,
CoreAPI,
DEFAULT_EMBEDDING_PROVIDER_ID,
DEFAULT_QDRANT_CLUSTER,
dustManagedCredentials,
EMBEDDING_CONFIGS,
ioTsParsePayload,
Expand Down Expand Up @@ -276,7 +277,7 @@ async function handler(
},
},
qdrant_config: {
cluster: config.getQdrantCluster(),
cluster: DEFAULT_QDRANT_CLUSTER,
shadow_write_cluster: null,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ConnectorsAPI,
CoreAPI,
DEFAULT_EMBEDDING_PROVIDER_ID,
DEFAULT_QDRANT_CLUSTER,
dustManagedCredentials,
EMBEDDING_CONFIGS,
ioTsParsePayload,
Expand Down Expand Up @@ -363,7 +364,7 @@ const handleDataSourceWithProvider = async ({
},
},
qdrant_config: {
cluster: config.getQdrantCluster(),
cluster: DEFAULT_QDRANT_CLUSTER,
shadow_write_cluster: null,
},
},
Expand Down
2 changes: 1 addition & 1 deletion types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"hot-shots": false,
"child_process": false
}
}
}
3 changes: 2 additions & 1 deletion types/src/core/data_source.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 6e0715f

Please sign in to comment.