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
|
2022-02-09 14:27:46 +08:00
|
|
|
OS := $(shell uname -s)
|
|
|
|
ARCH := $(shell arch)
|
|
|
|
mode = Release
|
2022-09-29 11:08:54 +08:00
|
|
|
disk_index = OFF
|
2023-01-29 10:59:49 +08:00
|
|
|
useasan = false
|
|
|
|
ifeq (${USE_ASAN}, true)
|
|
|
|
useasan = true
|
|
|
|
endif
|
2020-10-30 16:25:06 +08:00
|
|
|
|
2022-11-03 14:19:35 +08:00
|
|
|
|
2022-10-16 20:49:27 +08:00
|
|
|
export GIT_BRANCH=master
|
2022-10-12 14:33:23 +08:00
|
|
|
|
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" && \
|
|
|
|
GO111MODULE=on $(GO) build -ldflags="-r $${RPATH} -X '$(OBJPREFIX).BuildTags=$(BUILD_TAGS)' -X '$(OBJPREFIX).BuildTime=$(BUILD_TIME)' -X '$(OBJPREFIX).GitCommit=$(GIT_COMMIT)' -X '$(OBJPREFIX).GoVersion=$(GO_VERSION)'" \
|
|
|
|
${APPLE_SILICON_FLAG} -o $(INSTALL_PATH)/milvus $(PWD)/cmd/main.go 1>/dev/null
|
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)
|
|
|
|
@$(INSTALL_PATH)/golangci-lint --version 2>&1 1>/dev/null || (echo "Installing golangci-lint into ./bin/" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(INSTALL_PATH) v1.46.2)
|
|
|
|
@$(INSTALL_PATH)/mockery --version 2>&1 1>/dev/null || (echo "Installing mockery v2.16.0 to ./bin/" && GOBIN=$(INSTALL_PATH)/ go install github.com/vektra/mockery/v2@v2.16.0)
|
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; \
|
|
|
|
$(GO) build -o ../bin/revive github.com/mgechev/revive
|
|
|
|
|
2020-11-23 19:57:05 +08:00
|
|
|
cppcheck:
|
|
|
|
@(env bash ${PWD}/scripts/core_build.sh -l)
|
2020-11-18 10:07:05 +08:00
|
|
|
|
2022-11-03 14:19:35 +08:00
|
|
|
# put generate proto as a separated target because build cpp have different cases like with unittest.
|
2022-11-28 09:47:14 +08:00
|
|
|
generated-proto-go-without-cpp: export protoc:=${PWD}/cmake_build/bin/protoc
|
2022-11-03 14:19:35 +08:00
|
|
|
generated-proto-go-without-cpp:
|
2020-12-09 20:07:27 +08:00
|
|
|
@mkdir -p ${GOPATH}/bin
|
2022-04-06 19:47:31 +08:00
|
|
|
@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)
|
2020-11-18 10:07:05 +08:00
|
|
|
@(env bash $(PWD)/scripts/proto_gen_go.sh)
|
|
|
|
|
2022-11-03 14:19:35 +08:00
|
|
|
generated-proto-go: build-cpp generated-proto-go-without-cpp
|
|
|
|
|
|
|
|
check-proto-product-only:
|
|
|
|
@(env bash $(PWD)/scripts/check_proto_product.sh)
|
|
|
|
check-proto-product: generated-proto-go check-proto-product-only
|
|
|
|
|
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
|
|
|
ifdef GO_DIFF_FILES
|
|
|
|
@echo "Running $@ check"
|
|
|
|
@GO111MODULE=on env bash $(PWD)/scripts/gofmt.sh $(GO_DIFF_FILES)
|
|
|
|
else
|
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/
|
2020-12-03 19:00:11 +08:00
|
|
|
@GO111MODULE=on env bash $(PWD)/scripts/gofmt.sh tests/go/
|
2020-12-29 17:19:44 +08:00
|
|
|
endif
|
2020-10-30 16:25:06 +08:00
|
|
|
|
2021-07-09 11:59:09 +08:00
|
|
|
lint: tools/bin/revive
|
2020-12-31 17:25:45 +08:00
|
|
|
@echo "Running $@ check"
|
|
|
|
@tools/bin/revive -formatter friendly -config tools/check/revive.toml ./...
|
|
|
|
|
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"
|
2023-01-29 10:59:49 +08:00
|
|
|
@GO111MODULE=on $(INSTALL_PATH)/golangci-lint cache clean
|
|
|
|
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./internal/...
|
|
|
|
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./cmd/...
|
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" && \
|
|
|
|
GO111MODULE=on $(GO) build -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" && \
|
|
|
|
GO111MODULE=on $(GO) build -ldflags="-r $${RPATH} -X '$(OBJPREFIX).BuildTags=$(BUILD_TAGS)' -X '$(OBJPREFIX).BuildTime=$(BUILD_TIME)' -X '$(OBJPREFIX).GitCommit=$(GIT_COMMIT)' -X '$(OBJPREFIX).GoVersion=$(GO_VERSION)'" \
|
|
|
|
${APPLE_SILICON_FLAG} -o $(INSTALL_PATH)/meta-migration $(MIGRATION_PATH)/main.go 1>/dev/null
|
2022-10-12 11:37:23 +08:00
|
|
|
|
2021-06-22 11:34:04 +08:00
|
|
|
BUILD_TAGS = $(shell git describe --tags --always --dirty="-dev")
|
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)
|
2022-04-20 23:03:41 +08:00
|
|
|
ifeq ($(OS),Darwin)
|
|
|
|
ifeq ($(ARCH),arm64)
|
|
|
|
APPLE_SILICON_FLAG = -tags dynamic
|
|
|
|
endif
|
|
|
|
endif
|
2021-06-22 11:34:04 +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)"
|
|
|
|
|
2022-10-12 14:33:23 +08:00
|
|
|
|
2021-04-15 09:28:46 +08:00
|
|
|
|
2022-03-16 16:51:22 +08:00
|
|
|
embd-milvus: build-cpp-embd print-build-info
|
|
|
|
@echo "Building **Embedded** Milvus ..."
|
2022-06-28 19:58:25 +08:00
|
|
|
@source $(PWD)/scripts/setenv.sh && \
|
|
|
|
mkdir -p $(INSTALL_PATH) && go env -w CGO_ENABLED="1" && \
|
|
|
|
GO111MODULE=on $(GO) build -ldflags="-r /tmp/milvus/lib/ -X '$(OBJPREFIX).BuildTags=$(BUILD_TAGS)' -X '$(OBJPREFIX).BuildTime=$(BUILD_TIME)' -X '$(OBJPREFIX).GitCommit=$(GIT_COMMIT)' -X '$(OBJPREFIX).GoVersion=$(GO_VERSION)'" \
|
2022-04-20 23:03:41 +08:00
|
|
|
${APPLE_SILICON_FLAG} -buildmode=c-shared -o $(INSTALL_PATH)/embd-milvus.so $(PWD)/pkg/embedded/embedded.go 1>/dev/null
|
2022-03-16 16:51:22 +08:00
|
|
|
|
2022-10-19 20:45:32 +08:00
|
|
|
update-milvus-api: download-milvus-proto
|
|
|
|
@echo "Update milvus/api version ..."
|
|
|
|
@(env bash $(PWD)/scripts/update-api-version.sh)
|
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
|
|
|
|
2022-10-16 20:49:27 +08:00
|
|
|
build-cpp: download-milvus-proto
|
2021-07-09 11:59:09 +08:00
|
|
|
@echo "Building Milvus cpp library ..."
|
2022-09-29 11:08:54 +08:00
|
|
|
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
2022-03-16 16:51:22 +08:00
|
|
|
|
2022-10-16 20:49:27 +08:00
|
|
|
build-cpp-embd: download-milvus-proto
|
2022-03-16 16:51:22 +08:00
|
|
|
@echo "Building **Embedded** Milvus cpp library ..."
|
2022-09-29 11:08:54 +08:00
|
|
|
@(env bash $(PWD)/scripts/core_build.sh -b -t ${mode} -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
2020-10-30 16:25:06 +08:00
|
|
|
|
2022-10-16 20:49:27 +08:00
|
|
|
build-cpp-with-unittest: download-milvus-proto
|
2021-07-09 11:59:09 +08:00
|
|
|
@echo "Building Milvus cpp library with unittest ..."
|
2022-09-29 11:08:54 +08:00
|
|
|
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
2020-10-30 16:25:06 +08:00
|
|
|
|
2022-10-16 20:49:27 +08:00
|
|
|
build-cpp-with-coverage: download-milvus-proto
|
2022-04-11 09:49:34 +08:00
|
|
|
@echo "Building Milvus cpp library with coverage and unittest ..."
|
2023-01-29 10:59:49 +08:00
|
|
|
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -a ${useasan} -c -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
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)
|
|
|
|
|
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-10-08 19:30:58 +08:00
|
|
|
# Package docker image locally.
|
|
|
|
# TODO: fix error occur at starting up
|
|
|
|
docker: install
|
|
|
|
./build/build_image.sh
|
2020-10-30 16:25:06 +08:00
|
|
|
|
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."
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning up all the generated files"
|
|
|
|
@find . -name '*.test' | xargs rm -fv
|
|
|
|
@find . -name '*~' | xargs rm -fv
|
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
|
|
|
|
@rm -rf cwrapper_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 \
|
|
|
|
-ldflags="-X 'main.BuildTags=$(BUILD_TAGS)' -X 'main.BuildTime=$(BUILD_TIME)' -X 'main.GitCommit=$(GIT_COMMIT)' -X 'main.GoVersion=$(GO_VERSION)'" \
|
|
|
|
-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
|
|
|
|
|
|
|
mock-datanode:
|
|
|
|
mockery --name=DataNode --dir=$(PWD)/internal/types --output=$(PWD)/internal/mocks --filename=mock_datanode.go --with-expecter
|
|
|
|
|
2023-01-04 16:37:35 +08:00
|
|
|
mock-rootcoord:
|
|
|
|
mockery --name=RootCoord --dir=$(PWD)/internal/types --output=$(PWD)/internal/mocks --filename=mock_rootcoord.go --with-expecter
|
|
|
|
|
2023-01-12 09:55:42 +08:00
|
|
|
mock-datacoord:
|
|
|
|
mockery --name=DataCoord --dir=$(PWD)/internal/types --output=$(PWD)/internal/mocks --filename=mock_datacoord.go --with-expecter
|
|
|
|
|
2022-09-23 10:50:51 +08:00
|
|
|
mock-tnx-kv:
|
|
|
|
mockery --name=TxnKV --dir=$(PWD)/internal/kv --output=$(PWD)/internal/kv/mocks --filename=TxnKV.go --with-expecter
|
2022-11-03 14:19:35 +08:00
|
|
|
|
2023-01-16 13:59:42 +08:00
|
|
|
generate-mockery: getdeps
|
|
|
|
# internal/querycoordv2
|
|
|
|
$(PWD)/bin/mockery --name=QueryNodeServer --dir=$(PWD)/internal/proto/querypb/ --output=$(PWD)/internal/querycoordv2/mocks --filename=mock_querynode.go --with-expecter --structname=MockQueryNodeServer
|
|
|
|
$(PWD)/bin/mockery --name=Broker --dir=$(PWD)/internal/querycoordv2/meta --output=$(PWD)/internal/querycoordv2/meta --filename=mock_broker.go --with-expecter --structname=MockBroker --outpkg=meta
|
|
|
|
$(PWD)/bin/mockery --name=Scheduler --dir=$(PWD)/internal/querycoordv2/task --output=$(PWD)/internal/querycoordv2/task --filename=mock_scheduler.go --with-expecter --structname=MockScheduler --outpkg=task --inpackage
|
|
|
|
$(PWD)/bin/mockery --name=Cluster --dir=$(PWD)/internal/querycoordv2/session --output=$(PWD)/internal/querycoordv2/session --filename=mock_cluster.go --with-expecter --structname=MockCluster --outpkg=session --inpackage
|
|
|
|
$(PWD)/bin/mockery --name=Store --dir=$(PWD)/internal/querycoordv2/meta --output=$(PWD)/internal/querycoordv2/meta --filename=mock_store.go --with-expecter --structname=MockStore --outpkg=meta --inpackage
|
|
|
|
$(PWD)/bin/mockery --name=Balance --dir=$(PWD)/internal/querycoordv2/balance --output=$(PWD)/internal/querycoordv2/balance --filename=mock_balancer.go --with-expecter --structname=MockBalancer --outpkg=balance --inpackage
|
|
|
|
# internal/querynode
|
|
|
|
$(PWD)/bin/mockery --name=TSafeReplicaInterface --dir=$(PWD)/internal/querynode --output=$(PWD)/internal/querynode --filename=mock_tsafe_replica_test.go --with-expecter --structname=MockTSafeReplicaInterface --outpkg=querynode --inpackage
|
|
|
|
# internal/rootcoord
|
|
|
|
$(PWD)/bin/mockery --name=IMetaTable --dir=$(PWD)/internal/rootcoord --output=$(PWD)/internal/rootcoord/mocks --filename=meta_table.go --with-expecter --outpkg=mockrootcoord
|
|
|
|
$(PWD)/bin/mockery --name=GarbageCollector --dir=$(PWD)/internal/rootcoord --output=$(PWD)/internal/rootcoord/mocks --filename=garbage_collector.go --with-expecter --outpkg=mockrootcoord
|
2022-11-03 14:19:35 +08:00
|
|
|
|
|
|
|
ci-ut: build-cpp-with-coverage generated-proto-go-without-cpp codecov-cpp codecov-go
|