Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 60 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ name = "milvus"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tonic = { version = "0.8.2", features = ["tls", "tls-roots"] }
prost = "0.11.0"
tonic = { version = "0.11.0", features = ["tls", "tls-roots"] }
prost = "0.12.6"
tokio = { version = "1.17.0", features = ["full"] }
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -22,11 +22,68 @@ strum = "0.24"
strum_macros = "0.24"
base64 = "0.21.0"
dashmap = "5.5.3"
futures = "0.3.31"

[build-dependencies]
tonic-build = { version = "0.8.2", default-features = false, features = [
tonic-build = { version = "0.11.0", default-features = false, features = [
"prost",
] }

[dev-dependencies]
rand = "0.8.5"

[[test]]
name = "client_with_timeout"
path = "tests/testsoutsideoftestsuite/client_with_timeout.rs"

[[test]]
name = "client_flush_collections"
path = "tests/testsoutsideoftestsuite/client_flush_collections.rs"

[[test]]
name = "client_search"
path = "tests/testsoutsideoftestsuite/client_search.rs"

[[test]]
name = "collection_list_collections"
path = "tests/testsoutsideoftestsuite/collection_list_collections.rs"

[[test]]
name = "collection_get_collection_stats"
path = "tests/testsoutsideoftestsuite/collection_get_collection_stats.rs"

[[test]]
name = "collection_release_collection"
path = "tests/testsoutsideoftestsuite/collection_release_collection.rs"

[[test]]
name = "collection_get_compaction_state"
path = "tests/testsoutsideoftestsuite/collection_get_compaction_state.rs"

[[test]]
name = "partition_create_partition"
path = "tests/testsoutsideoftestsuite/partition_create_partition.rs"

[[test]]
name = "partition_drop_partition"
path = "tests/testsoutsideoftestsuite/partition_drop_partition.rs"

[[test]]
name = "partition_list_partitions"
path = "tests/testsoutsideoftestsuite/partition_list_partitions.rs"

[[test]]
name = "partition_has_partition"
path = "tests/testsoutsideoftestsuite/partition_has_partition.rs"

[[test]]
name = "partition_get_partition_stats"
path = "tests/testsoutsideoftestsuite/partition_get_partition_stats.rs"

[[test]]
name = "mutate_delete"
path = "tests/testsoutsideoftestsuite/mutate_delete.rs"

[[test]]
name = "aggressive_hpc_testing"
path = "tests/aggressivehpctesting/mod.rs"
19 changes: 19 additions & 0 deletions configs/user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# configs/user.yaml
quotaAndLimits:
ddl:
enabled: false
indexRate:
enabled: false
dml:
enabled: false
dql:
enabled: false
limitWriting:
ttProtection:
enabled: false
memProtection:
enabled: false
diskProtection:
enabled: false
flushRate:
enabled: false
23 changes: 4 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
version: '3.5'

services:
etcd:
container_name: milvus-etcd
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:2379/health" ]
interval: 30s
timeout: 20s
retries: 3


minio:
container_name: milvus-minio
Expand Down Expand Up @@ -44,15 +29,16 @@ services:

standalone:
container_name: milvus-standalone
image: milvusdb/milvus:master-latest
image: milvusdb/milvus:v2.5.15
command: [ "milvus", "run", "standalone" ]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
ETCD_USE_EMBED: true
MINIO_ADDRESS: minio:9000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
- ./configs/user.yaml:/milvus/configs/user.yaml
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9091/healthz" ]
interval: 30s
Expand All @@ -63,7 +49,6 @@ services:
- "19530:19530"
- "9091:9091"
depends_on:
- "etcd"
- "minio"

networks:
Expand Down
15 changes: 14 additions & 1 deletion src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub struct ClientBuilder<D> {
dst: D,
username: Option<String>,
password: Option<String>,
timeout: Option<Duration>,
}

impl<D> ClientBuilder<D>
Expand All @@ -70,6 +71,7 @@ where
dst,
username: None,
password: None,
timeout: None,
}
}

Expand All @@ -83,8 +85,19 @@ where
self
}

pub fn timeout(mut self, timeout: Duration) -> Self {
self.timeout = Some(timeout);
self
}

pub async fn build(self) -> Result<Client> {
Client::with_timeout(self.dst, RPC_TIMEOUT, self.username, self.password).await
Client::with_timeout(
self.dst,
self.timeout.unwrap_or(RPC_TIMEOUT),
self.username,
self.password,
)
.await
}
}

Expand Down
12 changes: 11 additions & 1 deletion src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ impl Client {
replica_number: options.replica_number,
resource_groups: vec![],
refresh: false,
load_fields: vec![],
load_params: HashMap::new(),
skip_load_dynamic_field: false,
})
.await?
.into_inner(),
Expand Down Expand Up @@ -629,14 +632,21 @@ impl Client {
where
S: Into<String>,
{
let collection = self.collection_cache.get(&collection_name.into()).await?;
let collection_name = collection_name.into();
let collection = self.collection_cache.get(&collection_name).await?;

let resp = self
.client
.clone()
.manual_compaction(ManualCompactionRequest {
collection_id: collection.id,
timetravel: 0,
channel: "".to_string(),
collection_name: collection_name.into(),
db_name: "".to_string(),
major_compaction: false,
partition_id: 0,
segment_ids: vec![],
})
.await?
.into_inner();
Expand Down
1 change: 1 addition & 0 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ impl From<FieldColumn> for schema::FieldData {
}),
}),
is_dynamic: false,
valid_data: vec![],
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/mutate.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::collections::HashMap;

use prost::bytes::{BufMut, BytesMut};

use crate::error::Result;
Expand Down Expand Up @@ -104,6 +106,7 @@ impl Client {
num_rows: row_num as u32,
fields_data: fields_data.into_iter().map(|f| f.into()).collect(),
hash_keys: Vec::new(),
schema_timestamp: 0,
})
.await?
.into_inner();
Expand Down Expand Up @@ -133,6 +136,8 @@ impl Client {
expr: expr,
partition_name: options.partition_name.clone(),
hash_keys: Vec::new(),
consistency_level: 0,
expr_template_values: HashMap::new(),
})
.await?
.into_inner();
Expand Down Expand Up @@ -214,6 +219,7 @@ impl Client {
num_rows: row_num as u32,
fields_data: fields_data.into_iter().map(|f| f.into()).collect(),
hash_keys: Vec::new(),
schema_timestamp: 0,
})
.await?
.into_inner();
Expand Down
Loading
Loading