Skip to content

Commit

Permalink
Enable gitsubmodule for milvus-proto in pymilvus (milvus-io#975)
Browse files Browse the repository at this point in the history
See also: milvus-io/milvus#15653, milvus-io#909

Signed-off-by: XuanYang-cn <[email protected]>
  • Loading branch information
XuanYang-cn authored May 5, 2022
1 parent fc8f07e commit 175e2bf
Show file tree
Hide file tree
Showing 13 changed files with 243 additions and 1,345 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pymilvus/grpc_gen/milvus-proto"]
path = pymilvus/grpc_gen/milvus-proto
url = https://github.com/milvus-io/milvus-proto.git
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ Note: the problems, features, and questions mentioned here are not limited to Py

## Congratulations! You are now the contributor to the Milvus community!

Apart from dealing with codes and machines, you are always welcome to communicate with any member from the Milvus community. New faces join us every day, and they may as well encounter the same challenges as you faced beore. Feel free to help them. You can pass on the collaborative spirit from the assistance you acquired when you first joined the community. Let us build a collaborative, open-source, exuberant, and tolerant community together!
Apart from dealing with codes and machines, you are always welcome to communicate with any member from the Milvus community. New faces join us every day, and they may as well encounter the same challenges as you faced beore. Feel free to help them. You can pass on the collaborative spirit from the assistance you acquired when you first joined the community. Let us build a collaborative, open-source, exuberant, and tolerant community together!
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ example_index:
package:
python3 -m build --sdist --wheel --outdir dist/ .

gen_proto:
cd pymilvus/grpc_gen/proto && ./python_gen.sh
get_proto:
git submodule update --init

gen_proto: get_proto
cd pymilvus/grpc_gen && ./python_gen.sh
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,29 @@ You can upgrade PyMilvus to the latest version by:
$ pip3 install --upgrade pymilvus
```

## FAQ
Q1. How to get submodules?

A1. The following command will only get the latest protos , for protos of certain version, see
[milvus-proto](https://github.com/milvus-io/milvus-proto#usage) for details.
```shell
$ git sumodule update --init
```

Q2. How to generate python files from milvus-proto?

A2.
```shell
$ make gen_proto
```

Q3. How to use the local PyMilvus repository for Milvus server?

A3.
```shell
$ python setup.py install
```


## Documentation

Expand Down
62 changes: 34 additions & 28 deletions pymilvus/grpc_gen/common_pb2.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pymilvus/grpc_gen/milvus-proto
Submodule milvus-proto added at f56828
163 changes: 131 additions & 32 deletions pymilvus/grpc_gen/milvus_pb2.py

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions pymilvus/grpc_gen/milvus_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ def __init__(self, channel):
request_serializer=milvus__pb2.GetImportStateRequest.SerializeToString,
response_deserializer=milvus__pb2.GetImportStateResponse.FromString,
)
self.ListImportTasks = channel.unary_unary(
'/milvus.proto.milvus.MilvusService/ListImportTasks',
request_serializer=milvus__pb2.ListImportTasksRequest.SerializeToString,
response_deserializer=milvus__pb2.ListImportTasksResponse.FromString,
)
self.CreateCredential = channel.unary_unary(
'/milvus.proto.milvus.MilvusService/CreateCredential',
request_serializer=milvus__pb2.CreateCredentialRequest.SerializeToString,
Expand Down Expand Up @@ -505,6 +510,12 @@ def GetImportState(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def ListImportTasks(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def CreateCredential(self, request, context):
"""https://wiki.lfaidata.foundation/display/MIL/MEP+27+--+Support+Basic+Authentication
"""
Expand Down Expand Up @@ -743,6 +754,11 @@ def add_MilvusServiceServicer_to_server(servicer, server):
request_deserializer=milvus__pb2.GetImportStateRequest.FromString,
response_serializer=milvus__pb2.GetImportStateResponse.SerializeToString,
),
'ListImportTasks': grpc.unary_unary_rpc_method_handler(
servicer.ListImportTasks,
request_deserializer=milvus__pb2.ListImportTasksRequest.FromString,
response_serializer=milvus__pb2.ListImportTasksResponse.SerializeToString,
),
'CreateCredential': grpc.unary_unary_rpc_method_handler(
servicer.CreateCredential,
request_deserializer=milvus__pb2.CreateCredentialRequest.FromString,
Expand Down Expand Up @@ -1487,6 +1503,23 @@ def GetImportState(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def ListImportTasks(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/milvus.proto.milvus.MilvusService/ListImportTasks',
milvus__pb2.ListImportTasksRequest.SerializeToString,
milvus__pb2.ListImportTasksResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def CreateCredential(request,
target,
Expand Down
225 changes: 0 additions & 225 deletions pymilvus/grpc_gen/proto/common.proto

This file was deleted.

Loading

0 comments on commit 175e2bf

Please sign in to comment.