Skip to content

Commit

Permalink
enhance: Update protobuf-go to protobuf-go v2 (milvus-io#34394)
Browse files Browse the repository at this point in the history
issue: milvus-io#34252

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
  • Loading branch information
weiliu1031 committed Jul 29, 2024
1 parent e2e38e9 commit c45f38a
Show file tree
Hide file tree
Showing 185 changed files with 1,057 additions and 505 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,17 @@ build-3rdparty:

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)
@mkdir -p ${INSTALL_PATH}
@which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && GOBIN=${INSTALL_PATH} go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0)
@which protoc-gen-go-grpc 1>/dev/null || (echo "Installing protoc-gen-go-grpc" && GOBIN=${INSTALL_PATH} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0)
@(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH})

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)
@mkdir -p ${INSTALL_PATH}
@which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && GOBIN=${INSTALL_PATH} go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0)
@which protoc-gen-go-grpc 1>/dev/null || (echo "Installing protoc-gen-go-grpc" && GOBIN=${INSTALL_PATH} go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0)
@(env bash $(PWD)/scripts/generate_proto.sh ${INSTALL_PATH})

build-cpp: generated-proto
@echo "Building Milvus cpp library ..."
Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import (
"sync"
"time"

"github.com/gogo/status"
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
Expand Down
2 changes: 1 addition & 1 deletion client/collection_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package client

import (
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
Expand Down
2 changes: 1 addition & 1 deletion client/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"fmt"
"testing"

"github.com/golang/protobuf/proto"
"github.com/samber/lo"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
Expand Down
8 changes: 3 additions & 5 deletions client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ go 1.21
require (
github.com/blang/semver/v4 v4.0.0
github.com/cockroachdb/errors v1.9.1
github.com/gogo/status v1.1.0
github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632
github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3
Expand All @@ -15,8 +13,8 @@ require (
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.17.1
go.uber.org/atomic v1.10.0
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2
google.golang.org/grpc v1.57.1
google.golang.org/protobuf v1.33.0
)

require (
Expand All @@ -40,8 +38,8 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/godbus/dbus/v5 v5.0.4 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
Expand Down Expand Up @@ -109,6 +107,7 @@ require (
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.20.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.20.0 // indirect
Expand All @@ -117,7 +116,6 @@ require (
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions client/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,13 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
2 changes: 1 addition & 1 deletion client/read_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"encoding/json"
"strconv"

"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus-proto/go-api/v2/milvuspb"
Expand Down
2 changes: 1 addition & 1 deletion cmd/milvus/mck.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"time"

"github.com/cockroachdb/errors"
"github.com/golang/protobuf/proto"
clientv3 "go.etcd.io/etcd/client/v3"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"

"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
etcdkv "github.com/milvus-io/milvus/internal/kv/etcd"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/datameta/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sort"
"strings"

"github.com/golang/protobuf/proto"
"go.uber.org/zap"
"google.golang.org/protobuf/proto"

etcdkv "github.com/milvus-io/milvus/internal/kv/etcd"
"github.com/milvus-io/milvus/internal/proto/datapb"
Expand Down
28 changes: 0 additions & 28 deletions cmd/tools/migration/backend/backup_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package backend
import (
"encoding/json"

"github.com/golang/protobuf/proto"

"github.com/milvus-io/milvus/cmd/tools/migration/console"
)

Expand All @@ -14,32 +12,6 @@ const (
BackupHeaderVersionV1 BackupHeaderVersion = iota
)

// BackupHeader stores etcd backup header information
type BackupHeader struct {
// Version number for backup format
Version BackupHeaderVersion `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
// instance name, as rootPath for key prefix
Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`
// MetaPath used in keys
MetaPath string `protobuf:"bytes,3,opt,name=meta_path,proto3" json:"meta_path,omitempty"`
// Entries record number of key-value in backup
Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"`
// Component is the backup target
Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"`
// Extra property reserved
Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"-"`
}

func (v *BackupHeader) Reset() {
*v = BackupHeader{}
}

func (v *BackupHeader) String() string {
return proto.CompactTextString(v)
}

func (v *BackupHeader) ProtoMessage() {}

type BackupHeaderExtra struct {
EntryIncludeRootPath bool `json:"entry_include_root_path"`
}
Expand Down
203 changes: 203 additions & 0 deletions cmd/tools/migration/backend/backup_header.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c45f38a

Please sign in to comment.