From 78d4d44f632ae9d22ca48469640e82b91d04249f Mon Sep 17 00:00:00 2001 From: absolutelyNoWarranty Date: Fri, 19 Jul 2019 12:14:29 +0800 Subject: [PATCH] Remove aiogrpc and use grpclib's client Remove aiogrpc from setup.py, switch to grpclib * Use grpclib for building protos * gen python files from protoc * Don't ignore pb2 files * Edit README --- .gitignore | 1 - Pipfile | 3 - Pipfile.lock | 403 +++++++++++------- README.md | 6 + serving_utils/client.py | 20 +- serving_utils/protos/list_models_grpc.py | 37 ++ serving_utils/protos/list_models_pb2.py | 126 ++++++ serving_utils/protos/list_models_pb2_grpc.py | 46 ++ serving_utils/protos/model_grpc.py | 3 + serving_utils/protos/model_pb2.py | 88 ++++ serving_utils/protos/model_pb2_grpc.py | 3 + serving_utils/protos/predict_grpc.py | 3 + serving_utils/protos/predict_pb2.py | 234 ++++++++++ serving_utils/protos/predict_pb2_grpc.py | 3 + .../protos/prediction_service_grpc.py | 38 ++ .../protos/prediction_service_pb2.py | 58 +++ .../protos/prediction_service_pb2_grpc.py | 50 +++ serving_utils/protos/resource_handle_grpc.py | 3 + serving_utils/protos/resource_handle_pb2.py | 99 +++++ .../protos/resource_handle_pb2_grpc.py | 3 + serving_utils/protos/tensor_grpc.py | 3 + serving_utils/protos/tensor_pb2.py | 255 +++++++++++ serving_utils/protos/tensor_pb2_grpc.py | 3 + serving_utils/protos/tensor_shape_grpc.py | 3 + serving_utils/protos/tensor_shape_pb2.py | 125 ++++++ serving_utils/protos/tensor_shape_pb2_grpc.py | 3 + serving_utils/protos/types_grpc.py | 3 + serving_utils/protos/types_pb2.py | 284 ++++++++++++ serving_utils/protos/types_pb2_grpc.py | 3 + setup.py | 25 +- 30 files changed, 1744 insertions(+), 190 deletions(-) create mode 100644 serving_utils/protos/list_models_grpc.py create mode 100644 serving_utils/protos/list_models_pb2.py create mode 100644 serving_utils/protos/list_models_pb2_grpc.py create mode 100644 serving_utils/protos/model_grpc.py create mode 100644 serving_utils/protos/model_pb2.py create mode 100644 serving_utils/protos/model_pb2_grpc.py create mode 100644 serving_utils/protos/predict_grpc.py create mode 100644 serving_utils/protos/predict_pb2.py create mode 100644 serving_utils/protos/predict_pb2_grpc.py create mode 100644 serving_utils/protos/prediction_service_grpc.py create mode 100644 serving_utils/protos/prediction_service_pb2.py create mode 100644 serving_utils/protos/prediction_service_pb2_grpc.py create mode 100644 serving_utils/protos/resource_handle_grpc.py create mode 100644 serving_utils/protos/resource_handle_pb2.py create mode 100644 serving_utils/protos/resource_handle_pb2_grpc.py create mode 100644 serving_utils/protos/tensor_grpc.py create mode 100644 serving_utils/protos/tensor_pb2.py create mode 100644 serving_utils/protos/tensor_pb2_grpc.py create mode 100644 serving_utils/protos/tensor_shape_grpc.py create mode 100644 serving_utils/protos/tensor_shape_pb2.py create mode 100644 serving_utils/protos/tensor_shape_pb2_grpc.py create mode 100644 serving_utils/protos/types_grpc.py create mode 100644 serving_utils/protos/types_pb2.py create mode 100644 serving_utils/protos/types_pb2_grpc.py diff --git a/.gitignore b/.gitignore index 14f673a..d5dcafd 100644 --- a/.gitignore +++ b/.gitignore @@ -96,5 +96,4 @@ dump.rdb .vscode/ .pytest_cache/ -**/*_pb2* .fake-models diff --git a/Pipfile b/Pipfile index 82583b7..c3d37af 100644 --- a/Pipfile +++ b/Pipfile @@ -3,16 +3,13 @@ url = "https://pypi.org/simple" verify_ssl = true name = "pypi" - [packages] serving-utils = {editable = true, path = "."} - [dev-packages] pytest = "*" "flake8-config-yoctol" = ">=0.0.11" pytest-asyncio = "*" - [requires] python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock index 5fbc51e..aca5373 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,137 +16,191 @@ ] }, "default": { - "aiogrpc": { + "grpcio": { "hashes": [ - "sha256:e091ace3fce6c0fa9610877ff5fdb3fab7a3a5612517c954ab52595fe851edf3", - "sha256:fabf793bcf7f645be3c125b26f7443582861fa9428ac7cfc529efe02a7ddeb87" + "sha256:03b78b4e7dcdfe3e257bb528cc93923f9cbbab6d5babf15a60d21e9a4a70b1a2", + "sha256:1ce0ccfbdfe84387dbcbf44adb4ae16ec7ae70e166ffab478993eb1ea1cba3ce", + "sha256:22e167a9406d73dd19ffe8ed6a485f17e6eac82505be8c108897f15e68badcbb", + "sha256:31d0aeca8d8ee2301c62c5c340e0889d653b1280d68f9fa203982cb6337b050e", + "sha256:44c7f99ca17ebbcc96fc54ed00b454d8313f1eac28c563098d8b901025aff941", + "sha256:5471444f53f9db6a1f1f11f5dbc173228881df8446380b6b98f90afb8fd8348e", + "sha256:561bca3b1bde6d6564306eb05848fd155136e9c3a25d2961129b1e2edba22fce", + "sha256:5bf58e1d2c2f55365c06e8cb5abe067b88ca2e5550fb62009c41df4b54505acf", + "sha256:6b7163d1e85d76b0815df63fcc310daec02b44532bb433f743142d4febcb181f", + "sha256:766d79cddad95f5f6020037fe60ea8b98578afdf0c59d5a60c106c1bdd886303", + "sha256:770b7372d5ca68308ff66d7baee53369fa5ce985f84bcb6aa1948c1f2f7b02f2", + "sha256:7ab178da777fc0f55b6aef5a755f99726e8e4b75e3903954df07b27059b54fcf", + "sha256:8078305e77c2f6649d36b24d8778096413e474d9d7892c6f92cfb589c9d71b2e", + "sha256:85600b63a386d860eeaa955e9335e18dd0d7e5477e9214825abf2c2884488369", + "sha256:857d9b939ae128be1c0c792eb885c7ff6a386b9dea899ac4b06f4d90a31f9d87", + "sha256:87a41630c90c179fa5c593400f30a467c498972c702f348d41e19dafeb1d319e", + "sha256:8805d486c6128cc0fcc8ecf16c4095d99a8693a541ef851429ab334e028a4a97", + "sha256:8d71b7a89c306a41ccc7741fc9409b14f5b86727455c2a1c0c7cfcb0f784e1f2", + "sha256:9e1b80bd65f8f160880cb4dad7f55697f6d37b2d7f251fc0c2128e811928f369", + "sha256:9e290c84a145ae2411ee0ec9913c41cd7500e2e7485fe93632434d84ef4fda67", + "sha256:9ec9f88b5bc94bd99372f27cdd53af1c92ba06717380b127733b953cfb181174", + "sha256:a0a02a8b4ba6deadf706d5f849539b3685b72b186a3c9ef5d43e8972ed60fb6f", + "sha256:a4059c59519f5940e01a071f74ae2a60ea8f6185b03d22a09d40c7959a36b16b", + "sha256:a6e028c2a6da2ebfa2365a5b32531d311fbfec0e3600fc27e901b64f0ff7e54e", + "sha256:adcdebf9f8463df4120c427cf6c9aed39258bccd03ed37b6939e7a145d64d6e0", + "sha256:bdec982610259d07156a58f80b8c3e69be7751a9208bc577b059c5193d087fad", + "sha256:cefc4d4251ffb73feb303d4b7e9d6c367cb60f2db16d259ea28b114045f965aa", + "sha256:d4145c8aa6afbac10ad27e408f7ce15992fe89ba5d0b4abca31c0c2729864c03", + "sha256:da76dc5ad719ee99de5ea28a5629ff92172cbb4a70d8a6ae3a5b7a53c7382ce1", + "sha256:dde2452c08ef8b6426ccab6b5b6de9f06d836d9937d6870e68153cbf8cb49348", + "sha256:e3d88091d2539a4868750914a6fe7b9ec50e42b913851fc1b77423b5bd918530", + "sha256:f9c67cfe6278499d7f83559dc6322a8bbb108e307817a3d7acbfea807b3603cc" ], - "version": "==1.5" + "version": "==1.22.0" }, - "grpcio": { + "grpcio-tools": { "hashes": [ - "sha256:07c7f7b251b26ef94e29d2c19245e34d4d05897325a289b31de3b6a5e16fbd6c", - "sha256:2ddbca16c2e7b3f2ffc6e34c7cfa6886fb01de9f156ad3f77b72ad652d632097", - "sha256:30d84f9684b4c81ee37906bb303a84435948c2dd3db55d3ef38f8daf28bc6ea3", - "sha256:316e6c79fb1585b23ae100ee26f6ffefa91a21e4d39588fa42efadd7f20c7225", - "sha256:400abff9a772351fff72d5698c8758b837bec3d7f4ed93de70bae744d8f63f53", - "sha256:4ed90a256f6f8690b5c95b9d4f2e9fe6513628f3674e9068e10637e50c2f93d6", - "sha256:51fd87ff610ca2f483c668c3fa7f70d479bffb3c14805d2065b51194edea5e26", - "sha256:5569aba69041530e04eff3d40536027db8851f4e11e6282849b9fc5b1855075d", - "sha256:566b752e36cdcd5a4d38f292aca4c8e3095f13cfe82606e010d67749cacba341", - "sha256:5817f970fbfed72a6203ff96349e796d8f6ff3ce85b58af241c4a14190d9f4d1", - "sha256:5a97bb5a4af16f840f1211dbe66d61592f02110f286d96e67bf6006d7f96aab7", - "sha256:5d57e41c913152b215eda070955b3544bdf20ed2327e5e5eed3005186220ebd0", - "sha256:6cec17145978cef3d20093cdc05e88da597ce05076db566a66a35b9c55d416a3", - "sha256:6ef7ab9b6ba09ce087ddb3b27f12504f50efdbf5d319b8b23173478765452301", - "sha256:756c0d65e4ebce1c47787dbb48955864f2a768e1df76902f33d3e4062c209f3e", - "sha256:828d13f0edd27f452af7fc23093c8a2d63d8fbd92595dbd0f698c78b13af9bdb", - "sha256:8cf02c4e07520be61ad8b59b0043771ef2af666cb73066516eabfee562a28df4", - "sha256:919dfe84d22ce2e2ae81d82238586d7c2a86714fb0b6cf9b437e336851e3c32d", - "sha256:b04a061280b06cdc4e68c4147a0f46b98c395cf62f0c6df4fa2a30a083cdc333", - "sha256:b2dbe7d2f9685bdbb4415f8e475dd96b1b1776193b7286705f90490c3f039037", - "sha256:b60df7cbc3e77c39d5befe6a1e6e4213f3ca683d743ff7c1622b1d4412245a55", - "sha256:b740681332b5a042b9e22246a3cdbfc3d644cf73d38e117f20ad9d8deab8f1a5", - "sha256:ba434873945d5d4542589674cb60c43a1cf76b2b5f0c0f759aa76d499055722f", - "sha256:bcb44cd53beccc92c730254ad3d50715b67a7432e693961b566d982f759b1787", - "sha256:be1cbb6cad1d4242e3aaa4143eabcfbf383358f6c8e9951be2c497b65561b075", - "sha256:c4e38326fcab5c52fd1a8c8e0f908bfe830629a5ffc60793ec5545ef913d62d2", - "sha256:d03c0524d5953568f74269e0faebb1e880ba9f36ca8c773be397087c35bd8188", - "sha256:ea897ffa80276565acdd92349ef82a768db0e3327aacd4aec82f79ca10989689", - "sha256:edc50e8bcd10b165f34c3cf3e1d4f97e9c71b165b85a85b91cf3444000a17692", - "sha256:f96a2e97df522b50da9cb3795f08199b110ceab4146bf70ea7f6a3a0213786cc", - "sha256:fadb649a69e3b08e01f090c24f0c8cccc122e92c362c1a1727b695a63be8416b", - "sha256:fbe4360ff1689a9753cbf1b27dad11e683d39117a32a64372a7c95c6abc81b81" - ], - "version": "==1.19.0" + "sha256:0d8e85d7e62ea4e04ff75eace98dd0b53b22bd57dc1efbed0f8398db884e1cf6", + "sha256:160e6fd9c44a3f6c76a8c2f84014e367d41a3cae27c451406b616f9a08ba2b1f", + "sha256:337554658b4a4c0a6e1ee75acd6681ec45007e1d6d1975e885f92b665881e33a", + "sha256:36390281f31861b8b685f7e8366ff8abbcdcedf3dda7b73133be56db71d3283b", + "sha256:3dd362bcd1db5247760b7f8b8157abd53e47210a17df9de994f064819ba64c04", + "sha256:4381f3722f3c5d02626796f9db6dd0dcb75c13245ea5655b54880ab7bd239a73", + "sha256:4b5a5fe3e949bd03e068c05070f3cdc6a01b68323efb667199d3c67a30ef515c", + "sha256:4f43d03e3e1f5f7bb14b8bba35a607e35ea4589fed778b8321c97810bc0a76ac", + "sha256:67d1a8d71b2572250124ebdebbfac7248563bb97ab139916fb265705d1b0dbe2", + "sha256:6e6fab6e8e92aadb70b4167e5eadd843e8c850d97213fdf4a39f6e4d3596e6f0", + "sha256:75fe16b642564e47c65cf6d23362079cdbbbc5c544b59c7bc1a3a7c8865d73e3", + "sha256:78bc91e38fe6a6c80de084014e22365c788811773829f28621878a803dd6af48", + "sha256:8dde6f660e8390380e987b0661b2ced31bafa2d3dde9845bd918a007d998e7a8", + "sha256:928de5a03fa2664d20433d3023e512fa1f8bc0588ff3eceee33c2d93b82e0110", + "sha256:9a4348b0309c444e5b7bfd3a2cf38bdb354c56e5f4b966eb88b249aff46b0a4c", + "sha256:9af68a58dc1a339e5735425a66b0a7146114b6fbc860d1f8b74b277d151f7bf1", + "sha256:a3447b842ab2964a834776be0a38b93d1977887d43cb69a2ce9941388923d8a9", + "sha256:a83b82b39e32a3110e45a11f0df9aceacefd201c25da79a66edda60d37a9f2e6", + "sha256:b05de8f16752b50851cd1caa3e63a49b35f8adb3eee0cec8991b231fac0c158d", + "sha256:b5c0fe51a155625c9d1132ab8deb56b3015e111a6961e48aeb9dd89bd7c670ab", + "sha256:b659d2306dd79818b2fae0543377e199bcf656404032e24f2af53a0e5338b5c9", + "sha256:b688dd1d83fdb46ab84d14a0711a0033984add9717619513f21e00f1b005f986", + "sha256:bbe9c13774ecaf99beb39d05c3ee659771c903add0c5e7a761c79387f653f69f", + "sha256:c23f59a04ed9db331922e5f02425958a907a019e157f14a6b95dd0ca1bcf05a6", + "sha256:cf0c35fe4a8b0dc78d9bf181317d9fe9cd21a397429d9c0c01c0178cf20e4442", + "sha256:cfd2320a0b4233ec4b9d3ac8d19df69194548bd32473fdba366cb50930f59dc2", + "sha256:d5c82c63ec24f0de5151e478cabfca23afd39005b6d0ba62dccf81cf19b0ae7f", + "sha256:d8d3dcb3832c209c66c67bd0f62289358b2cb942a68c00ac94c2ebf6870f731e", + "sha256:d98ed0a731d6c4cee39e76ba0bc2225455da097f41fa11ebfa27fe3854b6cc98", + "sha256:dbb2dd5367bfd71a6a779f6b237de015d6e508df129a126fc2a39da8a675457b", + "sha256:f3c135ad51ec95667bb945be107d0176f3048e615283104bf30027fe8bc06a8e", + "sha256:f8d75ead0ef7d060699b6c87b11f3c54e0c4b8e24065cbd262b64d300558a420" + ], + "version": "==1.22.0" }, - "grpcio-tools": { + "grpclib": { + "hashes": [ + "sha256:700e0d56ff7cb7a492da3c2f743ed0b996492e5fe89ed928e484fd8cc4ba83f0" + ], + "version": "==0.2.5" + }, + "h2": { + "hashes": [ + "sha256:c8f387e0e4878904d4978cd688a3195f6b169d49b1ffa572a3d347d7adc5e09f", + "sha256:fd07e865a3272ac6ef195d8904de92dc7b38dc28297ec39cfa22716b6d62e6eb" + ], + "version": "==3.1.0" + }, + "hpack": { "hashes": [ - "sha256:040c0d676fbc7ec5d9062c530ec951e3e3f10f65a94a4a6e2b2b57acf90fe379", - "sha256:057213e04ced118f8a5701aa471431bd190f82609120cebc1b1126e6906c956a", - "sha256:208d941fb4f4dd436be2e3ff7bcf1b452c723dfde242df75189bfdfca34c47b0", - "sha256:217f799c345cbd5161685579cccae296281ffbea73b5b972952b9d5f23c51e7a", - "sha256:245218a504ffdc068fd9d304e7552ab3057d5290c98bd4e22a6b668a7e89d800", - "sha256:26f98078eedd7296e0e813d7485b7f4a48893891cdfffc174af0fbabb29cb600", - "sha256:29b224c3abfc3a52bd2897a8e8c0def1fb9c0c9683de806e8de15c491fedc268", - "sha256:2f3a16dd9a18de82a909c724a206459bc05c0f490847b82c2fff9b94d6b7d189", - "sha256:347fba595e4c131f86710fd7c86fbd773cada961f38f815a8a28aaffe0e7ba92", - "sha256:35302b2efcbc7c080c3bbf8819c95f4f7b0afaf34add3a682a4eb42a6e978a38", - "sha256:4539a4852f51cb771a245b58e04c5e4d98416a9b221a462a551503ec847ce43b", - "sha256:49e81498905b6eb0d0cad46b6981d1a7db7914f0aa685a50dc1ef01460285d89", - "sha256:59bbcad83934a7b5c9eac854b027a2eb98b8ab6c67b33abc165d085d1c776b05", - "sha256:676ca52939a5eb536b46785019bc2d7450ffb2cf98d1cc7285ac6514472e1348", - "sha256:7624232ee8e9673138880f6c3cf63bbc96160824b0ef37f794614baa41900fe0", - "sha256:7c807846b1f5829f7e9dfa8b59c114ac7d003fc7fc32340ec9eea11c6a85105a", - "sha256:7f1da60259ddf090e5f91102c70c91637ce4ec08177087b32bd4eac4a9b8d706", - "sha256:84860466dbd1462f1eca6f2ef8f0199c2b078c58ac5e457b1aef64bc1ef1e330", - "sha256:982635e947aafbbc89c9771ae5265b538b63dccb71f9d704162cb9b2d96f3237", - "sha256:98a54853f0d549cad8e67d115dab7689666836a3299a1da7f5efa160d068f6ef", - "sha256:9ff3f693adb4901d40312ec88d2081cb4bd6014d7fb06b178efd47511977fb55", - "sha256:a3808cdd8aa13ea92b2e1b9d7ae1f0fc79fc051c86d5a42e5c748c8baa354aa1", - "sha256:a861c6fc3597ea74c5355b97a5b0b3ec09858eb908f7bb85e73f76aadb614e6a", - "sha256:becfdef8f58363792239c1aa2a448b87d038e11bf07089c6afb6305e6a8603a6", - "sha256:c533776e706c742da0aadcf98b482edafae3e9a14bb3f65d263c332c606c0604", - "sha256:cb931e4efa6056bd2be9d4f6b69d6ba6786063fa6c9425647f3d25b12b927fe9", - "sha256:d0edca5baa2397e8516443c6c619a50e84dd3cae65c43c4b0d975e07c0a84d3f", - "sha256:da66ebde4152c50242ebf1423e623099e158b893748824eaf626fa4d4f2da60a", - "sha256:df124b64e6ab6dc52429a1b0afdf2d7e46e3a2e6b860966a872802d3b418151e", - "sha256:e9db0092d0a5974766f432b511aca576a35c4fb40edff16adf26d8129ab08016", - "sha256:f929c32403bd686c0e60bd9daa09e5b5dde9289e197a916dc79fde8ea8881976", - "sha256:fb8b7d63cbb931cbc46064405519b688ef42a235fb94db95f2d94d761e39dd19" - ], - "version": "==1.19.0" + "sha256:0edd79eda27a53ba5be2dfabf3b15780928a0dff6eb0c60a3d6767720e970c89", + "sha256:8eec9c1f4bfae3408a3f30500261f7e6a65912dc138526ea054f9ad98892e9d2" + ], + "version": "==3.0.0" + }, + "hyperframe": { + "hashes": [ + "sha256:5187962cb16dcc078f23cb5a4b110098d546c3f41ff2d4038a9896893bbd0b40", + "sha256:a9f5c17f2cc3c719b917c4f33ed1c61bd1f8dfac4b1bd23b7c80b3400971b41f" + ], + "version": "==5.2.0" + }, + "multidict": { + "hashes": [ + "sha256:024b8129695a952ebd93373e45b5d341dbb87c17ce49637b34000093f243dd4f", + "sha256:041e9442b11409be5e4fc8b6a97e4bcead758ab1e11768d1e69160bdde18acc3", + "sha256:045b4dd0e5f6121e6f314d81759abd2c257db4634260abcfe0d3f7083c4908ef", + "sha256:047c0a04e382ef8bd74b0de01407e8d8632d7d1b4db6f2561106af812a68741b", + "sha256:068167c2d7bbeebd359665ac4fff756be5ffac9cda02375b5c5a7c4777038e73", + "sha256:148ff60e0fffa2f5fad2eb25aae7bef23d8f3b8bdaf947a65cdbe84a978092bc", + "sha256:1d1c77013a259971a72ddaa83b9f42c80a93ff12df6a4723be99d858fa30bee3", + "sha256:1d48bc124a6b7a55006d97917f695effa9725d05abe8ee78fd60d6588b8344cd", + "sha256:31dfa2fc323097f8ad7acd41aa38d7c614dd1960ac6681745b6da124093dc351", + "sha256:34f82db7f80c49f38b032c5abb605c458bac997a6c3142e0d6c130be6fb2b941", + "sha256:3d5dd8e5998fb4ace04789d1d008e2bb532de501218519d70bb672c4c5a2fc5d", + "sha256:4a6ae52bd3ee41ee0f3acf4c60ceb3f44e0e3bc52ab7da1c2b2aa6703363a3d1", + "sha256:4b02a3b2a2f01d0490dd39321c74273fed0568568ea0e7ea23e02bd1fb10a10b", + "sha256:4b843f8e1dd6a3195679d9838eb4670222e8b8d01bc36c9894d6c3538316fa0a", + "sha256:5de53a28f40ef3c4fd57aeab6b590c2c663de87a5af76136ced519923d3efbb3", + "sha256:61b2b33ede821b94fa99ce0b09c9ece049c7067a33b279f343adfe35108a4ea7", + "sha256:6a3a9b0f45fd75dc05d8e93dc21b18fc1670135ec9544d1ad4acbcf6b86781d0", + "sha256:76ad8e4c69dadbb31bad17c16baee61c0d1a4a73bed2590b741b2e1a46d3edd0", + "sha256:7ba19b777dc00194d1b473180d4ca89a054dd18de27d0ee2e42a103ec9b7d014", + "sha256:7c1b7eab7a49aa96f3db1f716f0113a8a2e93c7375dd3d5d21c4941f1405c9c5", + "sha256:7fc0eee3046041387cbace9314926aa48b681202f8897f8bff3809967a049036", + "sha256:8ccd1c5fff1aa1427100ce188557fc31f1e0a383ad8ec42c559aabd4ff08802d", + "sha256:8e08dd76de80539d613654915a2f5196dbccc67448df291e69a88712ea21e24a", + "sha256:c18498c50c59263841862ea0501da9f2b3659c00db54abfbf823a80787fde8ce", + "sha256:c49db89d602c24928e68c0d510f4fcf8989d77defd01c973d6cbe27e684833b1", + "sha256:ce20044d0317649ddbb4e54dab3c1bcc7483c78c27d3f58ab3d0c7e6bc60d26a", + "sha256:d1071414dd06ca2eafa90c85a079169bfeb0e5f57fd0b45d44c092546fcd6fd9", + "sha256:d3be11ac43ab1a3e979dac80843b42226d5d3cccd3986f2e03152720a4297cd7", + "sha256:db603a1c235d110c860d5f39988ebc8218ee028f07a7cbc056ba6424372ca31b" + ], + "version": "==4.5.2" }, "numpy": { "hashes": [ - "sha256:1980f8d84548d74921685f68096911585fee393975f53797614b34d4f409b6da", - "sha256:22752cd809272671b273bb86df0f505f505a12368a3a5fc0aa811c7ece4dfd5c", - "sha256:23cc40313036cffd5d1873ef3ce2e949bdee0646c5d6f375bf7ee4f368db2511", - "sha256:2b0b118ff547fecabc247a2668f48f48b3b1f7d63676ebc5be7352a5fd9e85a5", - "sha256:3a0bd1edf64f6a911427b608a894111f9fcdb25284f724016f34a84c9a3a6ea9", - "sha256:3f25f6c7b0d000017e5ac55977a3999b0b1a74491eacb3c1aa716f0e01f6dcd1", - "sha256:4061c79ac2230594a7419151028e808239450e676c39e58302ad296232e3c2e8", - "sha256:560ceaa24f971ab37dede7ba030fc5d8fa173305d94365f814d9523ffd5d5916", - "sha256:62be044cd58da2a947b7e7b2252a10b42920df9520fc3d39f5c4c70d5460b8ba", - "sha256:6c692e3879dde0b67a9dc78f9bfb6f61c666b4562fd8619632d7043fb5b691b0", - "sha256:6f65e37b5a331df950ef6ff03bd4136b3c0bbcf44d4b8e99135d68a537711b5a", - "sha256:7a78cc4ddb253a55971115f8320a7ce28fd23a065fc33166d601f51760eecfa9", - "sha256:80a41edf64a3626e729a62df7dd278474fc1726836552b67a8c6396fd7e86760", - "sha256:893f4d75255f25a7b8516feb5766c6b63c54780323b9bd4bc51cdd7efc943c73", - "sha256:972ea92f9c1b54cc1c1a3d8508e326c0114aaf0f34996772a30f3f52b73b942f", - "sha256:9f1d4865436f794accdabadc57a8395bd3faa755449b4f65b88b7df65ae05f89", - "sha256:9f4cd7832b35e736b739be03b55875706c8c3e5fe334a06210f1a61e5c2c8ca5", - "sha256:adab43bf657488300d3aeeb8030d7f024fcc86e3a9b8848741ea2ea903e56610", - "sha256:bd2834d496ba9b1bdda3a6cf3de4dc0d4a0e7be306335940402ec95132ad063d", - "sha256:d20c0360940f30003a23c0adae2fe50a0a04f3e48dc05c298493b51fd6280197", - "sha256:d3b3ed87061d2314ff3659bb73896e622252da52558f2380f12c421fbdee3d89", - "sha256:dc235bf29a406dfda5790d01b998a1c01d7d37f449128c0b1b7d1c89a84fae8b", - "sha256:fb3c83554f39f48f3fa3123b9c24aecf681b1c289f9334f8215c1d3c8e2f6e5b" - ], - "version": "==1.16.2" + "sha256:0778076e764e146d3078b17c24c4d89e0ecd4ac5401beff8e1c87879043a0633", + "sha256:141c7102f20abe6cf0d54c4ced8d565b86df4d3077ba2343b61a6db996cefec7", + "sha256:14270a1ee8917d11e7753fb54fc7ffd1934f4d529235beec0b275e2ccf00333b", + "sha256:27e11c7a8ec9d5838bc59f809bfa86efc8a4fd02e58960fa9c49d998e14332d5", + "sha256:2a04dda79606f3d2f760384c38ccd3d5b9bb79d4c8126b67aff5eb09a253763e", + "sha256:3c26010c1b51e1224a3ca6b8df807de6e95128b0908c7e34f190e7775455b0ca", + "sha256:52c40f1a4262c896420c6ea1c6fda62cf67070e3947e3307f5562bd783a90336", + "sha256:6e4f8d9e8aa79321657079b9ac03f3cf3fd067bf31c1cca4f56d49543f4356a5", + "sha256:7242be12a58fec245ee9734e625964b97cf7e3f2f7d016603f9e56660ce479c7", + "sha256:7dc253b542bfd4b4eb88d9dbae4ca079e7bf2e2afd819ee18891a43db66c60c7", + "sha256:94f5bd885f67bbb25c82d80184abbf7ce4f6c3c3a41fbaa4182f034bba803e69", + "sha256:a89e188daa119ffa0d03ce5123dee3f8ffd5115c896c2a9d4f0dbb3d8b95bfa3", + "sha256:ad3399da9b0ca36e2f24de72f67ab2854a62e623274607e37e0ce5f5d5fa9166", + "sha256:b0348be89275fd1d4c44ffa39530c41a21062f52299b1e3ee7d1c61f060044b8", + "sha256:b5554368e4ede1856121b0dfa35ce71768102e4aa55e526cb8de7f374ff78722", + "sha256:cbddc56b2502d3f87fda4f98d948eb5b11f36ff3902e17cb6cc44727f2200525", + "sha256:d79f18f41751725c56eceab2a886f021d70fd70a6188fd386e29a045945ffc10", + "sha256:dc2ca26a19ab32dc475dbad9dfe723d3a64c835f4c23f625c2b6566ca32b9f29", + "sha256:dd9bcd4f294eb0633bb33d1a74febdd2b9018b8b8ed325f861fffcd2c7660bb8", + "sha256:e8baab1bc7c9152715844f1faca6744f2416929de10d7639ed49555a85549f52", + "sha256:ec31fe12668af687b99acf1567399632a7c47b0e17cfb9ae47c098644ef36797", + "sha256:f12b4f7e2d8f9da3141564e6737d79016fe5336cc92de6814eba579744f65b0a", + "sha256:f58ac38d5ca045a377b3b377c84df8175ab992c970a53332fa8ac2373df44ff7" + ], + "version": "==1.16.4" }, "protobuf": { "hashes": [ - "sha256:03666634d038e35d90155756914bc3a6316e8bcc0d300f3ee539e586889436b9", - "sha256:049d5900e442d4cc0fd2afd146786b429151e2b29adebed28e6376026ab0ee0b", - "sha256:0eb9e62a48cc818b1719b5035042310c7e4f57b01f5283b32998c68c2f1c6a7c", - "sha256:255d10c2c9059964f6ebb5c900a830fc8a089731dda94a5cc873f673193d208b", - "sha256:358cc59e4e02a15d3725f204f2eb5777fc10595e2d9a9c4c8d82292f49af6d41", - "sha256:41f1b737d5f97f1e2af23d16fac6c0b8572f9c7ea73054f1258ca57f4f97cb80", - "sha256:6a5129576a2cf925cd100e06ead5f9ae4c86db70a854fb91cedb8d680112734a", - "sha256:80722b0d56dcb7ca8f75f99d8dadd7c7efd0d2265714d68f871ed437c32d82b3", - "sha256:88a960e949ec356f7016d84f8262dcff2b842fca5355b4c1be759f5c103b19b3", - "sha256:97872686223f47d95e914881cb0ca46e1bc622562600043da9edddcb54f2fe1e", - "sha256:a1df9d22433ab44b7c7e0bd33817134832ae8a8f3d93d9b9719fc032c5b20e96", - "sha256:ad385fbb9754023d17be14dd5aa67efff07f43c5df7f93118aef3c20e635ea19", - "sha256:b2d5ee7ba5c03b735c02e6ae75fd4ff8c831133e7ca078f2963408dc7beac428", - "sha256:c8c07cd8635d45b28ec53ee695e5ac8b0f9d9a4ae488a8d8ee168fe8fc75ba43", - "sha256:d44ebc9838b183e8237e7507885d52e8d08c48fdc953fd4a7ee3e56cb9d20977", - "sha256:dff97b0ee9256f0afdfc9eaa430736cdcdc18899d9a666658f161afd137cf93d", - "sha256:e47d248d614c68e4b029442de212bdd4f6ae02ae36821de319ae90314ea2578c", - "sha256:e650b521b429fed3d525428b1401a40051097a5a92c30076c91f36b31717e087" - ], - "version": "==3.7.0" + "sha256:05c36022fef3c7d3562ac22402965c0c2b9fe8421f459bb377323598996e407f", + "sha256:139b7eadcca0a861d60b523cb37d9475505e0dfb07972436b15407c2b968d87e", + "sha256:15f683006cb77fb849b1f561e509b03dd2b7dcc749086b8dd1831090d0ba4740", + "sha256:2ad566b7b7cdd8717c7af1825e19f09e8fef2787b77fcb979588944657679604", + "sha256:35cfcf97642ef62108e10a9431c77733ec7eaab8e32fe4653de20403429907cb", + "sha256:387822859ecdd012fdc25ec879f7f487da6e1d5b1ae6115e227e6be208836f71", + "sha256:4df14cbe1e7134afcfdbb9f058949e31c466de27d9b2f7fb4da9e0b67231b538", + "sha256:586c4ca37a7146d4822c700059f150ac3445ce0aef6f3ea258640838bb892dc2", + "sha256:58b11e530e954d29ab3180c48dc558a409f705bf16739fd4e0d3e07924ad7add", + "sha256:63c8c98ccb8c95f41c18fb829aeeab21c6249adee4ed75354125bdc44488f30e", + "sha256:72edcbacd0c73eef507d2ff1af99a6c27df18e66a3ff4351e401182e4de62b03", + "sha256:83dc8a561b3b954fd7002c690bb83278b8d1742a1e28abba9aaef28b0c8b437d", + "sha256:913171ecc84c2726b86574e40549a0ea619d569657c5a5ff782a3be7d81401a5", + "sha256:aabb7c741d3416671c3e6fe7c52970a226e6a8274417a97d7d795f953fadef36", + "sha256:b3452bbda12b1cbe2187d416779de07b2ab4c497d83a050e43c344778763721d", + "sha256:c5d5b8d4a9212338297fa1fa44589f69b470c0ba1d38168b432d577176b386a8", + "sha256:d86ee389c2c4fc3cebabb8ce83a8e97b6b3b5dc727b7419c1ccdc7b6e545a233", + "sha256:f2db8c754de788ab8be5e108e1e967c774c0942342b4f8aaaf14063889a6cfdc" + ], + "version": "==3.9.0" }, "serving-utils": { "editable": true, @@ -175,27 +229,34 @@ ], "version": "==19.1.0" }, + "entrypoints": { + "hashes": [ + "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", + "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" + ], + "version": "==0.3" + }, "flake8": { "hashes": [ - "sha256:6a35f5b8761f45c5513e3405f110a86bea57982c3b75b766ce7b65217abe1670", - "sha256:c01f8a3963b3571a8e6bd7a4063359aff90749e160778e03817cd9b71c9e07d2" + "sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548", + "sha256:8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696" ], - "version": "==3.6.0" + "version": "==3.7.8" }, "flake8-bugbear": { "hashes": [ - "sha256:7490f848130771d83caa63b54080cbb8c04ccd22d647b9daaf87e7bafc3ce9c9", - "sha256:f459d93951b187aee9e584c7fa24684a9b8485f46c53cfbce2b7be7313a6d733" + "sha256:5070774b668be92c4312e5ca82748ddf4ecaa7a24ff062662681bb745c7896eb", + "sha256:fef9c9826d14ec23187ae1edeb3c6513c4e46bf0e70d86bac38f7d9aabae113d" ], "markers": "python_version >= '3.5'", - "version": "==17.4.0" + "version": "==19.3.0" }, "flake8-builtins": { "hashes": [ - "sha256:112754f90b281829a4834c1f2052338142553efac455866028e136f9e333080f", - "sha256:a2a67165db017d2563225124b76d44ad7deb20488e205ceb504eb1c6f646555a" + "sha256:8d806360767947c0035feada4ddef3ede32f0a586ef457e62d811b8456ad9a51", + "sha256:cd7b1b7fec4905386a3643b59f9ca8e305768da14a49a7efb31fe9364f33cd04" ], - "version": "==1.0" + "version": "==1.4.1" }, "flake8-class-newline": { "hashes": [ @@ -207,30 +268,37 @@ }, "flake8-commas": { "hashes": [ - "sha256:8381cb25cd608323d01624d29b28e474342e7e53a2588610705c5316ef45a7a2", - "sha256:a3706b2386883e8ca2f9826713aedf955bcce70deddc385dae145881d42131c9" + "sha256:d3005899466f51380387df7151fb59afec666a0f4f4a2c6a8995b975de0f44b7", + "sha256:ee2141a3495ef9789a3894ed8802d03eff1eaaf98ce6d8653a7c573ef101935e" ], - "version": "==0.4.3" + "version": "==2.0.0" }, "flake8-config-yoctol": { "hashes": [ - "sha256:6d32d0ef4fd90192ddd620331486ea26dfc40286d29465979d74612a6516b918", - "sha256:f35f73c7bc87a13419ba6d7535388c58045b420ec6d6292d4ece7fd168414b6f" + "sha256:2ab3d9ea4dbfa22625661841ff199574b155476380da5336731e1fa018aad5c5", + "sha256:c8b849ce883cb84ee951c8954bae267bdebfd66393b442f6f1f33de757a7c48f" ], "index": "pypi", - "version": "==0.0.11" + "version": "==0.0.12" }, "flake8-debugger": { "hashes": [ - "sha256:e5c8ac980d819db2f3fbb89fe0e43a2fe6c127edd6ce4984a3f7e0bbdac3d2d4" + "sha256:be4fb88de3ee8f6dd5053a2d347e2c0a2b54bab6733a2280bb20ebd3c4ca1d97" ], - "version": "==3.0.0" + "version": "==3.1.0" }, "flake8-print": { "hashes": [ - "sha256:255b01f0932f65fb8ce70a65f0f2abb4a05faf25f9fe53275cd13cacdc0179f5" + "sha256:5010e6c138b63b62400da4b06afa33becc5e08bd1fcce9af3752445cf3342f54" ], - "version": "==3.0.1" + "version": "==3.1.0" + }, + "importlib-metadata": { + "hashes": [ + "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", + "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" + ], + "version": "==0.18" }, "mccabe": { "hashes": [ @@ -241,18 +309,24 @@ }, "more-itertools": { "hashes": [ - "sha256:0125e8f60e9e031347105eb1682cef932f5e97d7b9a1a28d9bf00c22a5daef40", - "sha256:590044e3942351a1bdb1de960b739ff4ce277960f2425ad4509446dbace8d9d1" + "sha256:3ad685ff8512bf6dc5a8b82ebf73543999b657eded8c11803d9ba6b648986f4d", + "sha256:8bb43d1f51ecef60d81854af61a3a880555a14643691cc4b64a6ee269c78f09a" ], - "markers": "python_version > '2.7'", - "version": "==6.0.0" + "version": "==7.1.0" + }, + "packaging": { + "hashes": [ + "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", + "sha256:9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3" + ], + "version": "==19.0" }, "pluggy": { "hashes": [ - "sha256:19ecf9ce9db2fce065a7a0586e07cfb4ac8614fe96edf628a264b1c70116cf8f", - "sha256:84d306a647cc805219916e62aab89caa97a33a1dd8c342e87a37f91073cd4746" + "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", + "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" ], - "version": "==0.9.0" + "version": "==0.12.0" }, "py": { "hashes": [ @@ -263,25 +337,32 @@ }, "pycodestyle": { "hashes": [ - "sha256:cbc619d09254895b0d12c2c691e237b2e91e9b2ecf5e84c26b35400f93dcfb83", - "sha256:cbfca99bd594a10f674d0cd97a3d802a1fdef635d4361e1a2658de47ed261e3a" + "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", + "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" ], - "version": "==2.4.0" + "version": "==2.5.0" }, "pyflakes": { "hashes": [ - "sha256:9a7662ec724d0120012f6e29d6248ae3727d821bba522a0e6b356eff19126a49", - "sha256:f661252913bc1dbe7fcfcbf0af0db3f42ab65aabd1a6ca68fe5d466bace94dae" + "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", + "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" ], - "version": "==2.0.0" + "version": "==2.1.1" + }, + "pyparsing": { + "hashes": [ + "sha256:1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", + "sha256:9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03" + ], + "version": "==2.4.0" }, "pytest": { "hashes": [ - "sha256:067a1d4bf827ffdd56ad21bd46674703fce77c5957f6c1eef731f6146bfcef1c", - "sha256:9687049d53695ad45cf5fdc7bbd51f0c49f1ea3ecfc4b7f3fde7501b541f17f4" + "sha256:6ef6d06de77ce2961156013e9dff62f1b2688aa04d0dc244299fe7d67e09370d", + "sha256:a736fed91c12681a7b34617c8fcefe39ea04599ca72c608751c31d89579a3f77" ], "index": "pypi", - "version": "==4.3.0" + "version": "==5.0.1" }, "pytest-asyncio": { "hashes": [ @@ -297,6 +378,20 @@ "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" ], "version": "==1.12.0" + }, + "wcwidth": { + "hashes": [ + "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", + "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + ], + "version": "==0.1.7" + }, + "zipp": { + "hashes": [ + "sha256:4970c3758f4e89a7857a973b1e2a5d75bcdc47794442f2e2dd4fe8e0466e809a", + "sha256:8a5712cfd3bb4248015eb3b0b3c54a5f6ee3f2425963ef2a0125b8bc40aafaec" + ], + "version": "==0.5.2" } } } diff --git a/README.md b/README.md index 0530b79..49625c8 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,9 @@ make test ``` make install-dev ``` + +### Protos + +``` +python -m grpc_tools.protoc -I. --python_out=. --python_grpc_out=. --grpc_python_out=. serving_utils/protos/*.proto +``` diff --git a/serving_utils/client.py b/serving_utils/client.py index 9513e40..76b17c3 100644 --- a/serving_utils/client.py +++ b/serving_utils/client.py @@ -5,11 +5,12 @@ from collections import namedtuple from concurrent.futures import ThreadPoolExecutor -from aiogrpc import Channel import grpc +from grpclib.client import Channel import tensorflow as tf from .protos import predict_pb2, prediction_service_pb2_grpc, list_models_pb2, list_models_pb2_grpc +from .protos import prediction_service_grpc def copy_message(src, dst): @@ -66,15 +67,18 @@ def __init__( credentials=creds, options=channel_options, ) - self._async_channel = Channel( - self._channel, - loop=loop, - executor=executor, - standalone_pool_for_streaming=standalone_pool_for_streaming, - ) + + if loop is None: + loop = asyncio.get_event_loop() + + split_addr = addr.split(':') + host = split_addr[0] + port = split_addr[1] + # TODO: better addr parsing, secure channel + self._async_channel = Channel(host, port, loop=loop) self._stub = prediction_service_pb2_grpc.PredictionServiceStub(self._channel) - self._async_stub = prediction_service_pb2_grpc.PredictionServiceStub(self._async_channel) + self._async_stub = prediction_service_grpc.PredictionServiceStub(self._async_channel) self._check_address_health() def _check_address_health(self): diff --git a/serving_utils/protos/list_models_grpc.py b/serving_utils/protos/list_models_grpc.py new file mode 100644 index 0000000..56066c1 --- /dev/null +++ b/serving_utils/protos/list_models_grpc.py @@ -0,0 +1,37 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/list_models.proto +# plugin: grpclib.plugin.main +import abc + +import grpclib.const +import grpclib.client + +import serving_utils.protos.list_models_pb2 + + +class ListModelsBase(abc.ABC): + + @abc.abstractmethod + async def ListModels(self, stream): + pass + + def __mapping__(self): + return { + '/ListModels/ListModels': grpclib.const.Handler( + self.ListModels, + grpclib.const.Cardinality.UNARY_UNARY, + serving_utils.protos.list_models_pb2.ListModelsRequest, + serving_utils.protos.list_models_pb2.ListModelsResponse, + ), + } + + +class ListModelsStub: + + def __init__(self, channel: grpclib.client.Channel) -> None: + self.ListModels = grpclib.client.UnaryUnaryMethod( + channel, + '/ListModels/ListModels', + serving_utils.protos.list_models_pb2.ListModelsRequest, + serving_utils.protos.list_models_pb2.ListModelsResponse, + ) diff --git a/serving_utils/protos/list_models_pb2.py b/serving_utils/protos/list_models_pb2.py new file mode 100644 index 0000000..002eb9d --- /dev/null +++ b/serving_utils/protos/list_models_pb2.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/list_models.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/list_models.proto', + package='', + syntax='proto3', + serialized_options=None, + serialized_pb=_b('\n&serving_utils/protos/list_models.proto\"\x13\n\x11ListModelsRequest\"$\n\x12ListModelsResponse\x12\x0e\n\x06models\x18\x01 \x03(\t2E\n\nListModels\x12\x37\n\nListModels\x12\x12.ListModelsRequest\x1a\x13.ListModelsResponse\"\x00\x62\x06proto3') +) + + + + +_LISTMODELSREQUEST = _descriptor.Descriptor( + name='ListModelsRequest', + full_name='ListModelsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=42, + serialized_end=61, +) + + +_LISTMODELSRESPONSE = _descriptor.Descriptor( + name='ListModelsResponse', + full_name='ListModelsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='models', full_name='ListModelsResponse.models', index=0, + number=1, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=63, + serialized_end=99, +) + +DESCRIPTOR.message_types_by_name['ListModelsRequest'] = _LISTMODELSREQUEST +DESCRIPTOR.message_types_by_name['ListModelsResponse'] = _LISTMODELSRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ListModelsRequest = _reflection.GeneratedProtocolMessageType('ListModelsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTMODELSREQUEST, + '__module__' : 'serving_utils.protos.list_models_pb2' + # @@protoc_insertion_point(class_scope:ListModelsRequest) + }) +_sym_db.RegisterMessage(ListModelsRequest) + +ListModelsResponse = _reflection.GeneratedProtocolMessageType('ListModelsResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTMODELSRESPONSE, + '__module__' : 'serving_utils.protos.list_models_pb2' + # @@protoc_insertion_point(class_scope:ListModelsResponse) + }) +_sym_db.RegisterMessage(ListModelsResponse) + + + +_LISTMODELS = _descriptor.ServiceDescriptor( + name='ListModels', + full_name='ListModels', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=101, + serialized_end=170, + methods=[ + _descriptor.MethodDescriptor( + name='ListModels', + full_name='ListModels.ListModels', + index=0, + containing_service=None, + input_type=_LISTMODELSREQUEST, + output_type=_LISTMODELSRESPONSE, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_LISTMODELS) + +DESCRIPTOR.services_by_name['ListModels'] = _LISTMODELS + +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/list_models_pb2_grpc.py b/serving_utils/protos/list_models_pb2_grpc.py new file mode 100644 index 0000000..08f88c6 --- /dev/null +++ b/serving_utils/protos/list_models_pb2_grpc.py @@ -0,0 +1,46 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from serving_utils.protos import list_models_pb2 as serving__utils_dot_protos_dot_list__models__pb2 + + +class ListModelsStub(object): + # missing associated documentation comment in .proto file + pass + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListModels = channel.unary_unary( + '/ListModels/ListModels', + request_serializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsRequest.SerializeToString, + response_deserializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsResponse.FromString, + ) + + +class ListModelsServicer(object): + # missing associated documentation comment in .proto file + pass + + def ListModels(self, request, context): + # missing associated documentation comment in .proto file + pass + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ListModelsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListModels': grpc.unary_unary_rpc_method_handler( + servicer.ListModels, + request_deserializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsRequest.FromString, + response_serializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'ListModels', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/serving_utils/protos/model_grpc.py b/serving_utils/protos/model_grpc.py new file mode 100644 index 0000000..64ed18a --- /dev/null +++ b/serving_utils/protos/model_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/model.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/model_pb2.py b/serving_utils/protos/model_pb2.py new file mode 100644 index 0000000..a1d3521 --- /dev/null +++ b/serving_utils/protos/model_pb2.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/model.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/model.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n serving_utils/protos/model.proto\x12\x12tensorflow.serving\x1a\x1egoogle/protobuf/wrappers.proto\"_\n\tModelSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12,\n\x07version\x18\x02 \x01(\x0b\x32\x1b.google.protobuf.Int64Value\x12\x16\n\x0esignature_name\x18\x03 \x01(\tB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) + + + + +_MODELSPEC = _descriptor.Descriptor( + name='ModelSpec', + full_name='tensorflow.serving.ModelSpec', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='tensorflow.serving.ModelSpec.name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='version', full_name='tensorflow.serving.ModelSpec.version', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='signature_name', full_name='tensorflow.serving.ModelSpec.signature_name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=88, + serialized_end=183, +) + +_MODELSPEC.fields_by_name['version'].message_type = google_dot_protobuf_dot_wrappers__pb2._INT64VALUE +DESCRIPTOR.message_types_by_name['ModelSpec'] = _MODELSPEC +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ModelSpec = _reflection.GeneratedProtocolMessageType('ModelSpec', (_message.Message,), { + 'DESCRIPTOR' : _MODELSPEC, + '__module__' : 'serving_utils.protos.model_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.ModelSpec) + }) +_sym_db.RegisterMessage(ModelSpec) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/model_pb2_grpc.py b/serving_utils/protos/model_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/model_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/serving_utils/protos/predict_grpc.py b/serving_utils/protos/predict_grpc.py new file mode 100644 index 0000000..5d1f84b --- /dev/null +++ b/serving_utils/protos/predict_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/predict.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/predict_pb2.py b/serving_utils/protos/predict_pb2.py new file mode 100644 index 0000000..6b74446 --- /dev/null +++ b/serving_utils/protos/predict_pb2.py @@ -0,0 +1,234 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/predict.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from serving_utils.protos import tensor_pb2 as serving__utils_dot_protos_dot_tensor__pb2 +from serving_utils.protos import model_pb2 as serving__utils_dot_protos_dot_model__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/predict.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n\"serving_utils/protos/predict.proto\x12\x12tensorflow.serving\x1a!serving_utils/protos/tensor.proto\x1a serving_utils/protos/model.proto\"\xea\x01\n\x0ePredictRequest\x12\x31\n\nmodel_spec\x18\x01 \x01(\x0b\x32\x1d.tensorflow.serving.ModelSpec\x12>\n\x06inputs\x18\x02 \x03(\x0b\x32..tensorflow.serving.PredictRequest.InputsEntry\x12\x15\n\routput_filter\x18\x03 \x03(\t\x1aN\n\x0bInputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.tensorflow.serving.TensorProto:\x02\x38\x01\"\xd8\x01\n\x0fPredictResponse\x12\x31\n\nmodel_spec\x18\x02 \x01(\x0b\x32\x1d.tensorflow.serving.ModelSpec\x12\x41\n\x07outputs\x18\x01 \x03(\x0b\x32\x30.tensorflow.serving.PredictResponse.OutputsEntry\x1aO\n\x0cOutputsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12.\n\x05value\x18\x02 \x01(\x0b\x32\x1f.tensorflow.serving.TensorProto:\x02\x38\x01\x42\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[serving__utils_dot_protos_dot_tensor__pb2.DESCRIPTOR,serving__utils_dot_protos_dot_model__pb2.DESCRIPTOR,]) + + + + +_PREDICTREQUEST_INPUTSENTRY = _descriptor.Descriptor( + name='InputsEntry', + full_name='tensorflow.serving.PredictRequest.InputsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='tensorflow.serving.PredictRequest.InputsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='tensorflow.serving.PredictRequest.InputsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=284, + serialized_end=362, +) + +_PREDICTREQUEST = _descriptor.Descriptor( + name='PredictRequest', + full_name='tensorflow.serving.PredictRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='model_spec', full_name='tensorflow.serving.PredictRequest.model_spec', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='inputs', full_name='tensorflow.serving.PredictRequest.inputs', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='output_filter', full_name='tensorflow.serving.PredictRequest.output_filter', index=2, + number=3, type=9, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PREDICTREQUEST_INPUTSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=128, + serialized_end=362, +) + + +_PREDICTRESPONSE_OUTPUTSENTRY = _descriptor.Descriptor( + name='OutputsEntry', + full_name='tensorflow.serving.PredictResponse.OutputsEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='tensorflow.serving.PredictResponse.OutputsEntry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='tensorflow.serving.PredictResponse.OutputsEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=_b('8\001'), + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=502, + serialized_end=581, +) + +_PREDICTRESPONSE = _descriptor.Descriptor( + name='PredictResponse', + full_name='tensorflow.serving.PredictResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='model_spec', full_name='tensorflow.serving.PredictResponse.model_spec', index=0, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='outputs', full_name='tensorflow.serving.PredictResponse.outputs', index=1, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_PREDICTRESPONSE_OUTPUTSENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=365, + serialized_end=581, +) + +_PREDICTREQUEST_INPUTSENTRY.fields_by_name['value'].message_type = serving__utils_dot_protos_dot_tensor__pb2._TENSORPROTO +_PREDICTREQUEST_INPUTSENTRY.containing_type = _PREDICTREQUEST +_PREDICTREQUEST.fields_by_name['model_spec'].message_type = serving__utils_dot_protos_dot_model__pb2._MODELSPEC +_PREDICTREQUEST.fields_by_name['inputs'].message_type = _PREDICTREQUEST_INPUTSENTRY +_PREDICTRESPONSE_OUTPUTSENTRY.fields_by_name['value'].message_type = serving__utils_dot_protos_dot_tensor__pb2._TENSORPROTO +_PREDICTRESPONSE_OUTPUTSENTRY.containing_type = _PREDICTRESPONSE +_PREDICTRESPONSE.fields_by_name['model_spec'].message_type = serving__utils_dot_protos_dot_model__pb2._MODELSPEC +_PREDICTRESPONSE.fields_by_name['outputs'].message_type = _PREDICTRESPONSE_OUTPUTSENTRY +DESCRIPTOR.message_types_by_name['PredictRequest'] = _PREDICTREQUEST +DESCRIPTOR.message_types_by_name['PredictResponse'] = _PREDICTRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +PredictRequest = _reflection.GeneratedProtocolMessageType('PredictRequest', (_message.Message,), { + + 'InputsEntry' : _reflection.GeneratedProtocolMessageType('InputsEntry', (_message.Message,), { + 'DESCRIPTOR' : _PREDICTREQUEST_INPUTSENTRY, + '__module__' : 'serving_utils.protos.predict_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.PredictRequest.InputsEntry) + }) + , + 'DESCRIPTOR' : _PREDICTREQUEST, + '__module__' : 'serving_utils.protos.predict_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.PredictRequest) + }) +_sym_db.RegisterMessage(PredictRequest) +_sym_db.RegisterMessage(PredictRequest.InputsEntry) + +PredictResponse = _reflection.GeneratedProtocolMessageType('PredictResponse', (_message.Message,), { + + 'OutputsEntry' : _reflection.GeneratedProtocolMessageType('OutputsEntry', (_message.Message,), { + 'DESCRIPTOR' : _PREDICTRESPONSE_OUTPUTSENTRY, + '__module__' : 'serving_utils.protos.predict_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.PredictResponse.OutputsEntry) + }) + , + 'DESCRIPTOR' : _PREDICTRESPONSE, + '__module__' : 'serving_utils.protos.predict_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.PredictResponse) + }) +_sym_db.RegisterMessage(PredictResponse) +_sym_db.RegisterMessage(PredictResponse.OutputsEntry) + + +DESCRIPTOR._options = None +_PREDICTREQUEST_INPUTSENTRY._options = None +_PREDICTRESPONSE_OUTPUTSENTRY._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/predict_pb2_grpc.py b/serving_utils/protos/predict_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/predict_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/serving_utils/protos/prediction_service_grpc.py b/serving_utils/protos/prediction_service_grpc.py new file mode 100644 index 0000000..796cb72 --- /dev/null +++ b/serving_utils/protos/prediction_service_grpc.py @@ -0,0 +1,38 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/prediction_service.proto +# plugin: grpclib.plugin.main +import abc + +import grpclib.const +import grpclib.client + +import serving_utils.protos.predict_pb2 +import serving_utils.protos.prediction_service_pb2 + + +class PredictionServiceBase(abc.ABC): + + @abc.abstractmethod + async def Predict(self, stream): + pass + + def __mapping__(self): + return { + '/tensorflow.serving.PredictionService/Predict': grpclib.const.Handler( + self.Predict, + grpclib.const.Cardinality.UNARY_UNARY, + serving_utils.protos.predict_pb2.PredictRequest, + serving_utils.protos.predict_pb2.PredictResponse, + ), + } + + +class PredictionServiceStub: + + def __init__(self, channel: grpclib.client.Channel) -> None: + self.Predict = grpclib.client.UnaryUnaryMethod( + channel, + '/tensorflow.serving.PredictionService/Predict', + serving_utils.protos.predict_pb2.PredictRequest, + serving_utils.protos.predict_pb2.PredictResponse, + ) diff --git a/serving_utils/protos/prediction_service_pb2.py b/serving_utils/protos/prediction_service_pb2.py new file mode 100644 index 0000000..c3840f0 --- /dev/null +++ b/serving_utils/protos/prediction_service_pb2.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/prediction_service.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from serving_utils.protos import predict_pb2 as serving__utils_dot_protos_dot_predict__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/prediction_service.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\370\001\001'), + serialized_pb=_b('\n-serving_utils/protos/prediction_service.proto\x12\x12tensorflow.serving\x1a\"serving_utils/protos/predict.proto2g\n\x11PredictionService\x12R\n\x07Predict\x12\".tensorflow.serving.PredictRequest\x1a#.tensorflow.serving.PredictResponseB\x03\xf8\x01\x01\x62\x06proto3') + , + dependencies=[serving__utils_dot_protos_dot_predict__pb2.DESCRIPTOR,]) + + + +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +DESCRIPTOR._options = None + +_PREDICTIONSERVICE = _descriptor.ServiceDescriptor( + name='PredictionService', + full_name='tensorflow.serving.PredictionService', + file=DESCRIPTOR, + index=0, + serialized_options=None, + serialized_start=105, + serialized_end=208, + methods=[ + _descriptor.MethodDescriptor( + name='Predict', + full_name='tensorflow.serving.PredictionService.Predict', + index=0, + containing_service=None, + input_type=serving__utils_dot_protos_dot_predict__pb2._PREDICTREQUEST, + output_type=serving__utils_dot_protos_dot_predict__pb2._PREDICTRESPONSE, + serialized_options=None, + ), +]) +_sym_db.RegisterServiceDescriptor(_PREDICTIONSERVICE) + +DESCRIPTOR.services_by_name['PredictionService'] = _PREDICTIONSERVICE + +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/prediction_service_pb2_grpc.py b/serving_utils/protos/prediction_service_pb2_grpc.py new file mode 100644 index 0000000..aea6c37 --- /dev/null +++ b/serving_utils/protos/prediction_service_pb2_grpc.py @@ -0,0 +1,50 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from serving_utils.protos import predict_pb2 as serving__utils_dot_protos_dot_predict__pb2 + + +class PredictionServiceStub(object): + """open source marker; do not remove + PredictionService provides access to machine-learned models loaded by + model_servers. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Predict = channel.unary_unary( + '/tensorflow.serving.PredictionService/Predict', + request_serializer=serving__utils_dot_protos_dot_predict__pb2.PredictRequest.SerializeToString, + response_deserializer=serving__utils_dot_protos_dot_predict__pb2.PredictResponse.FromString, + ) + + +class PredictionServiceServicer(object): + """open source marker; do not remove + PredictionService provides access to machine-learned models loaded by + model_servers. + """ + + def Predict(self, request, context): + """Predict -- provides access to loaded TensorFlow model. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_PredictionServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Predict': grpc.unary_unary_rpc_method_handler( + servicer.Predict, + request_deserializer=serving__utils_dot_protos_dot_predict__pb2.PredictRequest.FromString, + response_serializer=serving__utils_dot_protos_dot_predict__pb2.PredictResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'tensorflow.serving.PredictionService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/serving_utils/protos/resource_handle_grpc.py b/serving_utils/protos/resource_handle_grpc.py new file mode 100644 index 0000000..72f1a26 --- /dev/null +++ b/serving_utils/protos/resource_handle_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/resource_handle.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/resource_handle_pb2.py b/serving_utils/protos/resource_handle_pb2.py new file mode 100644 index 0000000..8d8063e --- /dev/null +++ b/serving_utils/protos/resource_handle_pb2.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/resource_handle.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/resource_handle.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\016ResourceHandleP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n*serving_utils/protos/resource_handle.proto\x12\x12tensorflow.serving\"r\n\x13ResourceHandleProto\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tBn\n\x18org.tensorflow.frameworkB\x0eResourceHandleP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_RESOURCEHANDLEPROTO = _descriptor.Descriptor( + name='ResourceHandleProto', + full_name='tensorflow.serving.ResourceHandleProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='device', full_name='tensorflow.serving.ResourceHandleProto.device', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='container', full_name='tensorflow.serving.ResourceHandleProto.container', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='tensorflow.serving.ResourceHandleProto.name', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='hash_code', full_name='tensorflow.serving.ResourceHandleProto.hash_code', index=3, + number=4, type=4, cpp_type=4, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='maybe_type_name', full_name='tensorflow.serving.ResourceHandleProto.maybe_type_name', index=4, + number=5, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=66, + serialized_end=180, +) + +DESCRIPTOR.message_types_by_name['ResourceHandleProto'] = _RESOURCEHANDLEPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +ResourceHandleProto = _reflection.GeneratedProtocolMessageType('ResourceHandleProto', (_message.Message,), { + 'DESCRIPTOR' : _RESOURCEHANDLEPROTO, + '__module__' : 'serving_utils.protos.resource_handle_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.ResourceHandleProto) + }) +_sym_db.RegisterMessage(ResourceHandleProto) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/resource_handle_pb2_grpc.py b/serving_utils/protos/resource_handle_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/resource_handle_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/serving_utils/protos/tensor_grpc.py b/serving_utils/protos/tensor_grpc.py new file mode 100644 index 0000000..dee25c5 --- /dev/null +++ b/serving_utils/protos/tensor_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/tensor.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/tensor_pb2.py b/serving_utils/protos/tensor_pb2.py new file mode 100644 index 0000000..31587cd --- /dev/null +++ b/serving_utils/protos/tensor_pb2.py @@ -0,0 +1,255 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/tensor.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from serving_utils.protos import resource_handle_pb2 as serving__utils_dot_protos_dot_resource__handle__pb2 +from serving_utils.protos import tensor_shape_pb2 as serving__utils_dot_protos_dot_tensor__shape__pb2 +from serving_utils.protos import types_pb2 as serving__utils_dot_protos_dot_types__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/tensor.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\014TensorProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n!serving_utils/protos/tensor.proto\x12\x12tensorflow.serving\x1a*serving_utils/protos/resource_handle.proto\x1a\'serving_utils/protos/tensor_shape.proto\x1a serving_utils/protos/types.proto\"\xac\x04\n\x0bTensorProto\x12+\n\x05\x64type\x18\x01 \x01(\x0e\x32\x1c.tensorflow.serving.DataType\x12:\n\x0ctensor_shape\x18\x02 \x01(\x0b\x32$.tensorflow.serving.TensorShapeProto\x12\x16\n\x0eversion_number\x18\x03 \x01(\x05\x12\x16\n\x0etensor_content\x18\x04 \x01(\x0c\x12\x14\n\x08half_val\x18\r \x03(\x05\x42\x02\x10\x01\x12\x15\n\tfloat_val\x18\x05 \x03(\x02\x42\x02\x10\x01\x12\x16\n\ndouble_val\x18\x06 \x03(\x01\x42\x02\x10\x01\x12\x13\n\x07int_val\x18\x07 \x03(\x05\x42\x02\x10\x01\x12\x12\n\nstring_val\x18\x08 \x03(\x0c\x12\x18\n\x0cscomplex_val\x18\t \x03(\x02\x42\x02\x10\x01\x12\x15\n\tint64_val\x18\n \x03(\x03\x42\x02\x10\x01\x12\x14\n\x08\x62ool_val\x18\x0b \x03(\x08\x42\x02\x10\x01\x12\x18\n\x0c\x64\x63omplex_val\x18\x0c \x03(\x01\x42\x02\x10\x01\x12\x44\n\x13resource_handle_val\x18\x0e \x03(\x0b\x32\'.tensorflow.serving.ResourceHandleProto\x12?\n\x0bvariant_val\x18\x0f \x03(\x0b\x32*.tensorflow.serving.VariantTensorDataProto\x12\x16\n\nuint32_val\x18\x10 \x03(\rB\x02\x10\x01\x12\x16\n\nuint64_val\x18\x11 \x03(\x04\x42\x02\x10\x01\"o\n\x16VariantTensorDataProto\x12\x11\n\ttype_name\x18\x01 \x01(\t\x12\x10\n\x08metadata\x18\x02 \x01(\x0c\x12\x30\n\x07tensors\x18\x03 \x03(\x0b\x32\x1f.tensorflow.serving.TensorProtoBl\n\x18org.tensorflow.frameworkB\x0cTensorProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') + , + dependencies=[serving__utils_dot_protos_dot_resource__handle__pb2.DESCRIPTOR,serving__utils_dot_protos_dot_tensor__shape__pb2.DESCRIPTOR,serving__utils_dot_protos_dot_types__pb2.DESCRIPTOR,]) + + + + +_TENSORPROTO = _descriptor.Descriptor( + name='TensorProto', + full_name='tensorflow.serving.TensorProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dtype', full_name='tensorflow.serving.TensorProto.dtype', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_shape', full_name='tensorflow.serving.TensorProto.tensor_shape', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='version_number', full_name='tensorflow.serving.TensorProto.version_number', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensor_content', full_name='tensorflow.serving.TensorProto.tensor_content', index=3, + number=4, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='half_val', full_name='tensorflow.serving.TensorProto.half_val', index=4, + number=13, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='float_val', full_name='tensorflow.serving.TensorProto.float_val', index=5, + number=5, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='double_val', full_name='tensorflow.serving.TensorProto.double_val', index=6, + number=6, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int_val', full_name='tensorflow.serving.TensorProto.int_val', index=7, + number=7, type=5, cpp_type=1, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='string_val', full_name='tensorflow.serving.TensorProto.string_val', index=8, + number=8, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='scomplex_val', full_name='tensorflow.serving.TensorProto.scomplex_val', index=9, + number=9, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='int64_val', full_name='tensorflow.serving.TensorProto.int64_val', index=10, + number=10, type=3, cpp_type=2, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='bool_val', full_name='tensorflow.serving.TensorProto.bool_val', index=11, + number=11, type=8, cpp_type=7, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='dcomplex_val', full_name='tensorflow.serving.TensorProto.dcomplex_val', index=12, + number=12, type=1, cpp_type=5, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='resource_handle_val', full_name='tensorflow.serving.TensorProto.resource_handle_val', index=13, + number=14, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='variant_val', full_name='tensorflow.serving.TensorProto.variant_val', index=14, + number=15, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='uint32_val', full_name='tensorflow.serving.TensorProto.uint32_val', index=15, + number=16, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='uint64_val', full_name='tensorflow.serving.TensorProto.uint64_val', index=16, + number=17, type=4, cpp_type=4, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=_b('\020\001'), file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=177, + serialized_end=733, +) + + +_VARIANTTENSORDATAPROTO = _descriptor.Descriptor( + name='VariantTensorDataProto', + full_name='tensorflow.serving.VariantTensorDataProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='type_name', full_name='tensorflow.serving.VariantTensorDataProto.type_name', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='metadata', full_name='tensorflow.serving.VariantTensorDataProto.metadata', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tensors', full_name='tensorflow.serving.VariantTensorDataProto.tensors', index=2, + number=3, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=735, + serialized_end=846, +) + +_TENSORPROTO.fields_by_name['dtype'].enum_type = serving__utils_dot_protos_dot_types__pb2._DATATYPE +_TENSORPROTO.fields_by_name['tensor_shape'].message_type = serving__utils_dot_protos_dot_tensor__shape__pb2._TENSORSHAPEPROTO +_TENSORPROTO.fields_by_name['resource_handle_val'].message_type = serving__utils_dot_protos_dot_resource__handle__pb2._RESOURCEHANDLEPROTO +_TENSORPROTO.fields_by_name['variant_val'].message_type = _VARIANTTENSORDATAPROTO +_VARIANTTENSORDATAPROTO.fields_by_name['tensors'].message_type = _TENSORPROTO +DESCRIPTOR.message_types_by_name['TensorProto'] = _TENSORPROTO +DESCRIPTOR.message_types_by_name['VariantTensorDataProto'] = _VARIANTTENSORDATAPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorProto = _reflection.GeneratedProtocolMessageType('TensorProto', (_message.Message,), { + 'DESCRIPTOR' : _TENSORPROTO, + '__module__' : 'serving_utils.protos.tensor_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.TensorProto) + }) +_sym_db.RegisterMessage(TensorProto) + +VariantTensorDataProto = _reflection.GeneratedProtocolMessageType('VariantTensorDataProto', (_message.Message,), { + 'DESCRIPTOR' : _VARIANTTENSORDATAPROTO, + '__module__' : 'serving_utils.protos.tensor_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.VariantTensorDataProto) + }) +_sym_db.RegisterMessage(VariantTensorDataProto) + + +DESCRIPTOR._options = None +_TENSORPROTO.fields_by_name['half_val']._options = None +_TENSORPROTO.fields_by_name['float_val']._options = None +_TENSORPROTO.fields_by_name['double_val']._options = None +_TENSORPROTO.fields_by_name['int_val']._options = None +_TENSORPROTO.fields_by_name['scomplex_val']._options = None +_TENSORPROTO.fields_by_name['int64_val']._options = None +_TENSORPROTO.fields_by_name['bool_val']._options = None +_TENSORPROTO.fields_by_name['dcomplex_val']._options = None +_TENSORPROTO.fields_by_name['uint32_val']._options = None +_TENSORPROTO.fields_by_name['uint64_val']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/tensor_pb2_grpc.py b/serving_utils/protos/tensor_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/tensor_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/serving_utils/protos/tensor_shape_grpc.py b/serving_utils/protos/tensor_shape_grpc.py new file mode 100644 index 0000000..e7e14f0 --- /dev/null +++ b/serving_utils/protos/tensor_shape_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/tensor_shape.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/tensor_shape_pb2.py b/serving_utils/protos/tensor_shape_pb2.py new file mode 100644 index 0000000..eb0d470 --- /dev/null +++ b/serving_utils/protos/tensor_shape_pb2.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/tensor_shape.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/tensor_shape.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\021TensorShapeProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n\'serving_utils/protos/tensor_shape.proto\x12\x12tensorflow.serving\"\x82\x01\n\x10TensorShapeProto\x12\x35\n\x03\x64im\x18\x02 \x03(\x0b\x32(.tensorflow.serving.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tBq\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + + + + +_TENSORSHAPEPROTO_DIM = _descriptor.Descriptor( + name='Dim', + full_name='tensorflow.serving.TensorShapeProto.Dim', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='size', full_name='tensorflow.serving.TensorShapeProto.Dim.size', index=0, + number=1, type=3, cpp_type=2, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='name', full_name='tensorflow.serving.TensorShapeProto.Dim.name', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=161, + serialized_end=194, +) + +_TENSORSHAPEPROTO = _descriptor.Descriptor( + name='TensorShapeProto', + full_name='tensorflow.serving.TensorShapeProto', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='dim', full_name='tensorflow.serving.TensorShapeProto.dim', index=0, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='unknown_rank', full_name='tensorflow.serving.TensorShapeProto.unknown_rank', index=1, + number=3, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_TENSORSHAPEPROTO_DIM, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=64, + serialized_end=194, +) + +_TENSORSHAPEPROTO_DIM.containing_type = _TENSORSHAPEPROTO +_TENSORSHAPEPROTO.fields_by_name['dim'].message_type = _TENSORSHAPEPROTO_DIM +DESCRIPTOR.message_types_by_name['TensorShapeProto'] = _TENSORSHAPEPROTO +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +TensorShapeProto = _reflection.GeneratedProtocolMessageType('TensorShapeProto', (_message.Message,), { + + 'Dim' : _reflection.GeneratedProtocolMessageType('Dim', (_message.Message,), { + 'DESCRIPTOR' : _TENSORSHAPEPROTO_DIM, + '__module__' : 'serving_utils.protos.tensor_shape_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.TensorShapeProto.Dim) + }) + , + 'DESCRIPTOR' : _TENSORSHAPEPROTO, + '__module__' : 'serving_utils.protos.tensor_shape_pb2' + # @@protoc_insertion_point(class_scope:tensorflow.serving.TensorShapeProto) + }) +_sym_db.RegisterMessage(TensorShapeProto) +_sym_db.RegisterMessage(TensorShapeProto.Dim) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/tensor_shape_pb2_grpc.py b/serving_utils/protos/tensor_shape_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/tensor_shape_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/serving_utils/protos/types_grpc.py b/serving_utils/protos/types_grpc.py new file mode 100644 index 0000000..cabf69e --- /dev/null +++ b/serving_utils/protos/types_grpc.py @@ -0,0 +1,3 @@ +# Generated by the Protocol Buffers compiler. DO NOT EDIT! +# source: serving_utils/protos/types.proto +# plugin: grpclib.plugin.main diff --git a/serving_utils/protos/types_pb2.py b/serving_utils/protos/types_pb2.py new file mode 100644 index 0000000..da97616 --- /dev/null +++ b/serving_utils/protos/types_pb2.py @@ -0,0 +1,284 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: serving_utils/protos/types.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='serving_utils/protos/types.proto', + package='tensorflow.serving', + syntax='proto3', + serialized_options=_b('\n\030org.tensorflow.frameworkB\013TypesProtosP\001Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\370\001\001'), + serialized_pb=_b('\n serving_utils/protos/types.proto\x12\x12tensorflow.serving*\xaa\x06\n\x08\x44\x61taType\x12\x0e\n\nDT_INVALID\x10\x00\x12\x0c\n\x08\x44T_FLOAT\x10\x01\x12\r\n\tDT_DOUBLE\x10\x02\x12\x0c\n\x08\x44T_INT32\x10\x03\x12\x0c\n\x08\x44T_UINT8\x10\x04\x12\x0c\n\x08\x44T_INT16\x10\x05\x12\x0b\n\x07\x44T_INT8\x10\x06\x12\r\n\tDT_STRING\x10\x07\x12\x10\n\x0c\x44T_COMPLEX64\x10\x08\x12\x0c\n\x08\x44T_INT64\x10\t\x12\x0b\n\x07\x44T_BOOL\x10\n\x12\x0c\n\x08\x44T_QINT8\x10\x0b\x12\r\n\tDT_QUINT8\x10\x0c\x12\r\n\tDT_QINT32\x10\r\x12\x0f\n\x0b\x44T_BFLOAT16\x10\x0e\x12\r\n\tDT_QINT16\x10\x0f\x12\x0e\n\nDT_QUINT16\x10\x10\x12\r\n\tDT_UINT16\x10\x11\x12\x11\n\rDT_COMPLEX128\x10\x12\x12\x0b\n\x07\x44T_HALF\x10\x13\x12\x0f\n\x0b\x44T_RESOURCE\x10\x14\x12\x0e\n\nDT_VARIANT\x10\x15\x12\r\n\tDT_UINT32\x10\x16\x12\r\n\tDT_UINT64\x10\x17\x12\x10\n\x0c\x44T_FLOAT_REF\x10\x65\x12\x11\n\rDT_DOUBLE_REF\x10\x66\x12\x10\n\x0c\x44T_INT32_REF\x10g\x12\x10\n\x0c\x44T_UINT8_REF\x10h\x12\x10\n\x0c\x44T_INT16_REF\x10i\x12\x0f\n\x0b\x44T_INT8_REF\x10j\x12\x11\n\rDT_STRING_REF\x10k\x12\x14\n\x10\x44T_COMPLEX64_REF\x10l\x12\x10\n\x0c\x44T_INT64_REF\x10m\x12\x0f\n\x0b\x44T_BOOL_REF\x10n\x12\x10\n\x0c\x44T_QINT8_REF\x10o\x12\x11\n\rDT_QUINT8_REF\x10p\x12\x11\n\rDT_QINT32_REF\x10q\x12\x13\n\x0f\x44T_BFLOAT16_REF\x10r\x12\x11\n\rDT_QINT16_REF\x10s\x12\x12\n\x0e\x44T_QUINT16_REF\x10t\x12\x11\n\rDT_UINT16_REF\x10u\x12\x15\n\x11\x44T_COMPLEX128_REF\x10v\x12\x0f\n\x0b\x44T_HALF_REF\x10w\x12\x13\n\x0f\x44T_RESOURCE_REF\x10x\x12\x12\n\x0e\x44T_VARIANT_REF\x10y\x12\x11\n\rDT_UINT32_REF\x10z\x12\x11\n\rDT_UINT64_REF\x10{Bk\n\x18org.tensorflow.frameworkB\x0bTypesProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3') +) + +_DATATYPE = _descriptor.EnumDescriptor( + name='DataType', + full_name='tensorflow.serving.DataType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='DT_INVALID', index=0, number=0, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT', index=1, number=1, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_DOUBLE', index=2, number=2, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT32', index=3, number=3, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT8', index=4, number=4, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT16', index=5, number=5, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT8', index=6, number=6, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRING', index=7, number=7, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX64', index=8, number=8, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT64', index=9, number=9, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOL', index=10, number=10, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT8', index=11, number=11, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT8', index=12, number=12, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT32', index=13, number=13, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BFLOAT16', index=14, number=14, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT16', index=15, number=15, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT16', index=16, number=16, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT16', index=17, number=17, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX128', index=18, number=18, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_HALF', index=19, number=19, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_RESOURCE', index=20, number=20, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_VARIANT', index=21, number=21, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT32', index=22, number=22, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT64', index=23, number=23, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_FLOAT_REF', index=24, number=101, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_DOUBLE_REF', index=25, number=102, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT32_REF', index=26, number=103, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT8_REF', index=27, number=104, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT16_REF', index=28, number=105, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT8_REF', index=29, number=106, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_STRING_REF', index=30, number=107, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX64_REF', index=31, number=108, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_INT64_REF', index=32, number=109, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BOOL_REF', index=33, number=110, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT8_REF', index=34, number=111, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT8_REF', index=35, number=112, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT32_REF', index=36, number=113, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_BFLOAT16_REF', index=37, number=114, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QINT16_REF', index=38, number=115, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_QUINT16_REF', index=39, number=116, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT16_REF', index=40, number=117, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_COMPLEX128_REF', index=41, number=118, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_HALF_REF', index=42, number=119, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_RESOURCE_REF', index=43, number=120, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_VARIANT_REF', index=44, number=121, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT32_REF', index=45, number=122, + serialized_options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='DT_UINT64_REF', index=46, number=123, + serialized_options=None, + type=None), + ], + containing_type=None, + serialized_options=None, + serialized_start=57, + serialized_end=867, +) +_sym_db.RegisterEnumDescriptor(_DATATYPE) + +DataType = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) +DT_INVALID = 0 +DT_FLOAT = 1 +DT_DOUBLE = 2 +DT_INT32 = 3 +DT_UINT8 = 4 +DT_INT16 = 5 +DT_INT8 = 6 +DT_STRING = 7 +DT_COMPLEX64 = 8 +DT_INT64 = 9 +DT_BOOL = 10 +DT_QINT8 = 11 +DT_QUINT8 = 12 +DT_QINT32 = 13 +DT_BFLOAT16 = 14 +DT_QINT16 = 15 +DT_QUINT16 = 16 +DT_UINT16 = 17 +DT_COMPLEX128 = 18 +DT_HALF = 19 +DT_RESOURCE = 20 +DT_VARIANT = 21 +DT_UINT32 = 22 +DT_UINT64 = 23 +DT_FLOAT_REF = 101 +DT_DOUBLE_REF = 102 +DT_INT32_REF = 103 +DT_UINT8_REF = 104 +DT_INT16_REF = 105 +DT_INT8_REF = 106 +DT_STRING_REF = 107 +DT_COMPLEX64_REF = 108 +DT_INT64_REF = 109 +DT_BOOL_REF = 110 +DT_QINT8_REF = 111 +DT_QUINT8_REF = 112 +DT_QINT32_REF = 113 +DT_BFLOAT16_REF = 114 +DT_QINT16_REF = 115 +DT_QUINT16_REF = 116 +DT_UINT16_REF = 117 +DT_COMPLEX128_REF = 118 +DT_HALF_REF = 119 +DT_RESOURCE_REF = 120 +DT_VARIANT_REF = 121 +DT_UINT32_REF = 122 +DT_UINT64_REF = 123 + + +DESCRIPTOR.enum_types_by_name['DataType'] = _DATATYPE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + +DESCRIPTOR._options = None +# @@protoc_insertion_point(module_scope) diff --git a/serving_utils/protos/types_pb2_grpc.py b/serving_utils/protos/types_pb2_grpc.py new file mode 100644 index 0000000..a894352 --- /dev/null +++ b/serving_utils/protos/types_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/setup.py b/setup.py index eaaf0c3..fe7ab6e 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,6 @@ from pathlib import Path from setuptools import setup -from setuptools.command.install import install -from setuptools.command.develop import develop readme = Path(__file__).parent.joinpath('README.md') if readme.exists(): @@ -16,23 +14,6 @@ else: long_description = '-' - -class BuildPackageProtos(install): - - def run(self): - install.run(self) - from grpc.tools import command - command.build_package_protos('') - - -class BuildPackageProtosDevelop(develop): - - def run(self): - develop.run(self) - from grpc.tools import command - command.build_package_protos('') - - setup( name='serving-utils', version='0.8.0', @@ -52,12 +33,8 @@ def run(self): 'pypandoc', ], install_requires=[ + 'grpclib', 'grpcio-tools', - 'aiogrpc>=1.5', 'numpy>=1.14.0', ], - cmdclass={ - 'install': BuildPackageProtos, - 'develop': BuildPackageProtosDevelop, - }, )