ispras / clouni

Cloud Unifier Tool for Service Orchestration
Apache License 2.0
5 stars 8 forks source link

Grpc #12

Closed Winking-maniac closed 3 years ago

Winking-maniac commented 3 years ago

Added gRPC support:

  1. Developed ClouniAPI version 1.0
  2. Implemented clouni-server based on API
  3. Edited shell.py in order to follow DRY concept
  4. Edited setup.py & setup.cfg in order to install clouni-server as CLI-command and toscatranslator as python module
  5. Added chapter in README & fix some inaccuracies
bura2017 commented 3 years ago

Hello,

  1. Very good launch of server from client, also required --host parameter along with --port
  2. File shell.py should not be used as entry point for gRPC server, please, use function translate from toscatranslator.common.translator_to_configuration_dsl
  3. Scripts api_pb2 and api_pb2_grpc are doubled in root and toscatranslator directory
  4. Combine all grpc aware scripts in one directory in root, not in toscatranslator directory
  5. Testing is missing, I can't check for sure if grpc is working
Winking-maniac commented 3 years ago
  1. Small modification of serve and parse_args ~ 15 min
  2. Restore shell.py and write my own function to execute the response ~2 hours
  3. Delete 2 files ~ 15 sec
  4. Minor fix of import dependencies and setup config ~ 20 min
  5. Creating client and some tests ~ 3 hours
Winking-maniac commented 3 years ago

Only testing remains

bura2017 commented 3 years ago

После установки зависимостей (pip install -r requirements.txt) и установки python setup.py install команда clouni-server --help выдаёт следующее Traceback (most recent call last): File "/home/user/virt-env/clouni-server/bin/clouni-server", line 33, in sys.exit(load_entry_point('clouni==0.0.1', 'console_scripts', 'clouni-server')()) File "/home/user/virt-env/clouni-server/bin/clouni-server", line 25, in importlib_load_entry_point return next(matches).load() File "/home/user/virt-env/clouni-server/lib/python3.6/site-packages/importlib_metadata/init.py", line 166, in load module = import_module(match.group('module')) File "/home/user/virt-env/clouni-server/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/home/user/virt-env/clouni-server/lib/python3.6/site-packages/clouni-0.0.1-py3.6.egg/grpc_clouni/clouni_server.py", line 1, in from grpc_clouni.api_pb2 import ClouniResponse, ClouniRequest File "/home/user/virt-env/clouni-server/lib/python3.6/site-packages/clouni-0.0.1-py3.6.egg/grpc_clouni/api_pb2.py", line 5, in from google.protobuf import descriptor as _descriptor ModuleNotFoundError: No module named 'google'

Надо добавить необходимые зависимости вместе с версиями в requirements.txt (методом проб и ошибок выяснила что нужны protobuf и grpcio, всё ещё нужны версии и проверь другие зависимости)

bura2017 commented 3 years ago

Также нужно обновить README clouni-server --help и добавить туда пример запуска команды При это при выполнении @clouni-server --host 127.0.0.1@ он просто виснет, так не должно быть, он должен запускаться фоном и при этом выдавать на экран хотя бы "Clouni gRPC server successfully started"

bura2017 commented 3 years ago

Всё ещё нет тестов, или примеров использования grpc client с сервером в README