2020-10-30 16:25:06 +08:00
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
2022-03-16 16:51:22 +08:00
GO ?= go
PWD := $( shell pwd )
2022-06-28 19:58:25 +08:00
GOPATH := $( shell $( GO) env GOPATH)
SHELL := /bin/bash
2022-03-16 16:51:22 +08:00
OBJPREFIX := "github.com/milvus-io/milvus/cmd/milvus"
2020-10-30 16:25:06 +08:00
INSTALL_PATH := $( PWD) /bin
LIBRARY_PATH := $( PWD) /lib
2024-06-20 14:52:00 +08:00
PGO_PATH := $( PWD) /configs/pgo
2022-02-09 14:27:46 +08:00
OS := $( shell uname -s)
mode = Release
2023-10-11 20:45:35 +08:00
use_disk_index = OFF
2023-10-12 19:25:35 +08:00
i f d e f d i s k _ i n d e x
use_disk_index = ${ disk_index }
2023-10-11 20:45:35 +08:00
e n d i f
use_asan = OFF
i f d e f U S E _ A S A N
use_asan = ${ USE_ASAN }
2023-01-29 10:59:49 +08:00
e n d i f
2023-10-11 20:45:35 +08:00
2023-12-18 12:04:42 +08:00
use_dynamic_simd = ON
2023-07-13 16:22:30 +08:00
i f d e f U S E _ D Y N A M I C _ S I M D
use_dynamic_simd = ${ USE_DYNAMIC_SIMD }
e n d i f
2024-02-20 19:16:52 +08:00
use_opendal = OFF
i f d e f U S E _ O P E N D A L
use_opendal = ${ USE_OPENDAL }
e n d i f
2023-09-05 17:39:48 +08:00
# golangci-lint
2023-11-21 10:04:21 +08:00
GOLANGCI_LINT_VERSION := 1.55.2
2023-09-05 17:39:48 +08:00
GOLANGCI_LINT_OUTPUT := $( shell $( INSTALL_PATH) /golangci-lint --version 2>/dev/null)
INSTALL_GOLANGCI_LINT := $( findstring $( GOLANGCI_LINT_VERSION) , $( GOLANGCI_LINT_OUTPUT) )
# mockery
MOCKERY_VERSION := 2.32.4
MOCKERY_OUTPUT := $( shell $( INSTALL_PATH) /mockery --version 2>/dev/null)
INSTALL_MOCKERY := $( findstring $( MOCKERY_VERSION) ,$( MOCKERY_OUTPUT) )
2023-09-21 09:45:27 +08:00
# gci
GCI_VERSION := 0.11.2
GCI_OUTPUT := $( shell $( INSTALL_PATH) /gci --version 2>/dev/null)
INSTALL_GCI := $( findstring $( GCI_VERSION) ,$( GCI_OUTPUT) )
# gofumpt
GOFUMPT_VERSION := 0.5.0
GOFUMPT_OUTPUT := $( shell $( INSTALL_PATH) /gofumpt --version 2>/dev/null)
INSTALL_GOFUMPT := $( findstring $( GOFUMPT_VERSION) ,$( GOFUMPT_OUTPUT) )
2024-03-22 10:29:06 +08:00
# gotestsum
GOTESTSUM_VERSION := 1.11.0
GOTESTSUM_OUTPUT := $( shell $( INSTALL_PATH) /gotestsum --version 2>/dev/null)
INSTALL_GOTESTSUM := $( findstring $( GOTESTSUM_VERSION) ,$( GOTESTSUM_OUTPUT) )
2020-10-30 16:25:06 +08:00
2023-09-22 09:59:26 +08:00
index_engine = knowhere
2022-10-16 20:49:27 +08:00
export GIT_BRANCH = master
2022-10-12 14:33:23 +08:00
2023-09-20 13:59:23 +08:00
i f e q ( $ { E N A B L E _ A Z U R E } , f a l s e )
AZURE_OPTION := -Z
e n d i f
2022-10-17 19:19:25 +08:00
milvus : build -cpp print -build -info
2022-10-12 14:33:23 +08:00
@echo "Building Milvus ..."
@source $( PWD) /scripts/setenv.sh && \
mkdir -p $( INSTALL_PATH) && go env -w CGO_ENABLED = "1" && \
2024-06-20 14:52:00 +08:00
GO111MODULE = on $( GO) build -pgo= $( PGO_PATH) /default.pgo -ldflags= " -r $$ {RPATH} -X ' $( OBJPREFIX) .BuildTags= $( BUILD_TAGS) ' -X ' $( OBJPREFIX) .BuildTime= $( BUILD_TIME) ' -X ' $( OBJPREFIX) .GitCommit= $( GIT_COMMIT) ' -X ' $( OBJPREFIX) .GoVersion= $( GO_VERSION) ' " \
2023-07-13 15:34:33 +08:00
-tags dynamic -o $( INSTALL_PATH) /milvus $( PWD) /cmd/main.go 1>/dev/null
2020-10-30 16:25:06 +08:00
2023-03-21 17:55:57 +08:00
milvus-gpu : build -cpp -gpu print -gpu -build -info
2023-03-14 23:21:56 +08:00
@echo "Building Milvus-gpu ..."
@source $( PWD) /scripts/setenv.sh && \
mkdir -p $( INSTALL_PATH) && go env -w CGO_ENABLED = "1" && \
2024-06-20 14:52:00 +08:00
GO111MODULE = on $( GO) build -pgo= $( PGO_PATH) /default.pgo -ldflags= " -r $$ {RPATH} -X ' $( OBJPREFIX) .BuildTags= $( BUILD_TAGS_GPU) ' -X ' $( OBJPREFIX) .BuildTime= $( BUILD_TIME) ' -X ' $( OBJPREFIX) .GitCommit= $( GIT_COMMIT) ' -X ' $( OBJPREFIX) .GoVersion= $( GO_VERSION) ' " \
2023-07-13 15:34:33 +08:00
-tags dynamic -o $( INSTALL_PATH) /milvus $( PWD) /cmd/main.go 1>/dev/null
2023-03-14 23:21:56 +08:00
2020-10-30 16:25:06 +08:00
get-build-deps :
@( env bash $( PWD) /scripts/install_deps.sh)
2021-12-07 17:59:02 +08:00
# attention: upgrade golangci-lint should also change Dockerfiles in build/docker/builder/cpu/<os>
2020-12-09 20:07:27 +08:00
getdeps :
2023-01-29 10:59:49 +08:00
@mkdir -p $( INSTALL_PATH)
2023-09-05 17:39:48 +08:00
@if [ -z " $( INSTALL_GOLANGCI_LINT) " ] ; then \
2023-11-21 10:04:21 +08:00
echo "Installing golangci-lint into ./bin/" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $( INSTALL_PATH) v${ GOLANGCI_LINT_VERSION } ; \
2023-09-05 17:39:48 +08:00
else \
echo " golangci-lint v@ $( GOLANGCI_LINT_VERSION) already installed " ; \
fi
@if [ -z " $( INSTALL_MOCKERY) " ] ; then \
echo " Installing mockery v $( MOCKERY_VERSION) to ./bin/ " && GOBIN = $( INSTALL_PATH) go install github.com/vektra/mockery/v2@v$( MOCKERY_VERSION) ; \
else \
echo " Mockery v $( MOCKERY_VERSION) already installed " ; \
2023-09-11 20:43:17 +08:00
fi
2024-03-22 10:29:06 +08:00
@if [ -z " $( INSTALL_GOTESTSUM) " ] ; then \
2024-07-04 10:30:09 +08:00
echo " Install gotestsum v $( GOTESTSUM_VERSION) to ./bin/ " && GOBIN = $( INSTALL_PATH) go install -ldflags= " -X 'gotest.tools/gotestsum/cmd.version= $( GOTESTSUM_VERSION) ' " gotest.tools/gotestsum@v$( GOTESTSUM_VERSION) ; \
2024-03-22 10:29:06 +08:00
else \
echo " gotestsum v $( GOTESTSUM_VERSION) already installed " ; \
fi
2020-12-09 20:07:27 +08:00
2020-12-31 17:25:45 +08:00
tools/bin/revive : tools /check /go .mod
cd tools/check; \
2024-06-20 14:52:00 +08:00
$( GO) build -pgo= $( PGO_PATH) /default.pgo -o ../bin/revive github.com/mgechev/revive
2020-12-31 17:25:45 +08:00
2020-11-23 19:57:05 +08:00
cppcheck :
2024-02-22 19:40:53 +08:00
@#( env bash ${ PWD } /scripts/core_build.sh -l)
@( env bash ${ PWD } /scripts/check_cpp_fmt.sh)
2020-11-18 10:07:05 +08:00
2020-10-30 16:25:06 +08:00
fmt :
2020-12-29 17:19:44 +08:00
i f d e f G O _ D I F F _ F I L E S
@echo " Running $@ check "
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh $( GO_DIFF_FILES)
e l s e
2020-10-30 16:25:06 +08:00
@echo " Running $@ check "
2020-11-18 10:07:05 +08:00
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh cmd/
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh internal/
2023-02-07 19:24:30 +08:00
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh tests/integration/
2020-12-03 19:00:11 +08:00
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh tests/go/
2023-09-08 09:51:17 +08:00
@GO111MODULE= on env bash $( PWD) /scripts/gofmt.sh pkg/
2020-12-29 17:19:44 +08:00
e n d i f
2020-10-30 16:25:06 +08:00
2023-09-21 09:45:27 +08:00
lint-fix : getdeps
@mkdir -p $( INSTALL_PATH)
@if [ -z " $( INSTALL_GCI) " ] ; then \
echo " Installing gci v $( GCI_VERSION) to ./bin/ " && GOBIN = $( INSTALL_PATH) go install github.com/daixiang0/gci@v$( GCI_VERSION) ; \
else \
echo " gci v $( GCI_VERSION) already installed " ; \
fi
@if [ -z " $( INSTALL_GOFUMPT) " ] ; then \
echo " Installing gofumpt v $( GOFUMPT_VERSION) to ./bin/ " && GOBIN = $( INSTALL_PATH) go install mvdan.cc/gofumpt@v$( GOFUMPT_VERSION) ; \
else \
echo " gofumpt v $( GOFUMPT_VERSION) already installed " ; \
fi
@echo "Running gofumpt fix"
2023-09-26 10:05:25 +08:00
@$( INSTALL_PATH) /gofumpt -l -w internal/
@$( INSTALL_PATH) /gofumpt -l -w cmd/
@$( INSTALL_PATH) /gofumpt -l -w pkg/
@$( INSTALL_PATH) /gofumpt -l -w tests/integration/
2023-09-21 09:45:27 +08:00
@echo "Running gci fix"
@$( INSTALL_PATH) /gci write cmd/ --skip-generated -s standard -s default -s "prefix(github.com/milvus-io)" --custom-order
@$( INSTALL_PATH) /gci write internal/ --skip-generated -s standard -s default -s "prefix(github.com/milvus-io)" --custom-order
@$( INSTALL_PATH) /gci write pkg/ --skip-generated -s standard -s default -s "prefix(github.com/milvus-io)" --custom-order
@$( INSTALL_PATH) /gci write tests/ --skip-generated -s standard -s default -s "prefix(github.com/milvus-io)" --custom-order
@echo "Running golangci-lint auto-fix"
@source $( PWD) /scripts/setenv.sh && GO111MODULE = on $( INSTALL_PATH) /golangci-lint run --fix --timeout= 30m --config $( PWD) /.golangci.yml; cd pkg && GO111MODULE = on $( INSTALL_PATH) /golangci-lint run --fix --timeout= 30m --config $( PWD) /.golangci.yml
2020-12-31 17:25:45 +08:00
2020-10-30 16:25:06 +08:00
#TODO: Check code specifications by golangci-lint
2023-01-29 10:59:49 +08:00
static-check : getdeps
2020-10-30 16:25:06 +08:00
@echo " Running $@ check "
2024-07-04 13:02:09 +08:00
@source $( PWD) /scripts/setenv.sh && GO111MODULE = on $( INSTALL_PATH) /golangci-lint run --build-tags dynamic,test --timeout= 30m --config $( PWD) /.golangci.yml
@source $( PWD) /scripts/setenv.sh && cd pkg && GO111MODULE = on $( INSTALL_PATH) /golangci-lint run --build-tags dynamic,test --timeout= 30m --config $( PWD) /.golangci.yml
@source $( PWD) /scripts/setenv.sh && cd client && GO111MODULE = on $( INSTALL_PATH) /golangci-lint run --timeout= 30m --config $( PWD) /client/.golangci.yml
2020-10-30 16:25:06 +08:00
2022-06-10 14:58:07 +08:00
verifiers : build -cpp getdeps cppcheck fmt static -check
2020-10-30 16:25:06 +08:00
2021-09-29 14:41:58 +08:00
# Build various components locally.
2021-04-09 14:07:03 +08:00
binlog :
@echo "Building binlog ..."
2022-07-21 19:48:27 +08:00
@source $( PWD) /scripts/setenv.sh && \
2022-10-13 20:57:23 +08:00
mkdir -p $( INSTALL_PATH) && go env -w CGO_ENABLED = "1" && \
2024-06-20 14:52:00 +08:00
GO111MODULE = on $( GO) build -pgo= $( PGO_PATH) /default.pgo -ldflags= " -r $$ {RPATH} " -o $( INSTALL_PATH) /binlog $( PWD) /cmd/tools/binlog/main.go 1>/dev/null
2021-02-20 10:15:37 +08:00
2022-10-12 11:37:23 +08:00
MIGRATION_PATH = $( PWD) /cmd/tools/migration
2022-10-17 15:07:25 +08:00
meta-migration :
2022-10-12 11:37:23 +08:00
@echo "Building migration tool ..."
2023-01-11 19:31:39 +08:00
@source $( PWD) /scripts/setenv.sh && \
mkdir -p $( INSTALL_PATH) && go env -w CGO_ENABLED = "1" && \
2024-06-20 14:52:00 +08:00
GO111MODULE = on $( GO) build -pgo= $( PGO_PATH) /default.pgo -ldflags= " -r $$ {RPATH} -X ' $( OBJPREFIX) .BuildTags= $( BUILD_TAGS) ' -X ' $( OBJPREFIX) .BuildTime= $( BUILD_TIME) ' -X ' $( OBJPREFIX) .GitCommit= $( GIT_COMMIT) ' -X ' $( OBJPREFIX) .GoVersion= $( GO_VERSION) ' " \
2023-07-13 15:34:33 +08:00
-tags dynamic -o $( INSTALL_PATH) /meta-migration $( MIGRATION_PATH) /main.go 1>/dev/null
2022-10-12 11:37:23 +08:00
2023-02-07 19:24:30 +08:00
INTERATION_PATH = $( PWD) /tests/integration
2024-03-22 10:29:06 +08:00
integration-test : getdeps
2023-02-07 19:24:30 +08:00
@echo "Building integration tests ..."
2024-03-22 10:29:06 +08:00
@( env bash $( PWD) /scripts/run_intergration_test.sh " $( INSTALL_PATH) /gotestsum -- " )
2023-02-07 19:24:30 +08:00
2021-06-22 11:34:04 +08:00
BUILD_TAGS = $( shell git describe --tags --always --dirty= "-dev" )
2023-03-20 19:03:57 +08:00
BUILD_TAGS_GPU = ${ BUILD_TAGS } -gpu
2022-02-09 14:27:46 +08:00
BUILD_TIME = $( shell date -u)
2021-06-22 11:34:04 +08:00
GIT_COMMIT = $( shell git rev-parse --short HEAD)
GO_VERSION = $( shell go version)
2023-02-10 14:24:32 +08:00
2021-12-15 10:21:10 +08:00
print-build-info :
2022-09-08 17:14:36 +08:00
$( shell git config --global --add safe.directory '*' )
2021-12-15 10:21:10 +08:00
@echo " Build Tag: $( BUILD_TAGS) "
@echo " Build Time: $( BUILD_TIME) "
@echo " Git Commit: $( GIT_COMMIT) "
@echo " Go Version: $( GO_VERSION) "
2023-03-21 17:55:57 +08:00
print-gpu-build-info :
$( shell git config --global --add safe.directory '*' )
@echo " Build Tag: $( BUILD_TAGS_GPU) "
@echo " Build Time: $( BUILD_TIME) "
@echo " Git Commit: $( GIT_COMMIT) "
@echo " Go Version: $( GO_VERSION) "
2021-04-15 09:28:46 +08:00
2022-10-19 20:45:32 +08:00
update-milvus-api : download -milvus -proto
@echo "Update milvus/api version ..."
2023-06-09 01:28:37 +08:00
@( env bash $( PWD) /scripts/update-api-version.sh $( PROTO_API_VERSION) )
2022-10-17 19:19:25 +08:00
2022-10-16 20:49:27 +08:00
download-milvus-proto :
@echo "Download milvus-proto repo ..."
@( env bash $( PWD) /scripts/download_milvus_proto.sh)
2022-10-12 14:33:23 +08:00
2023-04-21 14:16:33 +08:00
build-3rdparty :
@echo "Build 3rdparty ..."
2024-02-20 19:16:52 +08:00
@( env bash $( PWD) /scripts/3rdparty_build.sh -o ${ use_opendal } )
2023-04-21 14:16:33 +08:00
2023-12-22 12:00:43 +08:00
generated-proto-without-cpp : download -milvus -proto
@echo "Generate proto ..."
@mkdir -p ${ GOPATH } /bin
@which protoc-gen-go 1>/dev/null || ( echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2)
@( env bash $( PWD) /scripts/generate_proto.sh)
2023-04-21 14:16:33 +08:00
generated-proto : download -milvus -proto build -3rdparty
@echo "Generate proto ..."
@mkdir -p ${ GOPATH } /bin
@which protoc-gen-go 1>/dev/null || ( echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2)
@( env bash $( PWD) /scripts/generate_proto.sh)
build-cpp : generated -proto
2023-09-26 10:31:27 +08:00
@echo "Building Milvus cpp library ..."
2024-02-20 19:16:52 +08:00
@( env bash $( PWD) /scripts/core_build.sh -t ${ mode } -n ${ use_disk_index } -y ${ use_dynamic_simd } ${ AZURE_OPTION } -x ${ index_engine } -o ${ use_opendal } )
2022-03-16 16:51:22 +08:00
2023-04-21 14:16:33 +08:00
build-cpp-gpu : generated -proto
2023-09-20 13:59:23 +08:00
@echo "Building Milvus cpp gpu library ... "
2024-02-20 19:16:52 +08:00
@( env bash $( PWD) /scripts/core_build.sh -t ${ mode } -g -n ${ use_disk_index } -y ${ use_dynamic_simd } ${ AZURE_OPTION } -x ${ index_engine } -o ${ use_opendal } )
2023-03-14 23:21:56 +08:00
2023-04-21 14:16:33 +08:00
build-cpp-with-unittest : generated -proto
2023-09-20 13:59:23 +08:00
@echo "Building Milvus cpp library with unittest ... "
2024-02-20 19:16:52 +08:00
@( env bash $( PWD) /scripts/core_build.sh -t ${ mode } -u -n ${ use_disk_index } -y ${ use_dynamic_simd } ${ AZURE_OPTION } -x ${ index_engine } -o ${ use_opendal } )
2020-10-30 16:25:06 +08:00
2023-04-21 14:16:33 +08:00
build-cpp-with-coverage : generated -proto
2022-04-11 09:49:34 +08:00
@echo "Building Milvus cpp library with coverage and unittest ..."
2024-02-20 19:16:52 +08:00
@( env bash $( PWD) /scripts/core_build.sh -t ${ mode } -a ${ use_asan } -u -c -n ${ use_disk_index } -y ${ use_dynamic_simd } ${ AZURE_OPTION } -x ${ index_engine } -o ${ use_opendal } )
2022-04-11 09:49:34 +08:00
2023-04-21 14:16:33 +08:00
check-proto-product : generated -proto
@( env bash $( PWD) /scripts/check_proto_product.sh)
2022-04-11 09:49:34 +08:00
2021-09-29 14:41:58 +08:00
# Run the tests.
2020-10-31 16:30:20 +08:00
unittest : test -cpp test -go
2020-10-30 16:25:06 +08:00
2022-09-08 17:36:35 +08:00
test-util :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t util)
test-storage :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t storage)
test-allocator :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t allocator)
test-config :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t config)
test-tso :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t tso)
test-kv :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t kv)
test-mq :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t mq)
test-rootcoord :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t rootcoord)
2022-01-24 17:18:46 +08:00
test-indexnode :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t indexnode)
2022-01-24 17:18:46 +08:00
2022-10-08 15:38:58 +08:00
test-indexcoord :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t indexcoord)
2021-10-24 15:16:00 +08:00
test-proxy :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t proxy)
2021-10-24 15:16:00 +08:00
2022-03-15 21:51:21 +08:00
test-datacoord :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t datacoord)
2022-03-15 21:51:21 +08:00
2022-01-04 23:33:24 +08:00
test-datanode :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t datanode)
2021-10-24 15:16:00 +08:00
2022-03-08 17:39:58 +08:00
test-querynode :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t querynode)
2022-03-08 17:39:58 +08:00
2021-10-27 23:00:24 +08:00
test-querycoord :
@echo "Running go unittests..."
2022-09-08 17:36:35 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh -t querycoord)
2021-10-27 23:00:24 +08:00
2022-09-08 17:36:35 +08:00
test-metastore :
@echo "Running go unittests..."
@( env bash $( PWD) /scripts/run_go_unittest.sh -t metastore)
2021-10-27 23:00:24 +08:00
2021-07-16 14:52:21 +08:00
test-go : build -cpp -with -unittest
2020-10-30 16:25:06 +08:00
@echo "Running go unittests..."
2021-12-08 10:55:04 +08:00
@( env bash $( PWD) /scripts/run_go_unittest.sh)
2020-10-30 16:25:06 +08:00
test-cpp : build -cpp -with -unittest
2020-11-03 11:25:47 +08:00
@echo "Running cpp unittests..."
2021-12-08 10:55:04 +08:00
@( env bash $( PWD) /scripts/run_cpp_unittest.sh)
2020-10-30 16:25:06 +08:00
2021-09-29 14:41:58 +08:00
# Run code coverage.
2021-09-22 16:01:53 +08:00
codecov : codecov -go codecov -cpp
2021-09-18 14:19:51 +08:00
2021-09-22 16:01:53 +08:00
# Run codecov-go
2022-04-11 09:49:34 +08:00
codecov-go : build -cpp -with -coverage
2021-09-18 14:19:51 +08:00
@echo "Running go coverage..."
2021-04-24 15:10:24 +08:00
@( env bash $( PWD) /scripts/run_go_codecov.sh)
2024-03-27 15:29:10 +08:00
# Run codecov-go without build core again, used in github action
codecov-go-without-build : getdeps
@echo "Running go coverage..."
@( env bash $( PWD) /scripts/run_go_codecov.sh " $( INSTALL_PATH) /gotestsum -- " )
2021-09-22 16:01:53 +08:00
# Run codecov-cpp
2022-04-11 09:49:34 +08:00
codecov-cpp : build -cpp -with -coverage
2021-09-18 14:19:51 +08:00
@echo "Running cpp coverage..."
2021-09-17 14:21:50 +08:00
@( env bash $( PWD) /scripts/run_cpp_codecov.sh)
2021-09-29 14:41:58 +08:00
# Build each component and install binary to $GOPATH/bin.
2022-10-12 14:33:23 +08:00
install : milvus
2020-10-30 16:25:06 +08:00
@echo "Installing binary to './bin'"
2021-04-15 09:28:46 +08:00
@mkdir -p $( GOPATH) /bin && cp -f $( PWD) /bin/milvus $( GOPATH) /bin/milvus
2022-11-02 15:39:35 +08:00
@mkdir -p $( LIBRARY_PATH)
2022-11-23 10:39:11 +08:00
-cp -r -P $( PWD) /internal/core/output/lib/*.dylib* $( LIBRARY_PATH) 2>/dev/null
-cp -r -P $( PWD) /internal/core/output/lib/*.so* $( LIBRARY_PATH) 2>/dev/null
-cp -r -P $( PWD) /internal/core/output/lib64/*.so* $( LIBRARY_PATH) 2>/dev/null
2020-10-30 16:25:06 +08:00
@echo "Installation successful."
2023-03-20 19:03:57 +08:00
gpu-install : milvus -gpu
@echo "Installing binary to './bin'"
@mkdir -p $( GOPATH) /bin && cp -f $( PWD) /bin/milvus $( GOPATH) /bin/milvus
@mkdir -p $( LIBRARY_PATH)
-cp -r -P $( PWD) /internal/core/output/lib/*.dylib* $( LIBRARY_PATH) 2>/dev/null
-cp -r -P $( PWD) /internal/core/output/lib/*.so* $( LIBRARY_PATH) 2>/dev/null
-cp -r -P $( PWD) /internal/core/output/lib64/*.so* $( LIBRARY_PATH) 2>/dev/null
@echo "Installation successful."
2020-10-30 16:25:06 +08:00
clean :
@echo "Cleaning up all the generated files"
2021-01-11 18:35:54 +08:00
@rm -rf bin/
@rm -rf lib/
2021-09-08 16:32:00 +08:00
@rm -rf $( GOPATH) /bin/milvus
2022-02-10 17:03:48 +08:00
@rm -rf cmake_build
2022-05-26 22:58:03 +08:00
@rm -rf internal/core/output
2021-08-24 15:51:51 +08:00
2021-12-15 10:21:10 +08:00
milvus-tools : print -build -info
2021-08-24 15:51:51 +08:00
@echo "Building tools ..."
@mkdir -p $( INSTALL_PATH) /tools && go env -w CGO_ENABLED = "1" && GO111MODULE = on $( GO) build \
2024-06-20 14:52:00 +08:00
-pgo= $( PGO_PATH) /default.pgo -ldflags= " -X 'main.BuildTags= $( BUILD_TAGS) ' -X 'main.BuildTime= $( BUILD_TIME) ' -X 'main.GitCommit= $( GIT_COMMIT) ' -X 'main.GoVersion= $( GO_VERSION) ' " \
2021-08-24 15:51:51 +08:00
-o $( INSTALL_PATH) /tools $( PWD) /cmd/tools/* 1>/dev/null
2021-12-28 09:52:10 +08:00
2022-06-24 21:12:15 +08:00
rpm-setup :
2021-12-28 09:52:10 +08:00
@echo "Setuping rpm env ...;"
2021-12-30 16:59:20 +08:00
@build/rpm/setup-env.sh
2021-12-28 09:52:10 +08:00
rpm : install
@echo "Note: run 'make rpm-setup' to setup build env for rpm builder"
@echo "Building rpm ...;"
@yum -y install rpm-build rpmdevtools wget
@rm -rf ~/rpmbuild/BUILD/*
@rpmdev-setuptree
@wget https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz && tar -xf etcd-v3.5.0-linux-amd64.tar.gz
@cp etcd-v3.5.0-linux-amd64/etcd bin/etcd
@wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio.RELEASE.2021-02-14T04-01-33Z -O bin/minio
@cp -r bin ~/rpmbuild/BUILD/
@cp -r lib ~/rpmbuild/BUILD/
@cp -r configs ~/rpmbuild/BUILD/
@cp -r build/rpm/services ~/rpmbuild/BUILD/
2021-12-30 16:59:20 +08:00
@QA_RPATHS= " $$ [ 0x001|0x0002|0x0020 ] " rpmbuild -ba ./build/rpm/milvus.spec
2022-09-23 10:50:51 +08:00
2023-09-04 21:19:48 +08:00
generate-mockery-types : getdeps
# RootCoord
$( INSTALL_PATH) /mockery --name= RootCoordComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_rootcoord.go --with-expecter --structname= RootCoord
# Proxy
$( INSTALL_PATH) /mockery --name= ProxyComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_proxy.go --with-expecter --structname= MockProxy
# QueryCoord
2023-09-11 20:43:17 +08:00
$( INSTALL_PATH) /mockery --name= QueryCoordComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_querycoord.go --with-expecter --structname= MockQueryCoord
2023-09-04 21:19:48 +08:00
# QueryNode
2023-09-11 20:43:17 +08:00
$( INSTALL_PATH) /mockery --name= QueryNodeComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_querynode.go --with-expecter --structname= MockQueryNode
2023-09-04 21:19:48 +08:00
# DataCoord
$( INSTALL_PATH) /mockery --name= DataCoordComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_datacoord.go --with-expecter --structname= MockDataCoord
# DataNode
$( INSTALL_PATH) /mockery --name= DataNodeComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_datanode.go --with-expecter --structname= MockDataNode
# IndexNode
$( INSTALL_PATH) /mockery --name= IndexNodeComponent --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_indexnode.go --with-expecter --structname= MockIndexNode
2023-09-26 09:57:25 +08:00
# Clients
$( INSTALL_PATH) /mockery --name= RootCoordClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_rootcoord_client.go --with-expecter --structname= MockRootCoordClient
$( INSTALL_PATH) /mockery --name= QueryCoordClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_querycoord_client.go --with-expecter --structname= MockQueryCoordClient
$( INSTALL_PATH) /mockery --name= DataCoordClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_datacoord_client.go --with-expecter --structname= MockDataCoordClient
$( INSTALL_PATH) /mockery --name= QueryNodeClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_querynode_client.go --with-expecter --structname= MockQueryNodeClient
$( INSTALL_PATH) /mockery --name= DataNodeClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_datanode_client.go --with-expecter --structname= MockDataNodeClient
$( INSTALL_PATH) /mockery --name= IndexNodeClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_indexnode_client.go --with-expecter --structname= MockIndexNodeClient
$( INSTALL_PATH) /mockery --name= ProxyClient --dir= $( PWD) /internal/types --output= $( PWD) /internal/mocks --filename= mock_proxy_client.go --with-expecter --structname= MockProxyClient
2023-09-04 21:19:48 +08:00
generate-mockery-rootcoord : getdeps
$( INSTALL_PATH) /mockery --name= IMetaTable --dir= $( PWD) /internal/rootcoord --output= $( PWD) /internal/rootcoord/mocks --filename= meta_table.go --with-expecter --outpkg= mockrootcoord
$( INSTALL_PATH) /mockery --name= GarbageCollector --dir= $( PWD) /internal/rootcoord --output= $( PWD) /internal/rootcoord/mocks --filename= garbage_collector.go --with-expecter --outpkg= mockrootcoord
generate-mockery-proxy : getdeps
$( INSTALL_PATH) /mockery --name= Cache --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_cache.go --structname= MockCache --with-expecter --outpkg= proxy --inpackage
$( INSTALL_PATH) /mockery --name= timestampAllocatorInterface --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_tso_test.go --structname= mockTimestampAllocator --with-expecter --outpkg= proxy --inpackage
$( INSTALL_PATH) /mockery --name= LBPolicy --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_lb_policy.go --structname= MockLBPolicy --with-expecter --outpkg= proxy --inpackage
$( INSTALL_PATH) /mockery --name= LBBalancer --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_lb_balancer.go --structname= MockLBBalancer --with-expecter --outpkg= proxy --inpackage
$( INSTALL_PATH) /mockery --name= shardClientMgr --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_shardclient_manager.go --structname= MockShardClientManager --with-expecter --outpkg= proxy --inpackage
2023-09-12 10:19:17 +08:00
$( INSTALL_PATH) /mockery --name= channelsMgr --dir= $( PWD) /internal/proxy --output= $( PWD) /internal/proxy --filename= mock_channels_manager.go --structname= MockChannelsMgr --with-expecter --outpkg= proxy --inpackage
2023-09-04 21:19:48 +08:00
generate-mockery-querycoord : getdeps
$( INSTALL_PATH) /mockery --name= QueryNodeServer --dir= $( PWD) /internal/proto/querypb/ --output= $( PWD) /internal/querycoordv2/mocks --filename= mock_querynode.go --with-expecter --structname= MockQueryNodeServer
$( INSTALL_PATH) /mockery --name= Broker --dir= $( PWD) /internal/querycoordv2/meta --output= $( PWD) /internal/querycoordv2/meta --filename= mock_broker.go --with-expecter --structname= MockBroker --outpkg= meta
2024-06-21 10:24:12 +08:00
$( INSTALL_PATH) /mockery --name= TargetManagerInterface --dir= $( PWD) /internal/querycoordv2/meta --output= $( PWD) /internal/querycoordv2/meta --filename= mock_target_manager.go --with-expecter --structname= MockTargetManager --inpackage
2023-09-04 21:19:48 +08:00
$( INSTALL_PATH) /mockery --name= Scheduler --dir= $( PWD) /internal/querycoordv2/task --output= $( PWD) /internal/querycoordv2/task --filename= mock_scheduler.go --with-expecter --structname= MockScheduler --outpkg= task --inpackage
$( INSTALL_PATH) /mockery --name= Cluster --dir= $( PWD) /internal/querycoordv2/session --output= $( PWD) /internal/querycoordv2/session --filename= mock_cluster.go --with-expecter --structname= MockCluster --outpkg= session --inpackage
$( INSTALL_PATH) /mockery --name= Balance --dir= $( PWD) /internal/querycoordv2/balance --output= $( PWD) /internal/querycoordv2/balance --filename= mock_balancer.go --with-expecter --structname= MockBalancer --outpkg= balance --inpackage
$( INSTALL_PATH) /mockery --name= Controller --dir= $( PWD) /internal/querycoordv2/dist --output= $( PWD) /internal/querycoordv2/dist --filename= mock_controller.go --with-expecter --structname= MockController --outpkg= dist --inpackage
2023-09-05 14:13:49 +08:00
generate-mockery-querynode : getdeps build -cpp
@source $( PWD) /scripts/setenv.sh # setup PKG_CONFIG_PATH
2023-10-11 20:45:35 +08:00
$( INSTALL_PATH) /mockery --name= QueryHook --dir= $( PWD) /internal/querynodev2/optimizers --output= $( PWD) /internal/querynodev2/optimizers --filename= mock_query_hook.go --with-expecter --outpkg= optimizers --structname= MockQueryHook --inpackage
2023-09-04 21:19:48 +08:00
$( INSTALL_PATH) /mockery --name= Manager --dir= $( PWD) /internal/querynodev2/cluster --output= $( PWD) /internal/querynodev2/cluster --filename= mock_manager.go --with-expecter --outpkg= cluster --structname= MockManager --inpackage
$( INSTALL_PATH) /mockery --name= SegmentManager --dir= $( PWD) /internal/querynodev2/segments --output= $( PWD) /internal/querynodev2/segments --filename= mock_segment_manager.go --with-expecter --outpkg= segments --structname= MockSegmentManager --inpackage
$( INSTALL_PATH) /mockery --name= CollectionManager --dir= $( PWD) /internal/querynodev2/segments --output= $( PWD) /internal/querynodev2/segments --filename= mock_collection_manager.go --with-expecter --outpkg= segments --structname= MockCollectionManager --inpackage
$( INSTALL_PATH) /mockery --name= Loader --dir= $( PWD) /internal/querynodev2/segments --output= $( PWD) /internal/querynodev2/segments --filename= mock_loader.go --with-expecter --outpkg= segments --structname= MockLoader --inpackage
$( INSTALL_PATH) /mockery --name= Segment --dir= $( PWD) /internal/querynodev2/segments --output= $( PWD) /internal/querynodev2/segments --filename= mock_segment.go --with-expecter --outpkg= segments --structname= MockSegment --inpackage
$( INSTALL_PATH) /mockery --name= Worker --dir= $( PWD) /internal/querynodev2/cluster --output= $( PWD) /internal/querynodev2/cluster --filename= mock_worker.go --with-expecter --outpkg= worker --structname= MockWorker --inpackage
$( INSTALL_PATH) /mockery --name= ShardDelegator --dir= $( PWD) /internal/querynodev2/delegator/ --output= $( PWD) /internal/querynodev2/delegator/ --filename= mock_delegator.go --with-expecter --outpkg= delegator --structname= MockShardDelegator --inpackage
generate-mockery-datacoord : getdeps
$( INSTALL_PATH) /mockery --name= compactionPlanContext --dir= internal/datacoord --filename= mock_compaction_plan_context.go --output= internal/datacoord --structname= MockCompactionPlanContext --with-expecter --inpackage
$( INSTALL_PATH) /mockery --name= Handler --dir= internal/datacoord --filename= mock_handler.go --output= internal/datacoord --structname= NMockHandler --with-expecter --inpackage
$( INSTALL_PATH) /mockery --name= allocator --dir= internal/datacoord --filename= mock_allocator_test.go --output= internal/datacoord --structname= NMockAllocator --with-expecter --inpackage
2023-11-07 14:02:20 +08:00
$( INSTALL_PATH) /mockery --name= RWChannelStore --dir= internal/datacoord --filename= mock_channel_store.go --output= internal/datacoord --structname= MockRWChannelStore --with-expecter --inpackage
2023-11-21 09:26:22 +08:00
$( INSTALL_PATH) /mockery --name= IndexEngineVersionManager --dir= internal/datacoord --filename= mock_index_engine_version_manager.go --output= internal/datacoord --structname= MockVersionManager --with-expecter --inpackage
2023-11-23 17:30:25 +08:00
$( INSTALL_PATH) /mockery --name= TriggerManager --dir= internal/datacoord --filename= mock_trigger_manager.go --output= internal/datacoord --structname= MockTriggerManager --with-expecter --inpackage
2023-12-11 17:52:37 +08:00
$( INSTALL_PATH) /mockery --name= Cluster --dir= internal/datacoord --filename= mock_cluster.go --output= internal/datacoord --structname= MockCluster --with-expecter --inpackage
$( INSTALL_PATH) /mockery --name= SessionManager --dir= internal/datacoord --filename= mock_session_manager.go --output= internal/datacoord --structname= MockSessionManager --with-expecter --inpackage
2023-11-23 17:30:25 +08:00
$( INSTALL_PATH) /mockery --name= compactionPlanContext --dir= internal/datacoord --filename= mock_compaction_plan_context.go --output= internal/datacoord --structname= MockCompactionPlanContext --with-expecter --inpackage
2023-12-05 18:44:37 +08:00
$( INSTALL_PATH) /mockery --name= CompactionMeta --dir= internal/datacoord --filename= mock_compaction_meta.go --output= internal/datacoord --structname= MockCompactionMeta --with-expecter --inpackage
2023-12-25 19:24:46 +08:00
$( INSTALL_PATH) /mockery --name= ChannelManager --dir= internal/datacoord --filename= mock_channelmanager.go --output= internal/datacoord --structname= MockChannelManager --with-expecter --inpackage
2024-05-07 15:49:30 +08:00
$( INSTALL_PATH) /mockery --name= SubCluster --dir= internal/datacoord --filename= mock_subcluster.go --output= internal/datacoord --structname= MockSubCluster --with-expecter --inpackage
2024-04-12 16:01:19 +08:00
$( INSTALL_PATH) /mockery --name= Broker --dir= internal/datacoord/broker --filename= mock_coordinator_broker.go --output= internal/datacoord/broker --structname= MockBroker --with-expecter --inpackage
2024-07-02 09:50:39 +08:00
$( INSTALL_PATH) /mockery --name= WorkerManager --dir= internal/datacoord --filename= mock_worker_manager.go --output= internal/datacoord --structname= MockWorkerManager --with-expecter --inpackage
2023-09-04 21:19:48 +08:00
generate-mockery-datanode : getdeps
$( INSTALL_PATH) /mockery --name= Allocator --dir= $( PWD) /internal/datanode/allocator --output= $( PWD) /internal/datanode/allocator --filename= mock_allocator.go --with-expecter --structname= MockAllocator --outpkg= allocator --inpackage
2023-10-11 17:03:34 +08:00
$( INSTALL_PATH) /mockery --name= Broker --dir= $( PWD) /internal/datanode/broker --output= $( PWD) /internal/datanode/broker/ --filename= mock_broker.go --with-expecter --structname= MockBroker --outpkg= broker --inpackage
2023-10-31 02:30:16 +08:00
$( INSTALL_PATH) /mockery --name= MetaCache --dir= $( PWD) /internal/datanode/metacache --output= $( PWD) /internal/datanode/metacache --filename= mock_meta_cache.go --with-expecter --structname= MockMetaCache --outpkg= metacache --inpackage
2023-11-04 12:10:17 +08:00
$( INSTALL_PATH) /mockery --name= SyncManager --dir= $( PWD) /internal/datanode/syncmgr --output= $( PWD) /internal/datanode/syncmgr --filename= mock_sync_manager.go --with-expecter --structname= MockSyncManager --outpkg= syncmgr --inpackage
2023-12-26 10:40:47 +08:00
$( INSTALL_PATH) /mockery --name= MetaWriter --dir= $( PWD) /internal/datanode/syncmgr --output= $( PWD) /internal/datanode/syncmgr --filename= mock_meta_writer.go --with-expecter --structname= MockMetaWriter --outpkg= syncmgr --inpackage
2024-01-05 21:42:47 +08:00
$( INSTALL_PATH) /mockery --name= Serializer --dir= $( PWD) /internal/datanode/syncmgr --output= $( PWD) /internal/datanode/syncmgr --filename= mock_serializer.go --with-expecter --structname= MockSerializer --outpkg= syncmgr --inpackage
2024-02-05 11:33:43 +08:00
$( INSTALL_PATH) /mockery --name= Task --dir= $( PWD) /internal/datanode/syncmgr --output= $( PWD) /internal/datanode/syncmgr --filename= mock_task.go --with-expecter --structname= MockTask --outpkg= syncmgr --inpackage
2023-11-15 15:24:18 +08:00
$( INSTALL_PATH) /mockery --name= WriteBuffer --dir= $( PWD) /internal/datanode/writebuffer --output= $( PWD) /internal/datanode/writebuffer --filename= mock_write_buffer.go --with-expecter --structname= MockWriteBuffer --outpkg= writebuffer --inpackage
2023-11-16 00:22:20 +08:00
$( INSTALL_PATH) /mockery --name= BufferManager --dir= $( PWD) /internal/datanode/writebuffer --output= $( PWD) /internal/datanode/writebuffer --filename= mock_mananger.go --with-expecter --structname= MockBufferManager --outpkg= writebuffer --inpackage
2023-11-30 14:30:28 +08:00
$( INSTALL_PATH) /mockery --name= BinlogIO --dir= $( PWD) /internal/datanode/io --output= $( PWD) /internal/datanode/io --filename= mock_binlogio.go --with-expecter --structname= MockBinlogIO --outpkg= io --inpackage
2023-11-30 18:42:32 +08:00
$( INSTALL_PATH) /mockery --name= FlowgraphManager --dir= $( PWD) /internal/datanode --output= $( PWD) /internal/datanode --filename= mock_fgmanager.go --with-expecter --structname= MockFlowgraphManager --outpkg= datanode --inpackage
2023-12-27 16:00:48 +08:00
$( INSTALL_PATH) /mockery --name= ChannelManager --dir= $( PWD) /internal/datanode --output= $( PWD) /internal/datanode --filename= mock_channelmanager.go --with-expecter --structname= MockChannelManager --outpkg= datanode --inpackage
2024-06-25 11:16:02 +08:00
$( INSTALL_PATH) /mockery --name= Compactor --dir= $( PWD) /internal/datanode/compaction --output= $( PWD) /internal/datanode/compaction --filename= mock_compactor.go --with-expecter --structname= MockCompactor --outpkg= compaction --inpackage
2023-09-04 21:19:48 +08:00
generate-mockery-metastore : getdeps
2023-09-11 20:43:17 +08:00
$( INSTALL_PATH) /mockery --name= RootCoordCatalog --dir= $( PWD) /internal/metastore --output= $( PWD) /internal/metastore/mocks --filename= mock_rootcoord_catalog.go --with-expecter --structname= RootCoordCatalog --outpkg= mocks
$( INSTALL_PATH) /mockery --name= DataCoordCatalog --dir= $( PWD) /internal/metastore --output= $( PWD) /internal/metastore/mocks --filename= mock_datacoord_catalog.go --with-expecter --structname= DataCoordCatalog --outpkg= mocks
$( INSTALL_PATH) /mockery --name= QueryCoordCatalog --dir= $( PWD) /internal/metastore --output= $( PWD) /internal/metastore/mocks --filename= mock_querycoord_catalog.go --with-expecter --structname= QueryCoordCatalog --outpkg= mocks
2023-09-04 21:19:48 +08:00
generate-mockery-utils : getdeps
# dependency.Factory
$( INSTALL_PATH) /mockery --name= Factory --dir= internal/util/dependency --output= internal/util/dependency --filename= mock_factory.go --with-expecter --structname= MockFactory --inpackage
# tso.Allocator
$( INSTALL_PATH) /mockery --name= Allocator --dir= internal/tso --output= internal/tso/mocks --filename= allocator.go --with-expecter --structname= Allocator --outpkg= mocktso
2023-11-03 10:14:16 +08:00
$( INSTALL_PATH) /mockery --name= SessionInterface --dir= $( PWD) /internal/util/sessionutil --output= $( PWD) /internal/util/sessionutil --filename= mock_session.go --with-expecter --structname= MockSession --inpackage
2023-12-13 10:46:44 +08:00
$( INSTALL_PATH) /mockery --name= GrpcClient --dir= $( PWD) /internal/util/grpcclient --output= $( PWD) /internal/mocks --filename= mock_grpc_client.go --with-expecter --structname= MockGrpcClient
2023-12-20 19:22:42 +08:00
# proxy_client_manager.go
$( INSTALL_PATH) /mockery --name= ProxyClientManagerInterface --dir= $( PWD) /internal/util/proxyutil --output= $( PWD) /internal/util/proxyutil --filename= mock_proxy_client_manager.go --with-expecter --structname= MockProxyClientManager --inpackage
$( INSTALL_PATH) /mockery --name= ProxyWatcherInterface --dir= $( PWD) /internal/util/proxyutil --output= $( PWD) /internal/util/proxyutil --filename= mock_proxy_watcher.go --with-expecter --structname= MockProxyWatcher --inpackage
2023-09-04 21:19:48 +08:00
generate-mockery-kv : getdeps
$( INSTALL_PATH) /mockery --name= TxnKV --dir= $( PWD) /internal/kv --output= $( PWD) /internal/kv/mocks --filename= txn_kv.go --with-expecter
$( INSTALL_PATH) /mockery --name= MetaKv --dir= $( PWD) /internal/kv --output= $( PWD) /internal/kv/mocks --filename= meta_kv.go --with-expecter
$( INSTALL_PATH) /mockery --name= WatchKV --dir= $( PWD) /internal/kv --output= $( PWD) /internal/kv/mocks --filename= watch_kv.go --with-expecter
$( INSTALL_PATH) /mockery --name= SnapShotKV --dir= $( PWD) /internal/kv --output= $( PWD) /internal/kv/mocks --filename= snapshot_kv.go --with-expecter
2023-09-27 10:21:26 +08:00
$( INSTALL_PATH) /mockery --name= Predicate --dir= $( PWD) /internal/kv/predicates --output= $( PWD) /internal/kv/predicates --filename= mock_predicate.go --with-expecter --inpackage
2023-09-04 21:19:48 +08:00
2023-11-29 20:52:27 +08:00
generate-mockery-chunk-manager : getdeps
$( INSTALL_PATH) /mockery --name= ChunkManager --dir= $( PWD) /internal/storage --output= $( PWD) /internal/mocks --filename= mock_chunk_manager.go --with-expecter
2023-09-04 21:19:48 +08:00
generate-mockery-pkg :
$( MAKE) -C pkg generate-mockery
generate-mockery : generate -mockery -types generate -mockery -kv generate -mockery -rootcoord generate -mockery -proxy generate -mockery -querycoord generate -mockery -querynode generate -mockery -datacoord generate -mockery -pkg
2023-09-11 20:43:17 +08:00
2024-05-10 14:31:37 +08:00
generate-yaml : milvus -tools
@echo "Updating milvus config yaml"
@$( PWD) /bin/tools/config gen-yaml && mv milvus.yaml configs/milvus.yaml
2024-03-25 15:51:09 +08:00
MMAP_MIGRATION_PATH = $( PWD) /cmd/tools/migration/mmap/tool
mmap-migration :
@echo "Building migration tool ..."
@source $( PWD) /scripts/setenv.sh && \
mkdir -p $( INSTALL_PATH) && go env -w CGO_ENABLED = "1" && \
2024-06-20 14:52:00 +08:00
GO111MODULE = on $( GO) build -pgo= $( PGO_PATH) /default.pgo -ldflags= " -r $$ {RPATH} -X ' $( OBJPREFIX) .BuildTags= $( BUILD_TAGS) ' -X ' $( OBJPREFIX) .BuildTime= $( BUILD_TIME) ' -X ' $( OBJPREFIX) .GitCommit= $( GIT_COMMIT) ' -X ' $( OBJPREFIX) .GoVersion= $( GO_VERSION) ' " \
2024-06-25 11:16:02 +08:00
-tags dynamic -o $( INSTALL_PATH) /mmap-migration $( MMAP_MIGRATION_PATH) /main.go 1>/dev/null