2021-10-08 18:05:23 +08:00
|
|
|
|
# Compile and install milvus cluster
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
|
|
|
|
## Environment
|
|
|
|
|
|
|
|
|
|
```
|
2021-10-15 15:22:34 +08:00
|
|
|
|
OS: Ubuntu 18.04
|
2022-03-16 18:51:21 +08:00
|
|
|
|
go:1.16
|
2021-10-15 15:22:34 +08:00
|
|
|
|
cmake: >=3.18
|
|
|
|
|
gcc: 7.5
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
## Install dependencies
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Install compile dependencies
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ sudo apt install -y g++ gcc make libssl-dev zlib1g-dev libboost-regex-dev \
|
2020-11-11 16:41:53 +08:00
|
|
|
|
libboost-program-options-dev libboost-system-dev libboost-filesystem-dev \
|
|
|
|
|
libboost-serialization-dev python3-dev libboost-python-dev libcurl4-openssl-dev gfortran libtbb-dev
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ export GO111MODULE=on
|
|
|
|
|
$ go get github.com/golang/protobuf/protoc-gen-go@v1.3.2
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Install OpenBlas library
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ wget https://github.com/xianyi/OpenBLAS/archive/v0.3.9.tar.gz && \
|
|
|
|
|
$ tar zxvf v0.3.9.tar.gz && cd OpenBLAS-0.3.9 && \
|
|
|
|
|
$ make TARGET=CORE2 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1 USE_THREAD=0 USE_OPENMP=0 FC=gfortran CC=gcc COMMON_OPT="-O3 -g -fPIC" FCOMMON_OPT="-O3 -g -fPIC -frecursive" NMAX="NUM_THREADS=128" LIBPREFIX="libopenblas" LAPACKE="NO_LAPACKE=1" INTERFACE64=0 NO_STATIC=1 && \
|
|
|
|
|
$ make PREFIX=/usr install
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
## Compile
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Generate the go files from proto file
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make check-proto-product
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Check code specifications
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make verifiers
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Compile milvus
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make all
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
## Install docker-compose
|
2020-11-23 19:57:05 +08:00
|
|
|
|
|
|
|
|
|
refer: https://docs.docker.com/compose/install/
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
|
|
|
|
$ sudo chmod +x /usr/local/bin/docker-compose
|
|
|
|
|
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
|
|
|
|
|
$ docker-compose --version
|
2020-11-23 19:57:05 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
## Start service
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Start third-party service:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ cd [milvus project path]/deployments/docker/cluster
|
|
|
|
|
$ docker-compose up -d
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Start milvus cluster:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-12-15 10:33:35 +08:00
|
|
|
|
$ cd [milvus project path]
|
|
|
|
|
$ ./scripts/start_cluster.sh
|
2021-10-06 19:25:06 +08:00
|
|
|
|
```
|
2020-11-11 16:41:53 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
## Run unittest
|
|
|
|
|
|
|
|
|
|
Run all unittest including go and cpp cases:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make unittest
|
2020-11-11 16:41:53 +08:00
|
|
|
|
```
|
2021-10-02 11:20:05 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
You also can run go unittest only:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make test-go
|
2021-10-06 19:25:06 +08:00
|
|
|
|
```
|
2021-10-02 11:20:05 +08:00
|
|
|
|
|
2021-10-06 19:25:06 +08:00
|
|
|
|
Run cpp unittest only:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make test-cpp
|
2021-10-06 19:25:06 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Run code coverage
|
|
|
|
|
|
|
|
|
|
Run code coverage including go and cpp:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make codecov
|
2021-10-06 19:25:06 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You also can run go code coverage only:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make codecov-go
|
2021-10-06 19:25:06 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Run cpp code coverage only:
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```shell
|
2021-10-15 15:22:34 +08:00
|
|
|
|
$ make codecov-cpp
|
2021-10-07 18:34:42 +08:00
|
|
|
|
```
|