Docker Infrastructure & Setup
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Milvus Rust SDK utilizes Docker to provide a consistent, reproducible environment for development and testing. The primary purpose of the Docker infrastructure is to host a standalone Milvus cluster, which is essential for running the project's extensive test suites and examples. This setup ensures that developers can push the boundaries of the SDK in a local environment that mirrors production configurations.
The infrastructure is defined primarily through a Docker Compose configuration that orchestrates multiple services, including storage and the core Milvus engine. This containerized approach is specifically required for high-performance computing (HPC) and aggressive stress testing scenarios described in the Aggressive Testing Plan.
Sources: README.md:1-40, tests/aggressivehpctesting/aggressivetesting.md:1-15
Core Services & Architecture
The project employs a standalone Milvus architecture. Unlike a fully distributed cluster, the standalone mode consolidates components but maintains external dependencies for storage to simplify local deployment while preserving core functionality.
Architecture Overview
The following diagram illustrates the relationship between the Milvus service and its supporting infrastructure as defined in the deployment configuration.
Note: The metadata store (etcd) is run in an embedded mode within the standalone container to improve stability under high load.
Sources: docker-compose.yml:25-45, tests/aggressivehpctesting/aggressivetesting.md:83-85
Service Definitions
The infrastructure consists of two main containers:
| Service | Image | Role | Ports |
|---|---|---|---|
minio | minio/minio:RELEASE.2023-03-20T20-16-18Z | Handles object storage for vector data and logs. | 9000 (API), 9001 (Console) |
standalone | milvusdb/milvus:v2.5.15 | Core Milvus engine providing gRPC endpoints for the SDK. | 19530 (gRPC), 9091 (Metrics) |
Sources: docker-compose.yml:6-45
Configuration & Environment
The Milvus service is configured through a combination of environment variables, volume mounts, and custom YAML files to handle high-concurrency workloads.
Custom Server Configurations
To support "Aggressive Testing," the default Milvus configuration is overridden using a user.yaml file. This is crucial for resolving RateLimit errors that occur during high-concurrency inserts.
- Config Path:
./configs/user.yaml - Mount Point:
/milvus/configs/user.yaml - Key Adjustments: High-concurrency rate limits and server-side thresholds.
Sources: docker-compose.yml:35, tests/aggressivehpctesting/aggressivetesting.md:81-83
Persistent Storage
Volumes are mapped to ensure data persistence and logs are accessible outside the containers:
${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio->/minio_data${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus->/var/lib/milvus
Sources: docker-compose.yml:15, 34
Operational Usage
Running the infrastructure is a prerequisite for executing the SDK's test suite and example scripts.
Initialization
The environment is brought up using the following command:
docker-compose -f ./docker-compose.yml up -d
Developers must wait for the health checks to pass. The Milvus standalone container includes a health check hitting http://localhost:9091/healthz with a 90-second start period to account for component initialization.
Sources: README.md:32-35, docker-compose.yml:36-40
Integration with SDK Tests
The Rust SDK connects to this infrastructure using a URL typically defined as http://localhost:19530. During testing, the ClientBuilder is often configured with specific timeouts to handle the load generated by the Docker environment.
// Typical client setup for Docker-based testing
let client = ClientBuilder::new("http://localhost:19530")
.timeout(Duration::from_secs(60))
.build()
.await?;
Sources: tests/aggressivehpctesting/phase_2_search_and_query.rs:30-35, tests/aggressivehpctesting/phase_3_soak_test.rs:20-25, examples/query_search.rs:25
Infrastructure Stability Insights
Execution of the "Aggressive Testing Plan" revealed specific characteristics of the Docker setup:
- Metadata Stability: The external
etcdcontainer was found unstable under extreme load; hence the configuration was shifted to use the embedded etcd instance (ETCD_USE_EMBED: true). - Resource Bottlenecks: High-concurrency inserts into multiple unique partitions can cause performance bottlenecks in the v2.5.15 standalone container, a factor that should be considered when configuring Docker resource limits.
Sources: tests/aggressivehpctesting/aggressivetesting.md:83-93, docker-compose.yml:31
Summary
The Docker infrastructure for the Milvus Rust SDK provides a robust standalone environment using Milvus v2.5.15 and MinIO. By utilizing embedded metadata services and custom configuration files, it supports both standard development and extreme stress testing, ensuring the SDK's reliability across various performance tiers.