diff --git a/Makefile b/Makefile index cbbd5f945e..bb967883bd 100644 --- a/Makefile +++ b/Makefile @@ -118,16 +118,14 @@ embd-milvus: build-cpp-embd print-build-info 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)'" \ ${APPLE_SILICON_FLAG} -buildmode=c-shared -o $(INSTALL_PATH)/embd-milvus.so $(PWD)/pkg/embedded/embedded.go 1>/dev/null -update-milvus-api: update-api-version download-milvus-proto +update-milvus-api: download-milvus-proto + @echo "Update milvus/api version ..." + @(env bash $(PWD)/scripts/update-api-version.sh) download-milvus-proto: @echo "Download milvus-proto repo ..." @(env bash $(PWD)/scripts/download_milvus_proto.sh) -update-api-version: - @echo "Update milvus/api version ..." - @(env bash $(PWD)/scripts/update-api-version.sh) - build-cpp: download-milvus-proto @echo "Building Milvus cpp library ..." @(env bash $(PWD)/scripts/core_build.sh -t ${mode} -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index}) diff --git a/go.sum b/go.sum index 33caf8a858..a3a857e831 100644 --- a/go.sum +++ b/go.sum @@ -493,8 +493,6 @@ github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyex github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8= github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= -github.com/milvus-io/milvus-proto/go-api v0.0.0-20221014075920-6c03ca8c3749 h1:IB+Jyx3dVtrMSGYYVlobkSC9Kat+lxd/GM1i0cKIJXA= -github.com/milvus-io/milvus-proto/go-api v0.0.0-20221014075920-6c03ca8c3749/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk= github.com/milvus-io/milvus-proto/go-api v0.0.0-20221017091121-7a703d4485b5 h1:CDEQi9T8A7YEtQwHXEBXTl/PDXLzzJSRral8TM+1Krk= github.com/milvus-io/milvus-proto/go-api v0.0.0-20221017091121-7a703d4485b5/go.mod h1:148qnlmZ0Fdm1Fq+Mj/OW2uDoEP25g3mjh0vMGtkgmk= github.com/milvus-io/pulsar-client-go v0.6.8 h1:fZdZH73aPRszu2fazyeeahQEz34tyn1Pt9EkqJmV100= diff --git a/scripts/download_milvus_proto.sh b/scripts/download_milvus_proto.sh old mode 100644 new mode 100755 index 7358b02e03..de72640d95 --- a/scripts/download_milvus_proto.sh +++ b/scripts/download_milvus_proto.sh @@ -1,14 +1,20 @@ #!/usr/bin/env bash SCRIPTS_DIR=$(dirname "$0") -THIRD_PARTY_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/ +THIRD_PARTY_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty -mkdir -p $THIRD_PARTY_DIR - -pushd $THIRD_PARTY_DIR - -rm -rf milvus-proto - -git clone -b $GIT_BRANCH https://github.com/milvus-io/milvus-proto.git - -popd \ No newline at end of file +if [ ! -d "$THIRD_PARTY_DIR/milvus-proto" ]; then + mkdir -p $THIRD_PARTY_DIR + pushd $THIRD_PARTY_DIR + git clone https://github.com/milvus-io/milvus-proto.git + cd milvus-proto + API_VERSION=$(go list -m github.com/milvus-io/milvus-proto/go-api | awk -F' ' '{print $2}') + COMMIT_ID=$(echo $API_VERSION | awk -F'-' '{print $3}') + echo "version: $API_VERSION, commitID: $COMMIT_ID" + if [ -z $COMMIT_ID ]; then + git checkout -b $API_VERSION $API_VERSION + else + git reset --hard $COMMIT_ID + fi + popd +fi \ No newline at end of file diff --git a/scripts/update-api-version.sh b/scripts/update-api-version.sh index 22c0ac0681..79ec4d43f8 100755 --- a/scripts/update-api-version.sh +++ b/scripts/update-api-version.sh @@ -13,4 +13,12 @@ go get github.com/milvus-io/milvus-proto/go-api@$commitID SCRIPTS_DIR=$(dirname "$0") EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples rm -rf $EXAMPLE_DIR -go mod tidy \ No newline at end of file +go mod tidy + +line echo "Update the milvus-proto repo" +THIRD_PARTY_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty + +pushd $THIRD_PARTY_DIR/milvus-proto + git checkout master + git pull origin master +popd \ No newline at end of file