From ed7bc0ebb200f18d86eeafcef8429008cf94e335 Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Thu, 31 Jan 2019 23:32:12 +0900 Subject: [PATCH 1/8] Rename repository link --- .gitmodules | 2 +- CONTRIBUTING.md | 16 ++++++++-------- README.md | 16 ++++++++-------- scripts/release.sh | 2 +- setup.py | 2 +- test-requirements.txt | 2 +- test/test_worker_client_e2e.py | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.gitmodules b/.gitmodules index a41f7e4..291c710 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "drucker_client/grpc"] path = drucker_client/grpc - url = https://github.com/rekcurd/drucker-grpc-proto.git + url = https://github.com/rekcurd/grpc-proto.git branch = master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e8b3ee..e964171 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,20 +1,20 @@ -## How to contribute to Drucker project +## How to contribute to Rekcurd project -First of all, thank you so much for taking your time to contribute! Drucker is not very different from any other open +First of all, thank you so much for taking your time to contribute! Rekcurd is not very different from any other open source projects you are aware of. It will be amazing if you could help us by doing any of the following: -- File an issue in [the issue tracker](https://github.com/drucker/drucker-client/issues) to report bugs and propose new features and +- File an issue in [the issue tracker](https://github.com/rekcurd/python-client/issues) to report bugs and propose new features and improvements. -- Ask a question by creating a new issue in [the issue tracker](https://github.com/drucker/drucker-client/issues). - - Browse [the list of previously asked questions](https://github.com/drucker/drucker-client/issues?q=label%3Aquestion). -- Contribute your work by sending [a pull request](https://github.com/drucker/drucker-client/pulls). +- Ask a question by creating a new issue in [the issue tracker](https://github.com/rekcurd/python-client/issues). + - Browse [the list of previously asked questions](https://github.com/rekcurd/python-client/issues?q=label%3Aquestion). +- Contribute your work by sending [a pull request](https://github.com/rekcurd/python-client/pulls). ### Contributor license agreement When you are sending a pull request and it's a non-trivial change beyond fixing typos, please sign -[the ICLA (individual contributor license agreement)](https://cla-assistant.io/drucker/drucker). Please +[the ICLA (individual contributor license agreement)](https://cla-assistant.io/rekcurd/python-client). Please [contact us](dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement). ### Code of conduct -We expect contributors to follow [our code of conduct](https://github.com/drucker/drucker-client/blob/master/CODE_OF_CONDUCT.md). +We expect contributors to follow [our code of conduct](https://github.com/rekcurd/python-client/blob/master/CODE_OF_CONDUCT.md). diff --git a/README.md b/README.md index 7d2015b..1ea86df 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ # rekcurd-client -[![Build Status](https://travis-ci.com/rekcurd/drucker-client.svg?branch=master)](https://travis-ci.com/rekcurd/drucker-client) +[![Build Status](https://travis-ci.com/rekcurd/python-client.svg?branch=master)](https://travis-ci.com/rekcurd/python-client) [![PyPI version](https://badge.fury.io/py/rekcurd-client.svg)](https://badge.fury.io/py/rekcurd-client) -[![codecov](https://codecov.io/gh/rekcurd/drucker-client/branch/master/graph/badge.svg)](https://codecov.io/gh/rekcurd/drucker-client "Non-generated packages only") +[![codecov](https://codecov.io/gh/rekcurd/python-client/branch/master/graph/badge.svg)](https://codecov.io/gh/rekcurd/python-client "Non-generated packages only") [![pypi supported versions](https://img.shields.io/pypi/pyversions/rekcurd-client.svg)](https://pypi.python.org/pypi/rekcurd-client) Rekcurd client is the project for integrating ML module. Any Rekcurd service is connectable. It can connect the Rekcurd service on Kubernetes. ## Parent Project -https://github.com/rekcurd/drucker-parent +https://github.com/rekcurd/community ## Components -- [Rekcurd](https://github.com/rekcurd/drucker): Project for serving ML module. -- [Rekcurd-dashboard](https://github.com/rekcurd/drucker-dashboard): Project for managing ML model and deploying ML module. -- [Rekcurd-client](https://github.com/rekcurd/drucker-client) (here): Project for integrating ML module. +- [Rekcurd](https://github.com/rekcurd/python-rekcurd): Project for serving ML module. +- [Rekcurd-dashboard](https://github.com/rekcurd/dashboard): Project for managing ML model and deploying ML module. +- [Rekcurd-client](https://github.com/rekcurd/python-client) (here): Project for integrating ML module. ## Installation From source: ``` -git clone --recursive https://github.com/rekcurd/drucker-client.git -cd drucker-client +git clone --recursive https://github.com/rekcurd/python-client.git +cd python-client python setup.py install ``` diff --git a/scripts/release.sh b/scripts/release.sh index f0b256a..3642130 100644 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -3,4 +3,4 @@ echo 'git clean -xdf' echo 'python setup.py sdist' echo 'python setup.py bdist_wheel --universal' -echo 'twine upload dist/* -r https://upload.pypi.org/legacy/ -u drucker' +echo 'twine upload dist/* -r https://upload.pypi.org/legacy/ -u rekcurd' diff --git a/setup.py b/setup.py index a66115b..e8e0349 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ author_email="drucker.developers@gmail.com", author="Drucker team and contributors", license="Apache License Version 2.0", - url="https://github.com/drucker/drucker-client", + url="https://github.com/rekcurd/python-client", keywords=["Drucker", "Kubernetes", "Python client", "gRPC"], install_requires=REQUIRES, tests_require=TESTS_REQUIRES, diff --git a/test-requirements.txt b/test-requirements.txt index a3d7834..8d22616 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -drucker>=0.4.0,<0.5.0 +rekcurd>=0.4.0,<0.5.0 coverage>=4.0.3 nose>=1.3.7 pytest diff --git a/test/test_worker_client_e2e.py b/test/test_worker_client_e2e.py index 8f99232..45991ad 100644 --- a/test/test_worker_client_e2e.py +++ b/test/test_worker_client_e2e.py @@ -40,7 +40,7 @@ def inner_method(*args, **kwargs): class DruckerWorkerClientTestE2E(unittest.TestCase): - """Tests for DruckerWorkerClient. This test is e2e test between drucker and drucker-client.""" + """Tests for DruckerWorkerClient. This test is e2e test between python-rekcurd and python-client.""" def fake_string_input(self): return 'Drucker' From fd2efc97a5536c8d4289a4bc06952711d3900cbf Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Fri, 1 Feb 2019 14:46:36 +0900 Subject: [PATCH 2/8] Rename from `python-rekcurd` to `rekcurd-python` --- README.md | 2 +- test/test_worker_client_e2e.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1ea86df..818e0fe 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ https://github.com/rekcurd/community ## Components -- [Rekcurd](https://github.com/rekcurd/python-rekcurd): Project for serving ML module. +- [Rekcurd](https://github.com/rekcurd/rekcurd-python): Project for serving ML module. - [Rekcurd-dashboard](https://github.com/rekcurd/dashboard): Project for managing ML model and deploying ML module. - [Rekcurd-client](https://github.com/rekcurd/python-client) (here): Project for integrating ML module. diff --git a/test/test_worker_client_e2e.py b/test/test_worker_client_e2e.py index 45991ad..906d350 100644 --- a/test/test_worker_client_e2e.py +++ b/test/test_worker_client_e2e.py @@ -40,7 +40,7 @@ def inner_method(*args, **kwargs): class DruckerWorkerClientTestE2E(unittest.TestCase): - """Tests for DruckerWorkerClient. This test is e2e test between python-rekcurd and python-client.""" + """Tests for DruckerWorkerClient. This test is e2e test between rekcurd-python and python-client.""" def fake_string_input(self): return 'Drucker' From 37ae5a7b2a6c6579219845a25e15c7c1c5704925 Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Mon, 4 Feb 2019 09:19:32 +0900 Subject: [PATCH 3/8] Update CHANGELOG.md --- CHANGELOG.md | 72 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c64894a..daa699b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,76 +1,76 @@ # Change Log -## [v0.4.5](https://github.com/rekcurd/drucker-client/tree/v0.4.5) (2019-01-30) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.4.4...v0.4.5) +## [v0.4.5](https://github.com/rekcurd/python-client/tree/v0.4.5) (2019-01-30) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.4.4...v0.4.5) **Merged pull requests:** -- Unittest py37 support [\#17](https://github.com/rekcurd/drucker-client/pull/17) ([keigohtr](https://github.com/keigohtr)) -- fix DummyApp in unittest [\#15](https://github.com/rekcurd/drucker-client/pull/15) ([yuki-mt](https://github.com/yuki-mt)) +- Unittest py37 support [\#17](https://github.com/rekcurd/python-client/pull/17) ([keigohtr](https://github.com/keigohtr)) +- fix DummyApp in unittest [\#15](https://github.com/rekcurd/python-client/pull/15) ([yuki-mt](https://github.com/yuki-mt)) -## [v0.4.4](https://github.com/rekcurd/drucker-client/tree/v0.4.4) (2019-01-15) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.4.3...v0.4.4) +## [v0.4.4](https://github.com/rekcurd/python-client/tree/v0.4.4) (2019-01-15) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.4.3...v0.4.4) **Merged pull requests:** -- Add slack notification [\#13](https://github.com/rekcurd/drucker-client/pull/13) ([keigohtr](https://github.com/keigohtr)) +- Add slack notification [\#13](https://github.com/rekcurd/python-client/pull/13) ([keigohtr](https://github.com/keigohtr)) -## [v0.4.3](https://github.com/rekcurd/drucker-client/tree/v0.4.3) (2018-12-26) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.4.2...v0.4.3) +## [v0.4.3](https://github.com/rekcurd/python-client/tree/v0.4.3) (2018-12-26) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.4.2...v0.4.3) **Merged pull requests:** -- Update README.md [\#12](https://github.com/rekcurd/drucker-client/pull/12) ([keigohtr](https://github.com/keigohtr)) -- Istio support [\#11](https://github.com/rekcurd/drucker-client/pull/11) ([keigohtr](https://github.com/keigohtr)) +- Update README.md [\#12](https://github.com/rekcurd/python-client/pull/12) ([keigohtr](https://github.com/keigohtr)) +- Istio support [\#11](https://github.com/rekcurd/python-client/pull/11) ([keigohtr](https://github.com/keigohtr)) -## [v0.4.2](https://github.com/rekcurd/drucker-client/tree/v0.4.2) (2018-11-28) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.4.1...v0.4.2) +## [v0.4.2](https://github.com/rekcurd/python-client/tree/v0.4.2) (2018-11-28) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.4.1...v0.4.2) -## [v0.4.1](https://github.com/rekcurd/drucker-client/tree/v0.4.1) (2018-11-20) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.4.0...v0.4.1) +## [v0.4.1](https://github.com/rekcurd/python-client/tree/v0.4.1) (2018-11-20) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.4.0...v0.4.1) **Merged pull requests:** -- Prepare for release v0.4.1 [\#9](https://github.com/rekcurd/drucker-client/pull/9) ([keigohtr](https://github.com/keigohtr)) +- Prepare for release v0.4.1 [\#9](https://github.com/rekcurd/python-client/pull/9) ([keigohtr](https://github.com/keigohtr)) -## [v0.4.0](https://github.com/rekcurd/drucker-client/tree/v0.4.0) (2018-11-07) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.3.4...v0.4.0) +## [v0.4.0](https://github.com/rekcurd/python-client/tree/v0.4.0) (2018-11-07) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.3.4...v0.4.0) **Merged pull requests:** -- Add badge [\#8](https://github.com/rekcurd/drucker-client/pull/8) ([keigohtr](https://github.com/keigohtr)) -- Create CONTRIBUTING.md [\#7](https://github.com/rekcurd/drucker-client/pull/7) ([syleeeee](https://github.com/syleeeee)) -- Create CODE\_OF\_CONDUCT.md [\#6](https://github.com/rekcurd/drucker-client/pull/6) ([syleeeee](https://github.com/syleeeee)) -- Pipnize drucker client [\#5](https://github.com/rekcurd/drucker-client/pull/5) ([keigohtr](https://github.com/keigohtr)) +- Add badge [\#8](https://github.com/rekcurd/python-client/pull/8) ([keigohtr](https://github.com/keigohtr)) +- Create CONTRIBUTING.md [\#7](https://github.com/rekcurd/python-client/pull/7) ([syleeeee](https://github.com/syleeeee)) +- Create CODE\_OF\_CONDUCT.md [\#6](https://github.com/rekcurd/python-client/pull/6) ([syleeeee](https://github.com/syleeeee)) +- Pipnize drucker client [\#5](https://github.com/rekcurd/python-client/pull/5) ([keigohtr](https://github.com/keigohtr)) -## [v0.3.4](https://github.com/rekcurd/drucker-client/tree/v0.3.4) (2018-10-03) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.3.3...v0.3.4) +## [v0.3.4](https://github.com/rekcurd/python-client/tree/v0.3.4) (2018-10-03) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.3.3...v0.3.4) -## [v0.3.3](https://github.com/rekcurd/drucker-client/tree/v0.3.3) (2018-08-29) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.3.2...v0.3.3) +## [v0.3.3](https://github.com/rekcurd/python-client/tree/v0.3.3) (2018-08-29) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.3.2...v0.3.3) **Merged pull requests:** -- Refactor `sys.path.append` related code [\#3](https://github.com/rekcurd/drucker-client/pull/3) ([keigohtr](https://github.com/keigohtr)) +- Refactor `sys.path.append` related code [\#3](https://github.com/rekcurd/python-client/pull/3) ([keigohtr](https://github.com/keigohtr)) -## [v0.3.2](https://github.com/rekcurd/drucker-client/tree/v0.3.2) (2018-08-22) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.3.1...v0.3.2) +## [v0.3.2](https://github.com/rekcurd/python-client/tree/v0.3.2) (2018-08-22) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.3.1...v0.3.2) -## [v0.3.1](https://github.com/rekcurd/drucker-client/tree/v0.3.1) (2018-08-15) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.3.0...v0.3.1) +## [v0.3.1](https://github.com/rekcurd/python-client/tree/v0.3.1) (2018-08-15) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.3.0...v0.3.1) **Merged pull requests:** -- \[Hotfix\] Change code generator [\#2](https://github.com/rekcurd/drucker-client/pull/2) ([keigohtr](https://github.com/keigohtr)) +- \[Hotfix\] Change code generator [\#2](https://github.com/rekcurd/python-client/pull/2) ([keigohtr](https://github.com/keigohtr)) -## [v0.3.0](https://github.com/rekcurd/drucker-client/tree/v0.3.0) (2018-08-08) -[Full Changelog](https://github.com/rekcurd/drucker-client/compare/v0.2.0...v0.3.0) +## [v0.3.0](https://github.com/rekcurd/python-client/tree/v0.3.0) (2018-08-08) +[Full Changelog](https://github.com/rekcurd/python-client/compare/v0.2.0...v0.3.0) **Merged pull requests:** -- Add version info to endpoint [\#1](https://github.com/rekcurd/drucker-client/pull/1) ([keigohtr](https://github.com/keigohtr)) +- Add version info to endpoint [\#1](https://github.com/rekcurd/python-client/pull/1) ([keigohtr](https://github.com/keigohtr)) -## [v0.2.0](https://github.com/rekcurd/drucker-client/tree/v0.2.0) (2018-07-17) +## [v0.2.0](https://github.com/rekcurd/python-client/tree/v0.2.0) (2018-07-17) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file From aefe572d89ea241e0dc656bbb19e706b5b5b48bb Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Mon, 4 Feb 2019 09:42:44 +0900 Subject: [PATCH 4/8] Rename directory/file/class/method from `drucker` to `rekcurd` --- .gitmodules | 4 +- drucker_client/grpc | 1 - example/sample.py | 10 +- .../__init__.py | 8 +- .../_project.py | 0 .../_version.py | 0 rekcurd_client/grpc | 1 + .../logger/__init__.py | 0 .../logger/logger_fluent.py | 2 +- .../logger/logger_interface.py | 0 .../logger/logger_jsonlogger.py | 2 +- {drucker_client => rekcurd_client}/protobuf | 0 .../rekcurd_worker_client.py | 102 +++++++++--------- setup.py | 16 +-- test/__init__.py | 12 +-- test/_client_application.py | 72 ++++++------- test/dummy_app.py | 6 +- test/test_worker_client.py | 12 +-- test/test_worker_client_e2e.py | 24 ++--- 19 files changed, 136 insertions(+), 136 deletions(-) delete mode 160000 drucker_client/grpc rename {drucker_client => rekcurd_client}/__init__.py (78%) rename {drucker_client => rekcurd_client}/_project.py (100%) rename {drucker_client => rekcurd_client}/_version.py (100%) create mode 160000 rekcurd_client/grpc rename {drucker_client => rekcurd_client}/logger/__init__.py (100%) rename {drucker_client => rekcurd_client}/logger/logger_fluent.py (96%) rename {drucker_client => rekcurd_client}/logger/logger_interface.py (100%) rename {drucker_client => rekcurd_client}/logger/logger_jsonlogger.py (97%) rename {drucker_client => rekcurd_client}/protobuf (100%) rename drucker_client/drucker_worker_client.py => rekcurd_client/rekcurd_worker_client.py (77%) diff --git a/.gitmodules b/.gitmodules index 291c710..cab4070 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "drucker_client/grpc"] - path = drucker_client/grpc +[submodule "rekcurd_client/grpc"] + path = rekcurd_client/grpc url = https://github.com/rekcurd/grpc-proto.git branch = master diff --git a/drucker_client/grpc b/drucker_client/grpc deleted file mode 160000 index 9f9636f..0000000 --- a/drucker_client/grpc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f9636f1f0de571bbb00c6bdc34698b5221d369a diff --git a/example/sample.py b/example/sample.py index 9565d54..feb2fa3 100644 --- a/example/sample.py +++ b/example/sample.py @@ -2,17 +2,17 @@ # -*- coding: utf-8 -*- -from drucker_client import DruckerWorkerClient -from drucker_client.logger import logger +from rekcurd_client import RekcurdWorkerClient +from rekcurd_client.logger import logger host = 'localhost:5000' -client = DruckerWorkerClient(logger=logger, host=host) +client = RekcurdWorkerClient(logger=logger, host=host) #domain = 'example.com' -#app = 'drucker-sample' +#app = 'rekcurd-sample' #env = 'development' -#client = DruckerWorkerClient(logger=logger, domain=domain, app=app, env=env) +#client = RekcurdWorkerClient(logger=logger, domain=domain, app=app, env=env) input = [0,0,0,1,11,0,0,0,0,0, 0,7,8,0,0,0,0,0,1,13, diff --git a/drucker_client/__init__.py b/rekcurd_client/__init__.py similarity index 78% rename from drucker_client/__init__.py rename to rekcurd_client/__init__.py index a372b4a..92be632 100644 --- a/drucker_client/__init__.py +++ b/rekcurd_client/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2018 The Drucker Authors. +# Copyright 2018 The Rekcurd Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from drucker_client import _project -from drucker_client import _version +from rekcurd_client import _project +from rekcurd_client import _version __project__ = _project.__project__ __version__ = _version.__version__ -from .drucker_worker_client import DruckerWorkerClient +from .rekcurd_worker_client import RekcurdWorkerClient diff --git a/drucker_client/_project.py b/rekcurd_client/_project.py similarity index 100% rename from drucker_client/_project.py rename to rekcurd_client/_project.py diff --git a/drucker_client/_version.py b/rekcurd_client/_version.py similarity index 100% rename from drucker_client/_version.py rename to rekcurd_client/_version.py diff --git a/rekcurd_client/grpc b/rekcurd_client/grpc new file mode 160000 index 0000000..4fcb282 --- /dev/null +++ b/rekcurd_client/grpc @@ -0,0 +1 @@ +Subproject commit 4fcb282d80e09ee0364c6b6f156f2439a6e75bfc diff --git a/drucker_client/logger/__init__.py b/rekcurd_client/logger/__init__.py similarity index 100% rename from drucker_client/logger/__init__.py rename to rekcurd_client/logger/__init__.py diff --git a/drucker_client/logger/logger_fluent.py b/rekcurd_client/logger/logger_fluent.py similarity index 96% rename from drucker_client/logger/logger_fluent.py rename to rekcurd_client/logger/logger_fluent.py index 8fef977..3652aeb 100644 --- a/drucker_client/logger/logger_fluent.py +++ b/rekcurd_client/logger/logger_fluent.py @@ -11,7 +11,7 @@ class FluentSystemLogger(SystemLoggerInterface): - def __init__(self, logger_name: str = 'drucker_client', log_level: int = logging.NOTSET) -> None: + def __init__(self, logger_name: str = 'rekcurd_client', log_level: int = logging.NOTSET) -> None: """ Constructor :param logger_name: logger name diff --git a/drucker_client/logger/logger_interface.py b/rekcurd_client/logger/logger_interface.py similarity index 100% rename from drucker_client/logger/logger_interface.py rename to rekcurd_client/logger/logger_interface.py diff --git a/drucker_client/logger/logger_jsonlogger.py b/rekcurd_client/logger/logger_jsonlogger.py similarity index 97% rename from drucker_client/logger/logger_jsonlogger.py rename to rekcurd_client/logger/logger_jsonlogger.py index 7feae82..583e013 100644 --- a/drucker_client/logger/logger_jsonlogger.py +++ b/rekcurd_client/logger/logger_jsonlogger.py @@ -25,7 +25,7 @@ def add_fields(self, log_record, record, message_dict): log_record['host'] = gethostname() log_record['timestamp'] = int(time.time() * 1000) / 1000 - def __init__(self, logger_name: str = 'drucker_client', log_level: int = logging.NOTSET) -> None: + def __init__(self, logger_name: str = 'rekcurd_client', log_level: int = logging.NOTSET) -> None: """ Constructor :param logger_name: logger name diff --git a/drucker_client/protobuf b/rekcurd_client/protobuf similarity index 100% rename from drucker_client/protobuf rename to rekcurd_client/protobuf diff --git a/drucker_client/drucker_worker_client.py b/rekcurd_client/rekcurd_worker_client.py similarity index 77% rename from drucker_client/drucker_worker_client.py rename to rekcurd_client/rekcurd_worker_client.py index 3b4d1a8..8f76a58 100644 --- a/drucker_client/drucker_worker_client.py +++ b/rekcurd_client/rekcurd_worker_client.py @@ -6,7 +6,7 @@ import types import grpc -from .protobuf import drucker_pb2, drucker_pb2_grpc +from .protobuf import rekcurd_pb2, rekcurd_pb2_grpc from .logger import SystemLoggerInterface @@ -38,7 +38,7 @@ def _wrapper(*args, **kwargs): return _wrapper_maker -class DruckerWorkerClient: +class RekcurdWorkerClient: def __init__(self, logger: SystemLoggerInterface, host: str = None, domain: str = None, app: str = None, @@ -49,9 +49,9 @@ def __init__(self, logger: SystemLoggerInterface, raise RuntimeError("You must specify url or domain+app+env.") if version is None: - v_str = drucker_pb2.DESCRIPTOR.GetOptions().Extensions[drucker_pb2.drucker_grpc_proto_version] + v_str = rekcurd_pb2.DESCRIPTOR.GetOptions().Extensions[rekcurd_pb2.rekcurd_grpc_proto_version] else: - v_str = drucker_pb2.EnumVersionInfo.Name(version) + v_str = rekcurd_pb2.EnumVersionInfo.Name(version) self.__metadata = [('x-rekcurd-application-name', app), ('x-rekcurd-sevice-level', env), @@ -80,201 +80,201 @@ def __change_domain_app_env(self, domain: str, app: str, env: str, version: str) def __change_host(self, host: str): channel = grpc.insecure_channel(host) - self.stub = drucker_pb2_grpc.DruckerWorkerStub(channel) + self.stub = rekcurd_pb2_grpc.RekcurdWorkerStub(channel) def __byte_input_request(self, input, option="{}"): - yield drucker_pb2.BytesInput(input=input, option=drucker_pb2.Option(val=option)) + yield rekcurd_pb2.BytesInput(input=input, option=rekcurd_pb2.Option(val=option)) - @error_handling(drucker_pb2.StringOutput()) + @error_handling(rekcurd_pb2.StringOutput()) def run_predict_string_string(self, input, option="{}"): - request = drucker_pb2.StringInput() + request = rekcurd_pb2.StringInput() request.input = input request.option.val=option response = self.stub.Predict_String_String(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.BytesOutput()) + @error_handling(rekcurd_pb2.BytesOutput()) def run_predict_string_bytes(self, input, option="{}"): - request = drucker_pb2.StringInput() + request = rekcurd_pb2.StringInput() request.input = input request.option.val=option response = self.stub.Predict_String_Bytes(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrIntOutput()) + @error_handling(rekcurd_pb2.ArrIntOutput()) def run_predict_string_arrint(self, input, option="{}"): - request = drucker_pb2.StringInput() + request = rekcurd_pb2.StringInput() request.input = input request.option.val=option response = self.stub.Predict_String_ArrInt(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrFloatOutput()) + @error_handling(rekcurd_pb2.ArrFloatOutput()) def run_predict_string_arrfloat(self, input, option="{}"): - request = drucker_pb2.StringInput() + request = rekcurd_pb2.StringInput() request.input = input request.option.val=option response = self.stub.Predict_String_ArrFloat(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrStringOutput()) + @error_handling(rekcurd_pb2.ArrStringOutput()) def run_predict_string_arrstring(self, input, option="{}"): - request = drucker_pb2.StringInput() + request = rekcurd_pb2.StringInput() request.input = input request.option.val=option response = self.stub.Predict_String_ArrString(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.StringOutput()) + @error_handling(rekcurd_pb2.StringOutput()) def run_predict_bytes_string(self, input, option="{}"): request_iterator = self.__byte_input_request(input, option) response = self.stub.Predict_Bytes_String(request_iterator, metadata=self.__metadata) return response - @error_handling(drucker_pb2.BytesOutput()) + @error_handling(rekcurd_pb2.BytesOutput()) def run_predict_bytes_bytes(self, input, option="{}"): request_iterator = self.__byte_input_request(input, option) response = self.stub.Predict_Bytes_Bytes(request_iterator, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrIntOutput()) + @error_handling(rekcurd_pb2.ArrIntOutput()) def run_predict_bytes_arrint(self, input, option="{}"): request_iterator = self.__byte_input_request(input, option) response = self.stub.Predict_Bytes_ArrInt(request_iterator, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrFloatOutput()) + @error_handling(rekcurd_pb2.ArrFloatOutput()) def run_predict_bytes_arrfloat(self, input, option="{}"): request_iterator = self.__byte_input_request(input, option) response = self.stub.Predict_Bytes_ArrFloat(request_iterator, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrStringOutput()) + @error_handling(rekcurd_pb2.ArrStringOutput()) def run_predict_bytes_arrstring(self, input, option="{}"): request_iterator = self.__byte_input_request(input, option) response = self.stub.Predict_Bytes_ArrString(request_iterator, metadata=self.__metadata) return response - @error_handling(drucker_pb2.StringOutput()) + @error_handling(rekcurd_pb2.StringOutput()) def run_predict_arrint_string(self, input, option="{}"): - request = drucker_pb2.ArrIntInput() + request = rekcurd_pb2.ArrIntInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrInt_String(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.BytesOutput()) + @error_handling(rekcurd_pb2.BytesOutput()) def run_predict_arrint_bytes(self, input, option="{}"): - request = drucker_pb2.ArrIntInput() + request = rekcurd_pb2.ArrIntInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrInt_Bytes(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrIntOutput()) + @error_handling(rekcurd_pb2.ArrIntOutput()) def run_predict_arrint_arrint(self, input, option="{}"): - request = drucker_pb2.ArrIntInput() + request = rekcurd_pb2.ArrIntInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrInt_ArrInt(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrFloatOutput()) + @error_handling(rekcurd_pb2.ArrFloatOutput()) def run_predict_arrint_arrfloat(self, input, option="{}"): - request = drucker_pb2.ArrIntInput() + request = rekcurd_pb2.ArrIntInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrInt_ArrFloat(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrStringOutput()) + @error_handling(rekcurd_pb2.ArrStringOutput()) def run_predict_arrint_arrstring(self, input, option="{}"): - request = drucker_pb2.ArrIntInput() + request = rekcurd_pb2.ArrIntInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrInt_ArrString(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.StringOutput()) + @error_handling(rekcurd_pb2.StringOutput()) def run_predict_arrfloat_string(self, input, option="{}"): - request = drucker_pb2.ArrFloatInput() + request = rekcurd_pb2.ArrFloatInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrFloat_String(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.BytesOutput()) + @error_handling(rekcurd_pb2.BytesOutput()) def run_predict_arrfloat_bytes(self, input, option="{}"): - request = drucker_pb2.ArrFloatInput() + request = rekcurd_pb2.ArrFloatInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrFloat_Bytes(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrIntOutput()) + @error_handling(rekcurd_pb2.ArrIntOutput()) def run_predict_arrfloat_arrint(self, input, option="{}"): - request = drucker_pb2.ArrFloatInput() + request = rekcurd_pb2.ArrFloatInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrFloat_ArrInt(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrFloatOutput()) + @error_handling(rekcurd_pb2.ArrFloatOutput()) def run_predict_arrfloat_arrfloat(self, input, option="{}"): - request = drucker_pb2.ArrFloatInput() + request = rekcurd_pb2.ArrFloatInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrFloat_ArrFloat(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrStringOutput()) + @error_handling(rekcurd_pb2.ArrStringOutput()) def run_predict_arrfloat_arrstring(self, input, option="{}"): - request = drucker_pb2.ArrFloatInput() + request = rekcurd_pb2.ArrFloatInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrFloat_ArrString(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.StringOutput()) + @error_handling(rekcurd_pb2.StringOutput()) def run_predict_arrstring_string(self, input, option="{}"): - request = drucker_pb2.ArrStringInput() + request = rekcurd_pb2.ArrStringInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrString_String(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.BytesOutput()) + @error_handling(rekcurd_pb2.BytesOutput()) def run_predict_arrstring_bytes(self, input, option="{}"): - request = drucker_pb2.ArrStringInput() + request = rekcurd_pb2.ArrStringInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrString_Bytes(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrIntOutput()) + @error_handling(rekcurd_pb2.ArrIntOutput()) def run_predict_arrstring_arrint(self, input, option="{}"): - request = drucker_pb2.ArrStringInput() + request = rekcurd_pb2.ArrStringInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrString_ArrInt(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrFloatOutput()) + @error_handling(rekcurd_pb2.ArrFloatOutput()) def run_predict_arrstring_arrfloat(self, input, option="{}"): - request = drucker_pb2.ArrStringInput() + request = rekcurd_pb2.ArrStringInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrString_ArrFloat(request, metadata=self.__metadata) return response - @error_handling(drucker_pb2.ArrStringOutput()) + @error_handling(rekcurd_pb2.ArrStringOutput()) def run_predict_arrstring_arrstring(self, input, option="{}"): - request = drucker_pb2.ArrStringInput() + request = rekcurd_pb2.ArrStringInput() request.input.extend(input) request.option.val=option response = self.stub.Predict_ArrString_ArrString(request, metadata=self.__metadata) diff --git a/setup.py b/setup.py index e8e0349..3d58b3d 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright 2018 The Drucker Authors. +# Copyright 2018 The Rekcurd Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ here = os.path.abspath(os.path.dirname(__file__)) -exec(open(os.path.join(here, 'drucker_client', '_project.py')).read()) -exec(open(os.path.join(here, 'drucker_client', '_version.py')).read()) +exec(open(os.path.join(here, 'rekcurd_client', '_project.py')).read()) +exec(open(os.path.join(here, 'rekcurd_client', '_version.py')).read()) PACKAGE_NAME = __project__ # NOQA VERSION = __version__ # NOQA DEVELOPMENT_STATUS = "3 - Alpha" @@ -52,16 +52,16 @@ setup( name=PACKAGE_NAME, version=VERSION, - description="A Python gRPC client for Drucker.", - author_email="drucker.developers@gmail.com", - author="Drucker team and contributors", + description="A Python gRPC client for Rekcurd.", + author_email="rekcurd.developers@gmail.com", + author="Rekcurd team and contributors", license="Apache License Version 2.0", url="https://github.com/rekcurd/python-client", - keywords=["Drucker", "Kubernetes", "Python client", "gRPC"], + keywords=["Rekcurd", "Kubernetes", "Python client", "gRPC"], install_requires=REQUIRES, tests_require=TESTS_REQUIRES, extras_require=EXTRAS, - packages=['drucker_client', 'drucker_client.logger', + packages=['rekcurd_client', 'drucker_client.logger', 'drucker_client.protobuf'], include_package_data=True, long_description=LONG_DESCRIPTION, diff --git a/test/__init__.py b/test/__init__.py index 9ec1be9..f0f25ab 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,17 +1,17 @@ import os -from drucker.logger import JsonServiceLogger, JsonSystemLogger -import drucker.drucker_worker_servicer +from rekcurd.logger import JsonServiceLogger, JsonSystemLogger +import rekcurd.rekcurd_worker_servicer from test.dummy_app import DummyApp -from drucker_client.logger import logger +from rekcurd_client.logger import logger -os.environ["DRUCKER_TEST_MODE"] = "True" -os.environ["DRUCKER_SETTINGS_YAML"] = "test/test-settings.yml" +os.environ["REKCURD_TEST_MODE"] = "True" +os.environ["REKCURD_SETTINGS_YAML"] = "test/test-settings.yml" app = DummyApp() service_logger = JsonServiceLogger(app.config) system_logger = JsonSystemLogger(app.config) -Type = drucker.drucker_worker_servicer.DruckerWorkerServicer.Type +Type = rekcurd.rekcurd_worker_servicer.RekcurdWorkerServicer.Type client_logger = logger diff --git a/test/_client_application.py b/test/_client_application.py index 96a21c5..1a61dd6 100644 --- a/test/_client_application.py +++ b/test/_client_application.py @@ -3,12 +3,12 @@ import threading import grpc -from drucker.utils import PredictResult +from rekcurd.utils import PredictResult -import drucker_client.drucker_worker_client -from drucker_client.protobuf import drucker_pb2_grpc -from drucker_client.logger import logger -from drucker_client import DruckerWorkerClient +import rekcurd_client.rekcurd_worker_client +from rekcurd_client.protobuf import rekcurd_pb2_grpc +from rekcurd_client.logger import logger +from rekcurd_client import RekcurdWorkerClient @enum.unique @@ -98,21 +98,21 @@ def close(self): @enum.unique class Request(enum.Enum): - STRING_REQUEST = 'Drucker' + STRING_REQUEST = 'Rekcurd' BYTES_REQUEST = b'u\x95jD\x0c\xf4\xf4{\xa6\xd7' ARRAY_INT_REQUEST = [124, 117, 2, 216] ARRAY_FLOAT_REQUEST = [0.51558887, 0.07656534, 0.64258131, 0.45239403, 0.53738411, 0.3863864, 0.33985784] - ARRAY_STRING_REQUEST = ['Drucker', 'is', 'great'] + ARRAY_STRING_REQUEST = ['Rekcurd', 'is', 'great'] @enum.unique class Response(enum.Enum): - STRING_RESPONSE = PredictResult('Drucker', 1.0, option={}) + STRING_RESPONSE = PredictResult('Rekcurd', 1.0, option={}) BYTES_RESPONSE = PredictResult(b'\x8f\xfa;\xc8a\xa3T%', 1.0, option={}) ARRAY_INT_RESPONSE = PredictResult([2, 3, 5, 7], [1.0, 1.0, 1.0, 1.0], option={}) ARRAY_FLOAT_RESPONSE = PredictResult([0.78341155, 0.03166816, 0.92745938], [1.0, 1.0, 1.0], option={}) - ARRAY_STRING_RESPONSE = PredictResult(['Drucker', 'is', 'awesome'], [1.0, 1.0, 1.0], option={}) + ARRAY_STRING_RESPONSE = PredictResult(['Rekcurd', 'is', 'awesome'], [1.0, 1.0, 1.0], option={}) def _assertStringResponse(response): @@ -156,7 +156,7 @@ def _assertArrStringResponse(response): return False -def _run_string_string(client: DruckerWorkerClient): +def _run_string_string(client: RekcurdWorkerClient): response = client.run_predict_string_string(Request.STRING_REQUEST.value) if _assertStringResponse(response): return _SATISFACTORY_OUTCOME @@ -164,7 +164,7 @@ def _run_string_string(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_string_bytes(client: DruckerWorkerClient): +def _run_string_bytes(client: RekcurdWorkerClient): response_iterator = client.run_predict_string_bytes(Request.STRING_REQUEST.value) if _assertBytesResponse(response_iterator): return _SATISFACTORY_OUTCOME @@ -172,7 +172,7 @@ def _run_string_bytes(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_string_arrint(client: DruckerWorkerClient): +def _run_string_arrint(client: RekcurdWorkerClient): response = client.run_predict_string_arrint(Request.STRING_REQUEST.value) if _assertArrIntResponse(response): return _SATISFACTORY_OUTCOME @@ -180,7 +180,7 @@ def _run_string_arrint(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_string_arrfloat(client: DruckerWorkerClient): +def _run_string_arrfloat(client: RekcurdWorkerClient): response = client.run_predict_string_arrfloat(Request.STRING_REQUEST.value) if _assertArrFloatResponse(response): return _SATISFACTORY_OUTCOME @@ -188,7 +188,7 @@ def _run_string_arrfloat(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_string_arrstring(client: DruckerWorkerClient): +def _run_string_arrstring(client: RekcurdWorkerClient): response = client.run_predict_string_arrstring(Request.STRING_REQUEST.value) if _assertArrStringResponse(response): return _SATISFACTORY_OUTCOME @@ -196,7 +196,7 @@ def _run_string_arrstring(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_bytes_string(client: DruckerWorkerClient): +def _run_bytes_string(client: RekcurdWorkerClient): response, call = client.stub.Predict_Bytes_String.with_call( iter((Request.BYTES_REQUEST.value,) * 3)) if (Response.STRING_RESPONSE.value == response and @@ -206,7 +206,7 @@ def _run_bytes_string(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_bytes_bytes(client: DruckerWorkerClient): +def _run_bytes_bytes(client: RekcurdWorkerClient): request_pipe = _Pipe() response_iterator = client.stub.Predict_Bytes_Bytes(iter(request_pipe)) request_pipe.add(Request.BYTES_REQUEST.value) @@ -228,7 +228,7 @@ def _run_bytes_bytes(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_bytes_arrint(client: DruckerWorkerClient): +def _run_bytes_arrint(client: RekcurdWorkerClient): response, call = client.stub.Predict_Bytes_ArrInt.with_call( iter((Request.BYTES_REQUEST.value,) * 3)) if (Response.ARRAY_INT_RESPONSE.value == response and @@ -238,7 +238,7 @@ def _run_bytes_arrint(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_bytes_arrfloat(client: DruckerWorkerClient): +def _run_bytes_arrfloat(client: RekcurdWorkerClient): response, call = client.stub.Predict_Bytes_ArrFloat.with_call( iter((Request.BYTES_REQUEST.value,) * 3)) if (Response.ARRAY_FLOAT_RESPONSE.value == response and @@ -248,7 +248,7 @@ def _run_bytes_arrfloat(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_bytes_arrstring(client: DruckerWorkerClient): +def _run_bytes_arrstring(client: RekcurdWorkerClient): response, call = client.stub.Predict_Bytes_ArrString.with_call( iter((Request.BYTES_REQUEST.value,) * 3)) if (Response.ARRAY_STRING_RESPONSE.value == response and @@ -258,7 +258,7 @@ def _run_bytes_arrstring(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrint_string(client: DruckerWorkerClient): +def _run_arrint_string(client: RekcurdWorkerClient): response = client.run_predict_arrint_string(Request.ARRAY_INT_REQUEST.value) if _assertStringResponse(response): return _SATISFACTORY_OUTCOME @@ -266,7 +266,7 @@ def _run_arrint_string(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrint_bytes(client: DruckerWorkerClient): +def _run_arrint_bytes(client: RekcurdWorkerClient): response_iterator = client.run_predict_arrint_bytes(Request.ARRAY_INT_REQUEST.value) if _assertBytesResponse(response_iterator): return _SATISFACTORY_OUTCOME @@ -274,7 +274,7 @@ def _run_arrint_bytes(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrint_arrint(client: DruckerWorkerClient): +def _run_arrint_arrint(client: RekcurdWorkerClient): response = client.run_predict_arrint_arrint(Request.ARRAY_INT_REQUEST.value) if _assertArrIntResponse(response): return _SATISFACTORY_OUTCOME @@ -282,7 +282,7 @@ def _run_arrint_arrint(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrint_arrfloat(client: DruckerWorkerClient): +def _run_arrint_arrfloat(client: RekcurdWorkerClient): response = client.run_predict_arrint_arrfloat(Request.ARRAY_INT_REQUEST.value) if _assertArrFloatResponse(response): return _SATISFACTORY_OUTCOME @@ -290,7 +290,7 @@ def _run_arrint_arrfloat(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrint_arrstring(client: DruckerWorkerClient): +def _run_arrint_arrstring(client: RekcurdWorkerClient): response = client.run_predict_arrint_arrstring(Request.ARRAY_INT_REQUEST.value) if _assertArrStringResponse(response): return _SATISFACTORY_OUTCOME @@ -298,7 +298,7 @@ def _run_arrint_arrstring(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrfloat_string(client: DruckerWorkerClient): +def _run_arrfloat_string(client: RekcurdWorkerClient): response = client.run_predict_arrfloat_string(Request.ARRAY_FLOAT_REQUEST.value) if _assertStringResponse(response): return _SATISFACTORY_OUTCOME @@ -306,7 +306,7 @@ def _run_arrfloat_string(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrfloat_bytes(client: DruckerWorkerClient): +def _run_arrfloat_bytes(client: RekcurdWorkerClient): response_iterator = client.run_predict_arrfloat_bytes(Request.ARRAY_FLOAT_REQUEST.value) if _assertBytesResponse(response_iterator): return _SATISFACTORY_OUTCOME @@ -314,7 +314,7 @@ def _run_arrfloat_bytes(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrfloat_arrint(client: DruckerWorkerClient): +def _run_arrfloat_arrint(client: RekcurdWorkerClient): response = client.run_predict_arrfloat_arrint(Request.ARRAY_FLOAT_REQUEST.value) if _assertArrIntResponse(response): return _SATISFACTORY_OUTCOME @@ -322,7 +322,7 @@ def _run_arrfloat_arrint(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrfloat_arrfloat(client: DruckerWorkerClient): +def _run_arrfloat_arrfloat(client: RekcurdWorkerClient): response = client.run_predict_arrfloat_arrfloat(Request.ARRAY_FLOAT_REQUEST.value) if _assertArrFloatResponse(response): return _SATISFACTORY_OUTCOME @@ -330,7 +330,7 @@ def _run_arrfloat_arrfloat(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrfloat_arrstring(client: DruckerWorkerClient): +def _run_arrfloat_arrstring(client: RekcurdWorkerClient): response = client.run_predict_arrfloat_arrstring(Request.ARRAY_FLOAT_REQUEST.value) if _assertArrStringResponse(response): return _SATISFACTORY_OUTCOME @@ -338,7 +338,7 @@ def _run_arrfloat_arrstring(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrstring_string(client: DruckerWorkerClient): +def _run_arrstring_string(client: RekcurdWorkerClient): response = client.run_predict_arrstring_string(Request.ARRAY_STRING_REQUEST.value) if _assertStringResponse(response): return _SATISFACTORY_OUTCOME @@ -346,7 +346,7 @@ def _run_arrstring_string(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrstring_bytes(client: DruckerWorkerClient): +def _run_arrstring_bytes(client: RekcurdWorkerClient): response_iterator = client.run_predict_arrstring_bytes(Request.ARRAY_STRING_REQUEST.value) if _assertBytesResponse(response_iterator): return _SATISFACTORY_OUTCOME @@ -354,7 +354,7 @@ def _run_arrstring_bytes(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrstring_arrint(client: DruckerWorkerClient): +def _run_arrstring_arrint(client: RekcurdWorkerClient): response = client.run_predict_arrstring_arrint(Request.ARRAY_STRING_REQUEST.value) if _assertArrIntResponse(response): return _SATISFACTORY_OUTCOME @@ -362,7 +362,7 @@ def _run_arrstring_arrint(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrstring_arrfloat(client: DruckerWorkerClient): +def _run_arrstring_arrfloat(client: RekcurdWorkerClient): response = client.run_predict_arrstring_arrfloat(Request.ARRAY_STRING_REQUEST.value) if _assertArrFloatResponse(response): return _SATISFACTORY_OUTCOME @@ -370,7 +370,7 @@ def _run_arrstring_arrfloat(client: DruckerWorkerClient): return _UNSATISFACTORY_OUTCOME -def _run_arrstring_arrstring(client: DruckerWorkerClient): +def _run_arrstring_arrstring(client: RekcurdWorkerClient): response = client.run_predict_arrstring_arrstring(Request.ARRAY_STRING_REQUEST.value) if _assertArrStringResponse(response): return _SATISFACTORY_OUTCOME @@ -408,8 +408,8 @@ def _run_arrstring_arrstring(client: DruckerWorkerClient): def run(scenario, channel): - stub = drucker_pb2_grpc.DruckerWorkerStub(channel) - client = drucker_client.drucker_worker_client.DruckerWorkerClient(logger=logger, domain='example.com', app='drucker-sample', env='development') + stub = rekcurd_pb2_grpc.RekcurdWorkerStub(channel) + client = rekcurd_client.rekcurd_worker_client.RekcurdWorkerClient(logger=logger, domain='example.com', app='rekcurd-sample', env='development') client.stub = stub try: return _IMPLEMENTATIONS[scenario](client) diff --git a/test/dummy_app.py b/test/dummy_app.py index 9189b60..76fe283 100644 --- a/test/dummy_app.py +++ b/test/dummy_app.py @@ -2,12 +2,12 @@ # -*- coding: utf-8 -*- -from drucker import Drucker -from drucker.utils import PredictLabel, PredictResult, EvaluateResult, EvaluateResultDetail, EvaluateDetail +from rekcurd import Rekcurd +from rekcurd.utils import PredictLabel, PredictResult, EvaluateResult, EvaluateResultDetail, EvaluateDetail from typing import List, Generator -class DummyApp(Drucker): +class DummyApp(Rekcurd): def __init__(self, config_file: str = None): super().__init__(config_file) diff --git a/test/test_worker_client.py b/test/test_worker_client.py index 0b6f958..1f7af42 100644 --- a/test/test_worker_client.py +++ b/test/test_worker_client.py @@ -5,23 +5,23 @@ from grpc.framework.foundation import logging_pool import grpc_testing -from drucker_client.protobuf import drucker_pb2 +from rekcurd_client.protobuf import rekcurd_pb2 from . import _client_application -target_service = drucker_pb2.DESCRIPTOR.services_by_name['DruckerWorker'] +target_service = rekcurd_pb2.DESCRIPTOR.services_by_name['RekcurdWorker'] -class DruckerWorkerClientTest(unittest.TestCase): +class RekcurdWorkerClientTest(unittest.TestCase): def setUp(self): self._client_execution_thread_pool = logging_pool.pool(1) self._fake_time = grpc_testing.strict_fake_time(time.time()) self._real_time = grpc_testing.strict_real_time() self._fake_time_channel = grpc_testing.channel( - drucker_pb2.DESCRIPTOR.services_by_name.values(), self._fake_time) + rekcurd_pb2.DESCRIPTOR.services_by_name.values(), self._fake_time) self._real_time_channel = grpc_testing.channel( - drucker_pb2.DESCRIPTOR.services_by_name.values(), self._real_time) + rekcurd_pb2.DESCRIPTOR.services_by_name.values(), self._real_time) def tearDown(self): self._client_execution_thread_pool.shutdown(wait=True) @@ -38,7 +38,7 @@ def test_metadata(self): grpc.StatusCode.OK, '') application_return_value = application_future.result() - self.assertEqual(invocation_metadata[0], ('x-rekcurd-application-name', 'drucker-sample')) + self.assertEqual(invocation_metadata[0], ('x-rekcurd-application-name', 'rekcurd-sample')) self.assertEqual(invocation_metadata[1], ('x-rekcurd-sevice-level', 'development')) def test_String_String(self): diff --git a/test/test_worker_client_e2e.py b/test/test_worker_client_e2e.py index 906d350..b64e25c 100644 --- a/test/test_worker_client_e2e.py +++ b/test/test_worker_client_e2e.py @@ -2,13 +2,13 @@ from concurrent import futures from . import * -from drucker_client.protobuf import drucker_pb2_grpc +from rekcurd_client.protobuf import rekcurd_pb2_grpc import unittest from functools import wraps from unittest.mock import patch, Mock -from drucker.utils import PredictResult -import drucker_client.drucker_worker_client +from rekcurd.utils import PredictResult +import rekcurd_client.rekcurd_worker_client def patch_predictor(input_type, output_type): @@ -17,11 +17,11 @@ def patch_predictor(input_type, output_type): """ _prediction_value_map = { - Type.STRING: PredictResult('Drucker', 1.0, option={}), + Type.STRING: PredictResult('Rekcurd', 1.0, option={}), Type.BYTES: PredictResult(b'\x8f\xfa;\xc8a\xa3T%', 1.0, option={}), Type.ARRAY_INT: PredictResult([2, 3, 5, 7], [1.0, 1.0, 1.0, 1.0], option={}), Type.ARRAY_FLOAT: PredictResult([0.78341155, 0.03166816, 0.92745938], [1.0, 1.0, 1.0], option={}), - Type.ARRAY_STRING: PredictResult(['Drucker', 'is', 'awesome'], [1.0, 1.0, 1.0], option={}), + Type.ARRAY_STRING: PredictResult(['Rekcurd', 'is', 'awesome'], [1.0, 1.0, 1.0], option={}), } def test_method(func): @@ -39,11 +39,11 @@ def inner_method(*args, **kwargs): return test_method -class DruckerWorkerClientTestE2E(unittest.TestCase): - """Tests for DruckerWorkerClient. This test is e2e test between rekcurd-python and python-client.""" +class RekcurdWorkerClientTestE2E(unittest.TestCase): + """Tests for RekcurdWorkerClient. This test is e2e test between rekcurd-python and python-client.""" def fake_string_input(self): - return 'Drucker' + return 'Rekcurd' def fake_bytes_input(self): return b'u\x95jD\x0c\xf4\xf4{\xa6\xd7' @@ -56,7 +56,7 @@ def fake_arrfloat_input(self): 0.3863864, 0.33985784] def fake_arrstring_input(self): - return ['Drucker', 'is', 'great'] + return ['Rekcurd', 'is', 'great'] def assertStringResponse(self, response): self.assertEqual(response.__class__.__name__, "StringOutput") @@ -80,14 +80,14 @@ def assertArrStringResponse(self, response): @classmethod def setUpClass(cls): server = grpc.server(futures.ThreadPoolExecutor(max_workers=1)) - drucker_pb2_grpc.add_DruckerWorkerServicer_to_server( - drucker.drucker_worker_servicer.DruckerWorkerServicer( + rekcurd_pb2_grpc.add_RekcurdWorkerServicer_to_server( + rekcurd.rekcurd_worker_servicer.RekcurdWorkerServicer( logger=service_logger, app=app), server) server.add_insecure_port("[::]:5000") server.start() cls.server = server - cls.client = drucker_client.drucker_worker_client.DruckerWorkerClient(logger=client_logger, host='127.0.0.1:5000') + cls.client = rekcurd_client.rekcurd_worker_client.RekcurdWorkerClient(logger=client_logger, host='127.0.0.1:5000') @classmethod def tearDownClass(cls): From 63461b4a20475a44b447bf8d9c06756b21ebcae9 Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Mon, 4 Feb 2019 09:43:42 +0900 Subject: [PATCH 5/8] Update dependency --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8d22616..3e20363 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -rekcurd>=0.4.0,<0.5.0 +rekcurd>=0.5.0a0,<0.6.0 coverage>=4.0.3 nose>=1.3.7 pytest From fa8dc7fe21d1c1f8510172ccb3c8a8f42bb328dc Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Mon, 4 Feb 2019 10:01:09 +0900 Subject: [PATCH 6/8] Fix minor --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3d58b3d..4c957f9 100644 --- a/setup.py +++ b/setup.py @@ -61,8 +61,8 @@ install_requires=REQUIRES, tests_require=TESTS_REQUIRES, extras_require=EXTRAS, - packages=['rekcurd_client', 'drucker_client.logger', - 'drucker_client.protobuf'], + packages=['rekcurd_client', 'rekcurd_client.logger', + 'rekcurd_client.protobuf'], include_package_data=True, long_description=LONG_DESCRIPTION, classifiers=[ From 36004d88fc00c44c6dd6aa36d9943593e0dfc4be Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Mon, 4 Feb 2019 10:09:41 +0900 Subject: [PATCH 7/8] Fix minor --- README.md | 16 ++++++++-------- tox.ini | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 818e0fe..b0bb739 100644 --- a/README.md +++ b/README.md @@ -37,12 +37,12 @@ pip install rekcurd_client Example code is available [here](./example/sample.py). ```python -from drucker_client import DruckerWorkerClient -from drucker_client.logger import logger +from rekcurd_client import RekcurdWorkerClient +from rekcurd_client.logger import logger host = 'localhost:5000' -client = DruckerWorkerClient(logger=logger, host=host) +client = RekcurdWorkerClient(logger=logger, host=host) input = [0,0,0,1,11,0,0,0,0,0, 0,7,8,0,0,0,0,0,1,13, @@ -57,14 +57,14 @@ response = client.run_predict_arrint_arrint(input) When you use Kubernetes and deploy Rekcurd service via Rekcurd dashboard, you can access your Rekcurd service like the below. ```python -from drucker_client import DruckerWorkerClient -from drucker_client.logger import logger +from rekcurd_client import RekcurdWorkerClient +from rekcurd_client.logger import logger domain = 'example.com' -app = 'drucker-sample' +app = 'rekcurd-sample' env = 'development' -client = DruckerWorkerClient(logger=logger, domain=domain, app=app, env=env) +client = RekcurdWorkerClient(logger=logger, domain=domain, app=app, env=env) input = [0,0,0,1,11,0,0,0,0,0, 0,7,8,0,0,0,0,0,1,13, @@ -76,7 +76,7 @@ input = [0,0,0,1,11,0,0,0,0,0, response = client.run_predict_arrint_arrint(input) ``` -### DruckerWorkerClient +### RekcurdWorkerClient You need to use an appropriate method for your Rekcurd service. The methods are generated according to the input and output formats. *V* is the length of feature vector. *M* is the number of classes. If your algorithm is a binary classifier, you set *M* to 1. If your algorithm is a multi-class classifier, you set *M* to the number of classes. |method |input: data
(required) |input: option |output: label
(required) |output: score
(required) |output: option | diff --git a/tox.ini b/tox.ini index 0af9a97..7f72ebe 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ commands = [testenv:coverage] commands = python -V - nosetests --with-coverage --cover-package=drucker_client --cover-tests + nosetests --with-coverage --cover-package=rekcurd_client --cover-tests [testenv:codecov] commands = From 5cbb9049b4cbc980bbb061fbc6742a69d99baeb0 Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Tue, 5 Feb 2019 11:11:20 +0900 Subject: [PATCH 8/8] Install `rekcurd` alpha version --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 3e20363..0fa48c2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -rekcurd>=0.5.0a0,<0.6.0 +rekcurd>=0.5.0a0,<0.5.0a100 coverage>=4.0.3 nose>=1.3.7 pytest