Improve the download_milvus_proto bash (#19894)

Signed-off-by: SimFG <bang.fu@zilliz.com>

Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
SimFG 2022-10-19 20:45:32 +08:00 committed by GitHub
parent 87248dc1a9
commit e10d21ef90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 18 deletions

View File

@ -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)'" \ 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 ${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: download-milvus-proto:
@echo "Download milvus-proto repo ..." @echo "Download milvus-proto repo ..."
@(env bash $(PWD)/scripts/download_milvus_proto.sh) @(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 build-cpp: download-milvus-proto
@echo "Building Milvus cpp library ..." @echo "Building Milvus cpp library ..."
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index}) @(env bash $(PWD)/scripts/core_build.sh -t ${mode} -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})

2
go.sum
View File

@ -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/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 h1:TfeY0NxYxZzUfIfYe5qYDBzt4ZYRqzUjTR6CvUzjat8=
github.com/milvus-io/gorocksdb v0.0.0-20220624081344-8c5f4212846b/go.mod h1:iwW+9cWfIzzDseEBCCeDSN5SD16Tidvy8cwQ7ZY8Qj4= 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 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/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= github.com/milvus-io/pulsar-client-go v0.6.8 h1:fZdZH73aPRszu2fazyeeahQEz34tyn1Pt9EkqJmV100=

26
scripts/download_milvus_proto.sh Normal file → Executable file
View File

@ -1,14 +1,20 @@
#!/usr/bin/env bash #!/usr/bin/env bash
SCRIPTS_DIR=$(dirname "$0") 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 if [ ! -d "$THIRD_PARTY_DIR/milvus-proto" ]; then
mkdir -p $THIRD_PARTY_DIR
pushd $THIRD_PARTY_DIR pushd $THIRD_PARTY_DIR
git clone https://github.com/milvus-io/milvus-proto.git
rm -rf milvus-proto cd milvus-proto
API_VERSION=$(go list -m github.com/milvus-io/milvus-proto/go-api | awk -F' ' '{print $2}')
git clone -b $GIT_BRANCH https://github.com/milvus-io/milvus-proto.git COMMIT_ID=$(echo $API_VERSION | awk -F'-' '{print $3}')
echo "version: $API_VERSION, commitID: $COMMIT_ID"
popd if [ -z $COMMIT_ID ]; then
git checkout -b $API_VERSION $API_VERSION
else
git reset --hard $COMMIT_ID
fi
popd
fi

View File

@ -13,4 +13,12 @@ go get github.com/milvus-io/milvus-proto/go-api@$commitID
SCRIPTS_DIR=$(dirname "$0") SCRIPTS_DIR=$(dirname "$0")
EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples EXAMPLE_DIR=$SCRIPTS_DIR/../cmake_build/thirdparty/protobuf/protobuf-src/examples
rm -rf $EXAMPLE_DIR rm -rf $EXAMPLE_DIR
go mod tidy 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