Skip to content

Commit 0e6d3fa

Browse files
authored
Merge branch 'main' into fix/iterator-consistency-fallback
2 parents e24ed98 + 283c8ab commit 0e6d3fa

17 files changed

Lines changed: 2307 additions & 1462 deletions

.github/mergify.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pull_request_rules:
2626
- name: Test passed for code changed
2727
conditions:
2828
- base=main
29-
- "status-success=Unittest AMD64 Ubuntu 18.04"
29+
- "status-success=Unittest AMD64 Ubuntu 22.04"
30+
- "status-success=Compile tests macOS 15"
3031
actions:
3132
label:
3233
add:
@@ -51,10 +52,21 @@ pull_request_rules:
5152
add:
5253
- ci-passed
5354

54-
- name: Remove ci-passed when unittest failed
55+
- name: Remove ci-passed when linux unittest failed
5556
conditions:
5657
- base=main
57-
- "check-failure=Unittest AMD64 Ubuntu 18.04"
58+
- "check-failure=Unittest AMD64 Ubuntu 22.04"
59+
- files~=^(?!\.github\/mergify\.yml).*$
60+
- files~=\.(?!md|png)
61+
actions:
62+
label:
63+
remove:
64+
- ci-passed
65+
66+
- name: Remove ci-passed when macOS test compile failed
67+
conditions:
68+
- base=main
69+
- "check-failure=Compile tests macOS 15"
5870
- files~=^(?!\.github\/mergify\.yml).*$
5971
- files~=\.(?!md|png)
6072
actions:

.github/workflows/main.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,56 @@ on:
2121
- 'docker-compose.yml'
2222

2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
26+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
27+
2428
jobs:
25-
# This workflow contains a single job called "build"
26-
build:
27-
name: Unittest AMD64 Ubuntu ${{ matrix.ubuntu }}
29+
ut-linux:
30+
name: UT on Ubuntu-${{ matrix.ubuntu }}
2831
# The type of runner that the job will run on
2932
runs-on: ubuntu-latest
3033
timeout-minutes: 30
3134
strategy:
3235
fail-fast: false
3336
matrix:
34-
ubuntu: [18.04]
37+
ubuntu: [22.04]
3538
env:
3639
UBUNTU: ${{ matrix.ubuntu }}
3740
steps:
3841
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3942
- uses: actions/checkout@v3
4043
with:
4144
submodules: 'true'
42-
45+
46+
- uses: Swatinem/rust-cache@v2
47+
4348
- name: Setup Milvus
44-
run: sudo docker-compose up -d && sleep 15s
49+
run: docker compose -f ./docker-compose.yml up -d && sleep 15s
4550

46-
- name: Setup protoc
47-
uses: arduino/setup-protoc@v1.1.2
48-
with:
49-
repo-token: ${{ secrets.GITHUB_TOKEN }}
50-
5151
# Runs a single command using the runners shell
5252
- name: Run Unittest
5353
run: RUST_BACKTRACE=1 cargo test
5454
# - name: Upload coverage to Codecov
5555
# if: github.repository == 'milvus-io/milvus-sdk-rust'
5656
# uses: codecov/codecov-action@v1
5757
# with:
58-
# token: ${{ secrets.CODECOV_TOKEN }}
58+
# token: ${{ secrets.CODECOV_TOKEN }}
5959
# file: ./coverage.project.out
6060
# name: ubuntu-${{ matrix.ubuntu }}-unittests
61+
62+
ut-macos:
63+
name: Compile on macOS 15
64+
runs-on: macos-15
65+
timeout-minutes: 30
66+
steps:
67+
- uses: actions/checkout@v3
68+
with:
69+
submodules: 'true'
70+
71+
- uses: Swatinem/rust-cache@v2
72+
73+
# GitHub-hosted macOS runners do not provide Docker for the Milvus integration-test stack.
74+
# Compile test binaries on macOS, but run Milvus-backed integration tests on Linux.
75+
- name: Compile Tests
76+
run: cargo test --no-run

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ Cargo.lock
1717
/target
1818
#Cargo.lock
1919
/.idea/
20+
21+
# docker container data
22+
/volumes/

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ lazy_static = "1.4"
2929
tonic-build = { version = "0.11.0", default-features = false, features = [
3030
"prost",
3131
] }
32+
protoc-bin-vendored = "=3.2.0"
3233

3334
[dev-dependencies]
3435
rand = "0.8.5"

README.md

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,81 @@ async fn main() -> Result<(), Error> {
3737

3838
## Development
3939

40-
Pre-requisites:
41-
- cargo
42-
- protocol-compiler
43-
- docker (for testing)
40+
### Prerequisites
41+
42+
- Rust toolchain with Cargo
43+
- initialized `milvus-proto` submodule
44+
- Docker or Docker Compose for integration tests
45+
46+
The protobuf compiler is provided through Cargo during build, so a system-installed `protoc` is not required.
47+
48+
Initialize submodules if needed:
49+
50+
```
51+
git submodule update --init --recursive
52+
```
53+
54+
### Build
55+
56+
This repository uses Cargo directly; there is no Makefile.
57+
58+
Build the SDK:
59+
60+
```
61+
cargo build
62+
```
63+
64+
Build an optimized release artifact:
65+
66+
```
67+
cargo build --release
68+
```
69+
70+
### Test
71+
72+
Many tests require a Milvus server at `localhost:19530`. Start one with the provided Docker Compose file:
4473

45-
### How to test
46-
Many tests require the Milvus server, the project provide a docker-compose file to setup a Milvus cluster:
4774
```
4875
docker-compose -f ./docker-compose.yml up -d
4976
```
50-
You may need to wait for seconds until the system ready
5177

52-
Run all tests:
78+
On systems using Docker Compose v2, use:
79+
80+
```
81+
docker compose -f ./docker-compose.yml up -d
82+
```
83+
84+
Wait until Milvus is ready, then run all tests:
85+
5386
```
5487
cargo test
5588
```
5689

90+
Run a single test target:
91+
92+
```
93+
cargo test --test client_flush_collections -- --nocapture
94+
```
95+
5796
Enable the full backtrace for debugging:
97+
5898
```
5999
RUST_BACKTRACE=1 cargo test
60100
```
101+
102+
### Clean
103+
104+
Remove build artifacts:
105+
106+
```
107+
cargo clean
108+
```
109+
110+
### Rebuild
111+
112+
Force a clean rebuild, including regenerated protobuf bindings:
113+
114+
```
115+
cargo clean
116+
cargo build
117+
```

build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
fn main() -> Result<(), Box<dyn std::error::Error>> {
2+
if std::env::var_os("PROTOC").is_none() {
3+
let protoc = protoc_bin_vendored::protoc_bin_path()?;
4+
std::env::set_var("PROTOC", protoc);
5+
}
6+
27
tonic_build::configure()
38
.build_server(false)
49
.out_dir("src/proto")

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929

3030
standalone:
3131
container_name: milvus-standalone
32-
image: milvusdb/milvus:v2.5.15
32+
image: milvusdb/milvus:v2.5.18
3333
command: [ "milvus", "run", "standalone" ]
3434
security_opt:
3535
- seccomp:unconfined

0 commit comments

Comments
 (0)