qwak-sdk 0.1.0__py3-none-any.whl → 0.2.21rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qwak-sdk might be problematic. Click here for more details.

Files changed (305) hide show
  1. qwak_sdk/__init__.py +9 -0
  2. qwak_sdk/cli.py +51 -0
  3. qwak_sdk/commands/admin/__init__.py +0 -0
  4. qwak_sdk/commands/admin/admin_commands_group.py +17 -0
  5. qwak_sdk/commands/admin/apikeys/__init__.py +0 -0
  6. qwak_sdk/commands/admin/apikeys/api_keys_commands_group.py +17 -0
  7. qwak_sdk/commands/admin/apikeys/generate/__init__.py +0 -0
  8. qwak_sdk/commands/admin/apikeys/generate/_logic.py +21 -0
  9. qwak_sdk/commands/admin/apikeys/generate/ui.py +45 -0
  10. qwak_sdk/commands/admin/apikeys/revoke/__init__.py +0 -0
  11. qwak_sdk/commands/admin/apikeys/revoke/_logic.py +22 -0
  12. qwak_sdk/commands/admin/apikeys/revoke/ui.py +31 -0
  13. qwak_sdk/commands/audience/__init__.py +0 -0
  14. qwak_sdk/commands/audience/_logic/__init__.py +0 -0
  15. qwak_sdk/commands/audience/_logic/config/__init__.py +0 -0
  16. qwak_sdk/commands/audience/_logic/config/config_base.py +16 -0
  17. qwak_sdk/commands/audience/_logic/config/parser.py +28 -0
  18. qwak_sdk/commands/audience/_logic/config/v1/__init__.py +0 -0
  19. qwak_sdk/commands/audience/_logic/config/v1/audience_config.py +26 -0
  20. qwak_sdk/commands/audience/_logic/config/v1/conditions_config.py +60 -0
  21. qwak_sdk/commands/audience/_logic/config/v1/config_v1.py +24 -0
  22. qwak_sdk/commands/audience/_logic/config/v1/route_config.py +14 -0
  23. qwak_sdk/commands/audience/_logic/config/v1/spec.py +11 -0
  24. qwak_sdk/commands/auto_scalling/__init__.py +0 -0
  25. qwak_sdk/commands/auto_scalling/_logic/__init__.py +0 -0
  26. qwak_sdk/commands/auto_scalling/_logic/config/__init__.py +3 -0
  27. qwak_sdk/commands/auto_scalling/_logic/config/config.py +100 -0
  28. qwak_sdk/commands/auto_scalling/_logic/config/parser.py +21 -0
  29. qwak_sdk/commands/auto_scalling/attach/__init__.py +0 -0
  30. qwak_sdk/commands/auto_scalling/attach/_logic.py +43 -0
  31. qwak_sdk/commands/auto_scalling/attach/ui.py +21 -0
  32. qwak_sdk/commands/auto_scalling/autoscaling_commands_group.py +15 -0
  33. qwak_sdk/commands/automations/__init__.py +0 -0
  34. qwak_sdk/commands/automations/automations_commands_group.py +30 -0
  35. qwak_sdk/commands/automations/delete/__init__.py +0 -0
  36. qwak_sdk/commands/automations/delete/_logic.py +6 -0
  37. qwak_sdk/commands/automations/delete/ui.py +23 -0
  38. qwak_sdk/commands/automations/executions/__init__.py +0 -0
  39. qwak_sdk/commands/automations/executions/executions_commands_group.py +14 -0
  40. qwak_sdk/commands/automations/executions/list/__init__.py +0 -0
  41. qwak_sdk/commands/automations/executions/list/_logic.py +8 -0
  42. qwak_sdk/commands/automations/executions/list/ui.py +25 -0
  43. qwak_sdk/commands/automations/list/__init__.py +0 -0
  44. qwak_sdk/commands/automations/list/_logic.py +8 -0
  45. qwak_sdk/commands/automations/list/ui.py +21 -0
  46. qwak_sdk/commands/automations/register/__init__.py +0 -0
  47. qwak_sdk/commands/automations/register/_logic.py +43 -0
  48. qwak_sdk/commands/automations/register/ui.py +44 -0
  49. qwak_sdk/commands/feature_store/__init__.py +0 -0
  50. qwak_sdk/commands/feature_store/delete/__init__.py +0 -0
  51. qwak_sdk/commands/feature_store/delete/_logic.py +52 -0
  52. qwak_sdk/commands/feature_store/delete/ui.py +40 -0
  53. qwak_sdk/commands/feature_store/feature_store_command_group.py +25 -0
  54. qwak_sdk/commands/feature_store/list/__init__.py +0 -0
  55. qwak_sdk/commands/feature_store/list/ui.py +140 -0
  56. qwak_sdk/commands/feature_store/pause/__init__.py +0 -0
  57. qwak_sdk/commands/feature_store/pause/ui.py +18 -0
  58. qwak_sdk/commands/feature_store/register/__init__.py +0 -0
  59. qwak_sdk/commands/feature_store/register/_logic.py +289 -0
  60. qwak_sdk/commands/feature_store/register/ui.py +105 -0
  61. qwak_sdk/commands/feature_store/resume/__init__.py +0 -0
  62. qwak_sdk/commands/feature_store/resume/ui.py +18 -0
  63. qwak_sdk/commands/feature_store/trigger/__init__.py +0 -0
  64. qwak_sdk/commands/feature_store/trigger/ui.py +32 -0
  65. qwak_sdk/commands/models/__init__.py +0 -0
  66. qwak_sdk/commands/models/_logic/__init__.py +0 -0
  67. qwak_sdk/commands/models/_logic/variations.py +55 -0
  68. qwak_sdk/commands/models/build/__init__.py +0 -0
  69. qwak_sdk/commands/models/build/_logic/__init__.py +0 -0
  70. qwak_sdk/commands/models/build/_logic/build_steps.py +68 -0
  71. qwak_sdk/commands/models/build/_logic/client_logs/__init__.py +0 -0
  72. qwak_sdk/commands/models/build/_logic/client_logs/build_run_handlers.py +189 -0
  73. qwak_sdk/commands/models/build/_logic/client_logs/cli_ui.py +125 -0
  74. qwak_sdk/commands/models/build/_logic/client_logs/logger.py +88 -0
  75. qwak_sdk/commands/models/build/_logic/client_logs/messages.py +40 -0
  76. qwak_sdk/commands/models/build/_logic/client_logs/notifier_impl.py +49 -0
  77. qwak_sdk/commands/models/build/_logic/client_logs/spinner.py +14 -0
  78. qwak_sdk/commands/models/build/_logic/client_logs/time_source.py +37 -0
  79. qwak_sdk/commands/models/build/_logic/client_logs/utils.py +12 -0
  80. qwak_sdk/commands/models/build/_logic/config/config_v1.py +253 -0
  81. qwak_sdk/commands/models/build/_logic/constant/host_resource.py +4 -0
  82. qwak_sdk/commands/models/build/_logic/constant/step_description.py +29 -0
  83. qwak_sdk/commands/models/build/_logic/constant/temp_dir.py +2 -0
  84. qwak_sdk/commands/models/build/_logic/constant/upload_tag.py +5 -0
  85. qwak_sdk/commands/models/build/_logic/context.py +62 -0
  86. qwak_sdk/commands/models/build/_logic/interface/__init__.py +0 -0
  87. qwak_sdk/commands/models/build/_logic/interface/notifier_interface.py +29 -0
  88. qwak_sdk/commands/models/build/_logic/interface/step_inteface.py +29 -0
  89. qwak_sdk/commands/models/build/_logic/phase/__init__.py +0 -0
  90. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/__init__.py +14 -0
  91. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/__init__.py +0 -0
  92. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_model_step.py +42 -0
  93. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/__init__.py +0 -0
  94. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/common.py +33 -0
  95. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/fetch_strategy_manager.py +60 -0
  96. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/__init__.py +0 -0
  97. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/folder/__init__.py +0 -0
  98. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/folder/folder_strategy.py +73 -0
  99. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/git/__init__.py +0 -0
  100. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/git/git_strategy.py +149 -0
  101. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/strategy.py +69 -0
  102. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/zip/__init__.py +0 -0
  103. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/zip/zip_strategy.py +64 -0
  104. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/post_fetch_validation_step.py +117 -0
  105. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/pre_fetch_validation_step.py +135 -0
  106. qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/__init__.py +11 -0
  107. qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/cleanup_step.py +20 -0
  108. qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/start_remote_build_step.py +42 -0
  109. qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/upload_step.py +349 -0
  110. qwak_sdk/commands/models/build/_logic/phase/c_deploy/__init__.py +6 -0
  111. qwak_sdk/commands/models/build/_logic/phase/c_deploy/build_polling_status.py +54 -0
  112. qwak_sdk/commands/models/build/_logic/phase/c_deploy/deploy_build.py +44 -0
  113. qwak_sdk/commands/models/build/_logic/util/__init__.py +0 -0
  114. qwak_sdk/commands/models/build/_logic/util/protobuf_factory.py +45 -0
  115. qwak_sdk/commands/models/build/_logic/util/step_decorator.py +37 -0
  116. qwak_sdk/commands/models/build/_logic/util/text.py +9 -0
  117. qwak_sdk/commands/models/build/ui.py +241 -0
  118. qwak_sdk/commands/models/builds/__init__.py +0 -0
  119. qwak_sdk/commands/models/builds/builds_commands_group.py +16 -0
  120. qwak_sdk/commands/models/builds/cancel/__init__.py +0 -0
  121. qwak_sdk/commands/models/builds/cancel/_logic.py +5 -0
  122. qwak_sdk/commands/models/builds/cancel/ui.py +15 -0
  123. qwak_sdk/commands/models/builds/logs/__init__.py +0 -0
  124. qwak_sdk/commands/models/builds/logs/ui.py +35 -0
  125. qwak_sdk/commands/models/builds/status/__init__.py +0 -0
  126. qwak_sdk/commands/models/builds/status/_logic.py +6 -0
  127. qwak_sdk/commands/models/builds/status/ui.py +30 -0
  128. qwak_sdk/commands/models/create/__init__.py +0 -0
  129. qwak_sdk/commands/models/create/_logic.py +35 -0
  130. qwak_sdk/commands/models/create/ui.py +27 -0
  131. qwak_sdk/commands/models/delete/__init__.py +0 -0
  132. qwak_sdk/commands/models/delete/_logic.py +5 -0
  133. qwak_sdk/commands/models/delete/ui.py +16 -0
  134. qwak_sdk/commands/models/deployments/__init__.py +0 -0
  135. qwak_sdk/commands/models/deployments/deploy/__init__.py +0 -0
  136. qwak_sdk/commands/models/deployments/deploy/_logic/__init__.py +0 -0
  137. qwak_sdk/commands/models/deployments/deploy/_logic/advance_deployment_options_handler.py +31 -0
  138. qwak_sdk/commands/models/deployments/deploy/_logic/base_deploy_executor.py +64 -0
  139. qwak_sdk/commands/models/deployments/deploy/_logic/deploy_config.py +241 -0
  140. qwak_sdk/commands/models/deployments/deploy/_logic/deployment.py +405 -0
  141. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_message_helpers.py +98 -0
  142. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_response_handler.py +154 -0
  143. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_size_mapper.py +21 -0
  144. qwak_sdk/commands/models/deployments/deploy/_logic/get_latest_successful_build.py +31 -0
  145. qwak_sdk/commands/models/deployments/deploy/_logic/variations.py +79 -0
  146. qwak_sdk/commands/models/deployments/deploy/batch/__init__.py +0 -0
  147. qwak_sdk/commands/models/deployments/deploy/batch/_logic/__init__.py +0 -0
  148. qwak_sdk/commands/models/deployments/deploy/batch/_logic/advanced_deployment_mapper.py +14 -0
  149. qwak_sdk/commands/models/deployments/deploy/batch/_logic/deploy_executor.py +24 -0
  150. qwak_sdk/commands/models/deployments/deploy/batch/ui.py +104 -0
  151. qwak_sdk/commands/models/deployments/deploy/deploy_commands_group.py +19 -0
  152. qwak_sdk/commands/models/deployments/deploy/realtime/__init__.py +0 -0
  153. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/__init__.py +0 -0
  154. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/advanced_deployment_mapper.py +20 -0
  155. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/deploy_executor.py +24 -0
  156. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py +105 -0
  157. qwak_sdk/commands/models/deployments/deploy/realtime/ui.py +179 -0
  158. qwak_sdk/commands/models/deployments/deploy/streaming/__init__.py +0 -0
  159. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/__init__.py +0 -0
  160. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/deploy_executor.py +24 -0
  161. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/serving_strategy_mapper.py +38 -0
  162. qwak_sdk/commands/models/deployments/deploy/streaming/ui.py +196 -0
  163. qwak_sdk/commands/models/deployments/undeploy/__init__.py +0 -0
  164. qwak_sdk/commands/models/deployments/undeploy/_logic/__init__.py +0 -0
  165. qwak_sdk/commands/models/deployments/undeploy/_logic/request_undeploy.py +176 -0
  166. qwak_sdk/commands/models/deployments/undeploy/_logic/variations.py +74 -0
  167. qwak_sdk/commands/models/deployments/undeploy/ui.py +78 -0
  168. qwak_sdk/commands/models/executions/__init__.py +0 -0
  169. qwak_sdk/commands/models/executions/cancel/__init__.py +0 -0
  170. qwak_sdk/commands/models/executions/cancel/_logic.py +9 -0
  171. qwak_sdk/commands/models/executions/cancel/ui.py +27 -0
  172. qwak_sdk/commands/models/executions/execution_commands_group.py +24 -0
  173. qwak_sdk/commands/models/executions/report/__init__.py +0 -0
  174. qwak_sdk/commands/models/executions/report/_logic.py +14 -0
  175. qwak_sdk/commands/models/executions/report/ui.py +43 -0
  176. qwak_sdk/commands/models/executions/start/__init__.py +0 -0
  177. qwak_sdk/commands/models/executions/start/_logic.py +16 -0
  178. qwak_sdk/commands/models/executions/start/ui.py +176 -0
  179. qwak_sdk/commands/models/executions/status/__init__.py +0 -0
  180. qwak_sdk/commands/models/executions/status/_logic.py +13 -0
  181. qwak_sdk/commands/models/executions/status/ui.py +27 -0
  182. qwak_sdk/commands/models/init/__init__.py +0 -0
  183. qwak_sdk/commands/models/init/_logic/__init__.py +0 -0
  184. qwak_sdk/commands/models/init/_logic/initialize_model_structure.py +40 -0
  185. qwak_sdk/commands/models/init/_logic/template/__init__.py +0 -0
  186. qwak_sdk/commands/models/init/_logic/template/churn/__init__.py +0 -0
  187. qwak_sdk/commands/models/init/_logic/template/churn/cookiecutter.json +3 -0
  188. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/__init__.py +0 -0
  189. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  190. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
  191. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  192. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/model.py +95 -0
  193. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  194. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  195. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/test_churn.py +32 -0
  196. qwak_sdk/commands/models/init/_logic/template/credit_risk/__init__.py +0 -0
  197. qwak_sdk/commands/models/init/_logic/template/credit_risk/cookiecutter.json +3 -0
  198. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/__init__.py +0 -0
  199. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  200. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
  201. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  202. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py +108 -0
  203. qwak_sdk/commands/models/init/_logic/template/general/__init__.py +0 -0
  204. qwak_sdk/commands/models/init/_logic/template/general/cookiecutter.json +6 -0
  205. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py +0 -0
  206. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py +5 -0
  207. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml +8 -0
  208. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/model.py +66 -0
  209. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/__init__.py +0 -0
  210. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/test_qwak_model.py +5 -0
  211. qwak_sdk/commands/models/init/_logic/template/titanic/__init__.py +0 -0
  212. qwak_sdk/commands/models/init/_logic/template/titanic/cookiecutter.json +3 -0
  213. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/__init__.py +0 -0
  214. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  215. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
  216. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/model.py +98 -0
  217. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  218. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  219. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +24 -0
  220. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/__init__.py +0 -0
  221. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/cookiecutter.json +3 -0
  222. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/__init__.py +0 -0
  223. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  224. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/model.py +98 -0
  225. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/pyproject.toml +18 -0
  226. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  227. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  228. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +25 -0
  229. qwak_sdk/commands/models/init/ui.py +61 -0
  230. qwak_sdk/commands/models/list/__init__.py +0 -0
  231. qwak_sdk/commands/models/list/_logic.py +5 -0
  232. qwak_sdk/commands/models/list/ui.py +31 -0
  233. qwak_sdk/commands/models/models_command_group.py +36 -0
  234. qwak_sdk/commands/models/runtime/__init__.py +0 -0
  235. qwak_sdk/commands/models/runtime/feedback/__init__.py +0 -0
  236. qwak_sdk/commands/models/runtime/feedback/_logic.py +81 -0
  237. qwak_sdk/commands/models/runtime/feedback/ui.py +45 -0
  238. qwak_sdk/commands/models/runtime/logs/__init__.py +0 -0
  239. qwak_sdk/commands/models/runtime/logs/ui.py +63 -0
  240. qwak_sdk/commands/models/runtime/runtime_commands_group.py +21 -0
  241. qwak_sdk/commands/models/runtime/traffic_update/__init__.py +0 -0
  242. qwak_sdk/commands/models/runtime/traffic_update/_logic/__init__.py +0 -0
  243. qwak_sdk/commands/models/runtime/traffic_update/_logic/execute_runtime_update_traffic.py +54 -0
  244. qwak_sdk/commands/models/runtime/traffic_update/_logic/variations.py +84 -0
  245. qwak_sdk/commands/models/runtime/traffic_update/ui.py +37 -0
  246. qwak_sdk/commands/models/runtime/update/__init__.py +0 -0
  247. qwak_sdk/commands/models/runtime/update/_logic.py +9 -0
  248. qwak_sdk/commands/models/runtime/update/ui.py +15 -0
  249. qwak_sdk/commands/projects/__init__.py +0 -0
  250. qwak_sdk/commands/projects/create/__init__.py +0 -0
  251. qwak_sdk/commands/projects/create/_logic.py +6 -0
  252. qwak_sdk/commands/projects/create/ui.py +21 -0
  253. qwak_sdk/commands/projects/delete/__init__.py +0 -0
  254. qwak_sdk/commands/projects/delete/_logic.py +6 -0
  255. qwak_sdk/commands/projects/delete/ui.py +15 -0
  256. qwak_sdk/commands/projects/list/__init__.py +0 -0
  257. qwak_sdk/commands/projects/list/_logic.py +6 -0
  258. qwak_sdk/commands/projects/list/ui.py +36 -0
  259. qwak_sdk/commands/projects/projects_command_group.py +19 -0
  260. qwak_sdk/commands/secrets/__init__.py +0 -0
  261. qwak_sdk/commands/secrets/delete/__init__.py +0 -0
  262. qwak_sdk/commands/secrets/delete/_logic.py +5 -0
  263. qwak_sdk/commands/secrets/delete/ui.py +21 -0
  264. qwak_sdk/commands/secrets/get/__init__.py +0 -0
  265. qwak_sdk/commands/secrets/get/_logic.py +5 -0
  266. qwak_sdk/commands/secrets/get/ui.py +17 -0
  267. qwak_sdk/commands/secrets/secrets_commands_group.py +19 -0
  268. qwak_sdk/commands/secrets/set/__init__.py +0 -0
  269. qwak_sdk/commands/secrets/set/_logic.py +5 -0
  270. qwak_sdk/commands/secrets/set/ui.py +16 -0
  271. qwak_sdk/commands/ui_tools.py +18 -0
  272. qwak_sdk/common/__init__.py +0 -0
  273. qwak_sdk/common/run_config/__init__.py +22 -0
  274. qwak_sdk/common/run_config/base.py +101 -0
  275. qwak_sdk/common/run_config/utils.py +249 -0
  276. qwak_sdk/exceptions/__init__.py +11 -0
  277. qwak_sdk/exceptions/qwak_command_exception.py +2 -0
  278. qwak_sdk/exceptions/qwak_deploy_new_build_failed.py +5 -0
  279. qwak_sdk/exceptions/qwak_general_build_exception.py +13 -0
  280. qwak_sdk/exceptions/qwak_remote_build_failed.py +5 -0
  281. qwak_sdk/exceptions/qwak_resource_not_found.py +2 -0
  282. qwak_sdk/exceptions/qwak_suggestion_exception.py +27 -0
  283. qwak_sdk/inner/__init__.py +0 -0
  284. qwak_sdk/inner/file_registry.py +97 -0
  285. qwak_sdk/inner/tools/__init__.py +0 -0
  286. qwak_sdk/inner/tools/cli_tools.py +159 -0
  287. qwak_sdk/inner/tools/config_handler.py +18 -0
  288. qwak_sdk/inner/tools/logger/__init__.py +3 -0
  289. qwak_sdk/inner/tools/logger/logger.py +269 -0
  290. qwak_sdk/inner/tools/logger/logging.yml +79 -0
  291. qwak_sdk/inner/tools/tracking.py +47 -0
  292. qwak_sdk/main.py +9 -0
  293. qwak_sdk/tools/__init__.py +0 -0
  294. qwak_sdk/tools/colors.py +13 -0
  295. qwak_sdk/tools/files.py +9 -0
  296. qwak_sdk/tools/log_handling.py +146 -0
  297. qwak_sdk/tools/utils.py +46 -0
  298. qwak_sdk-0.2.21rc0.dist-info/METADATA +42 -0
  299. qwak_sdk-0.2.21rc0.dist-info/RECORD +302 -0
  300. {qwak_sdk-0.1.0.dist-info → qwak_sdk-0.2.21rc0.dist-info}/WHEEL +1 -2
  301. qwak_sdk-0.2.21rc0.dist-info/entry_points.txt +3 -0
  302. qwak_sdk-0.1.0.dist-info/METADATA +0 -19
  303. qwak_sdk-0.1.0.dist-info/RECORD +0 -5
  304. qwak_sdk-0.1.0.dist-info/top_level.txt +0 -1
  305. {qwak-sdk → qwak_sdk/commands}/__init__.py +0 -0
@@ -0,0 +1,36 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.auto_scalling.autoscaling_commands_group import (
4
+ autoscaling_commands_group,
5
+ )
6
+
7
+ from .build.ui import models_build
8
+ from .builds.builds_commands_group import builds_commands_group
9
+ from .create.ui import model_create
10
+ from .delete.ui import model_delete
11
+ from .deployments.deploy.deploy_commands_group import deploy_group
12
+ from .deployments.undeploy.ui import models_undeploy
13
+ from .executions.execution_commands_group import execution_commands_group
14
+ from .init.ui import model_init
15
+ from .list.ui import model_list
16
+
17
+
18
+ @click.group(
19
+ name="models",
20
+ help="Commands for interacting with Qwak based models",
21
+ )
22
+ def models_command_group():
23
+ # Click group injection
24
+ pass
25
+
26
+
27
+ models_command_group.add_command(autoscaling_commands_group)
28
+ models_command_group.add_command(builds_commands_group)
29
+ models_command_group.add_command(execution_commands_group)
30
+ models_command_group.add_command(model_init)
31
+ models_command_group.add_command(model_create)
32
+ models_command_group.add_command(model_delete)
33
+ models_command_group.add_command(model_list)
34
+ models_command_group.add_command(models_build)
35
+ models_command_group.add_command(deploy_group, "deploy")
36
+ models_command_group.add_command(models_undeploy, "undeploy")
File without changes
File without changes
@@ -0,0 +1,81 @@
1
+ import os
2
+ from datetime import datetime
3
+
4
+ from _qwak_proto.qwak.inference.feedback.feedback_pb2 import (
5
+ Actuals,
6
+ ActualValuesRequest,
7
+ ConfigureFeedbackRequest,
8
+ Entity,
9
+ FeedbackConfig,
10
+ )
11
+ from _qwak_proto.qwak.inference.feedback.feedback_pb2_grpc import FeedbackServiceStub
12
+ from google.protobuf.internal.well_known_types import Timestamp
13
+ from qwak.inner.const import QwakConstants
14
+ from qwak.inner.di_configuration import UserAccountConfiguration
15
+ from qwak.inner.tool.grpc.grpc_tools import create_grpc_channel
16
+
17
+
18
+ class FeedbackClient(object):
19
+ def __init__(
20
+ self,
21
+ model_id=os.environ.get("QWAK_MODEL_ID"),
22
+ models_url_api=None,
23
+ enable_ssl=True,
24
+ enable_auth=True,
25
+ ):
26
+ self.account_config = UserAccountConfiguration(QwakConstants.QWAK_CONFIG_FILE)
27
+ self.model_id = model_id
28
+ self.models_url_api = (
29
+ models_url_api if models_url_api else self.account_config.get_models_api()
30
+ )
31
+ self.channel = create_grpc_channel(
32
+ url=self.models_url_api, enable_ssl=enable_ssl, enable_auth=enable_auth
33
+ )
34
+
35
+ def config(
36
+ self,
37
+ analytics_entity_column: str,
38
+ feedback_entity_column: str,
39
+ model_type: str,
40
+ feedback_config: list,
41
+ ):
42
+ feedbacks = []
43
+ for config in feedback_config:
44
+ config_map = config.split("=")
45
+ feedbacks.append(
46
+ FeedbackConfig(output_column=config_map[0], actual_tag=config_map[1])
47
+ )
48
+
49
+ feedback = FeedbackServiceStub(self.channel)
50
+ response = feedback.ConfigureFeedback(
51
+ ConfigureFeedbackRequest(
52
+ model_id=self.model_id,
53
+ analytics_entity_column=analytics_entity_column,
54
+ feedback_entity_column=feedback_entity_column,
55
+ feedback_config=feedbacks,
56
+ model_type=ConfigureFeedbackRequest.ModelType.Value(model_type.upper()),
57
+ )
58
+ )
59
+
60
+ return response
61
+
62
+ def actual(
63
+ self,
64
+ entity_name: str,
65
+ entity_value: str,
66
+ tag: str,
67
+ actuals: list,
68
+ timestamp: datetime = datetime.utcnow(),
69
+ ):
70
+ proto_timestamp = Timestamp()
71
+ proto_timestamp.FromDatetime(timestamp)
72
+ feedback = FeedbackServiceStub(self.channel)
73
+ feedback_response = feedback.PostFeedback(
74
+ ActualValuesRequest(
75
+ model_id=self.model_id,
76
+ entity=Entity(name=entity_name, value=entity_value),
77
+ actuals=Actuals(tag=tag, value=actuals),
78
+ timestamp=proto_timestamp,
79
+ )
80
+ )
81
+ return feedback_response
@@ -0,0 +1,45 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.runtime.feedback._logic import FeedbackClient
4
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
5
+
6
+
7
+ @click.command("feedback", cls=QwakCommand)
8
+ @click.option("--model-id", help="Model ID", required=True)
9
+ @click.option(
10
+ "--analytics-entity-column", required=True, help="Analytics entity column name"
11
+ )
12
+ @click.option(
13
+ "--feedback-entity-column", required=True, help="Feedback entity column name"
14
+ )
15
+ @click.option(
16
+ "--model-type",
17
+ required=True,
18
+ type=click.Choice(
19
+ ["binary_classification", "multiclass_classification", "regression"],
20
+ case_sensitive=True,
21
+ ),
22
+ help="""Model type. Options: binary_classification / multiclass_classification / regression""",
23
+ )
24
+ @click.option(
25
+ "--feedback-config",
26
+ help="Feedback configuration. analytics_output_column=actual_tag",
27
+ metavar="ANALYTICS_OUTPUT_COLUMN=ACTUAL_TAG",
28
+ multiple=True,
29
+ )
30
+ def runtime_feedback(
31
+ model_id,
32
+ analytics_entity_column,
33
+ feedback_entity_column,
34
+ model_type,
35
+ feedback_config,
36
+ **kwargs,
37
+ ):
38
+ feedback_client = FeedbackClient(model_id=model_id)
39
+ response = feedback_client.config(
40
+ analytics_entity_column=analytics_entity_column,
41
+ feedback_entity_column=feedback_entity_column,
42
+ model_type=model_type,
43
+ feedback_config=feedback_config,
44
+ )
45
+ print(response)
File without changes
@@ -0,0 +1,63 @@
1
+ import click
2
+
3
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
4
+ from qwak_sdk.tools.colors import Color
5
+ from qwak_sdk.tools.log_handling import QwakLogHandling
6
+
7
+
8
+ @click.command("logs", cls=QwakCommand)
9
+ @click.option("-f", "--follow", is_flag=True, default=False, help="Follow log tail")
10
+ @click.option(
11
+ "-d",
12
+ "--deployment-id",
13
+ required=False,
14
+ help="Runtime model Deployment ID to show logs of",
15
+ )
16
+ @click.option(
17
+ "-b",
18
+ "--build-id",
19
+ required=False,
20
+ help="Runtime model Build ID to show logs of",
21
+ )
22
+ @click.option(
23
+ "-s",
24
+ "--since",
25
+ required=False,
26
+ metavar="X [TYPE] ago",
27
+ help=f"Get logs from X1 [type] X2 [type]... Xn [type] ago. "
28
+ f"(x = INT; type = {QwakLogHandling.TIME_UNITS}) i.e. [1 day 2 hours ago]",
29
+ )
30
+ @click.option(
31
+ "-n",
32
+ "--number-of-results",
33
+ required=False,
34
+ type=int,
35
+ help="Maximum number of results per query",
36
+ )
37
+ @click.option(
38
+ "-g", "--grep", required=False, help="Filter by log content contains [expression]"
39
+ )
40
+ def runtime_logs(
41
+ follow=True,
42
+ deployment_id=None,
43
+ build_id=None,
44
+ since=None,
45
+ number_of_results=None,
46
+ grep=None,
47
+ **kwargs,
48
+ ):
49
+ if not deployment_id and not build_id:
50
+ print(
51
+ f"{Color.YELLOW}Please provide either a Deployment or a Build ID{Color.END}"
52
+ )
53
+ return
54
+
55
+ qwak_log_handling = QwakLogHandling()
56
+ qwak_log_handling.get_logs(
57
+ follow,
58
+ since,
59
+ number_of_results,
60
+ grep,
61
+ {"build_id": build_id, "deployment_id": deployment_id},
62
+ "runtime_model",
63
+ )
@@ -0,0 +1,21 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.runtime.feedback.ui import runtime_feedback
4
+ from qwak_sdk.commands.models.runtime.logs.ui import runtime_logs
5
+ from qwak_sdk.commands.models.runtime.traffic_update.ui import runtime_traffic_update
6
+ from qwak_sdk.commands.models.runtime.update.ui import runtime_update
7
+
8
+
9
+ @click.group(
10
+ name="runtime",
11
+ help="Runtime configurations for deployed models",
12
+ )
13
+ def runtime_commands_group():
14
+ # Click commands group injection
15
+ pass
16
+
17
+
18
+ runtime_commands_group.add_command(runtime_feedback)
19
+ runtime_commands_group.add_command(runtime_logs)
20
+ runtime_commands_group.add_command(runtime_traffic_update)
21
+ runtime_commands_group.add_command(runtime_update)
@@ -0,0 +1,54 @@
1
+ from typing import Tuple
2
+
3
+ from qwak.clients.administration.eco_system.client import EcosystemClient
4
+ from qwak.clients.deployment.client import DeploymentManagementClient
5
+
6
+ from qwak_sdk.commands.models._logic.variations import (
7
+ create_variation_from_variation_config,
8
+ )
9
+ from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
10
+ DeployConfig,
11
+ )
12
+ from qwak_sdk.commands.models.runtime.traffic_update._logic.variations import (
13
+ validate_requested_variations_against_existing_in_apply,
14
+ )
15
+ from qwak_sdk.inner.tools.config_handler import config_handler
16
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
17
+
18
+ logger = get_qwak_logger()
19
+
20
+
21
+ def execute_runtime_traffic_update(
22
+ model_id: str, from_file: str, environment_name: Tuple[str]
23
+ ):
24
+ deployment_client = DeploymentManagementClient()
25
+ ecosystem_client = EcosystemClient()
26
+ config: DeployConfig = config_handler(
27
+ config=DeployConfig,
28
+ from_file=from_file,
29
+ out_conf=False,
30
+ sections=("realtime",),
31
+ model_id=model_id,
32
+ )
33
+ requested_variations = list(
34
+ map(
35
+ create_variation_from_variation_config,
36
+ config.realtime.variations,
37
+ )
38
+ )
39
+ environment_names_to_details = ecosystem_client.get_environments_names_to_details(
40
+ environment_name if environment_name else config.realtime.environments
41
+ )
42
+ validate_requested_variations_against_existing_in_apply(
43
+ model_id,
44
+ requested_variations,
45
+ environment_names_to_details,
46
+ deployment_client,
47
+ )
48
+ environment_ids = [env.id for env in environment_names_to_details.values()]
49
+
50
+ deployment_client.apply_model_traffic_config(
51
+ model_id=model_id,
52
+ requested_variations=requested_variations,
53
+ environment_ids=environment_ids,
54
+ )
@@ -0,0 +1,84 @@
1
+ from typing import Dict, List, Optional
2
+
3
+ from _qwak_proto.qwak.deployment.deployment_pb2 import (
4
+ EnvironmentTrafficMessage,
5
+ Variation,
6
+ )
7
+ from _qwak_proto.qwak.ecosystem.v0.ecosystem_pb2 import EnvironmentDetails
8
+ from qwak.clients.deployment.client import DeploymentManagementClient
9
+ from qwak.exceptions import QwakException
10
+
11
+ from qwak_sdk.commands.models._logic.variations import (
12
+ validate_percentages,
13
+ validate_shadow_variation,
14
+ )
15
+
16
+
17
+ def validate_requested_variations_against_existing_in_apply(
18
+ model_id: str,
19
+ requested_variations: List[Variation],
20
+ environment_names_to_details: Dict[str, EnvironmentDetails],
21
+ deployment_client: DeploymentManagementClient,
22
+ ):
23
+ model_traffic = deployment_client.get_model_traffic_config(model_id)
24
+ environments_traffic = dict(model_traffic.environment_to_model_traffic)
25
+ errors = []
26
+ for env_name, env_details in environment_names_to_details.items():
27
+ error = validate_requested_variation_in_envs_for_apply(
28
+ env_details, environments_traffic, requested_variations
29
+ )
30
+ if error:
31
+ errors.append(error)
32
+ if errors:
33
+ raise QwakException("\n".join(errors))
34
+
35
+
36
+ def validate_requested_variation_in_envs_for_apply(
37
+ env_details: EnvironmentDetails,
38
+ environments_traffic: Dict[str, EnvironmentTrafficMessage],
39
+ requested_variations: List[Variation],
40
+ ) -> Optional[str]:
41
+ environment_traffic = environments_traffic.get(env_details.id)
42
+ existing_variations = environment_traffic.variations if environment_traffic else []
43
+ try:
44
+ validate_variation_for_apply(
45
+ existing_variations=existing_variations,
46
+ requested_variations=requested_variations,
47
+ )
48
+ except QwakException as e:
49
+ return e.message
50
+
51
+
52
+ def validate_variation_for_apply(
53
+ existing_variations: List[Variation],
54
+ requested_variations: List[Variation],
55
+ ):
56
+ requested_variations_names = set(
57
+ map(lambda variation: variation.name, requested_variations)
58
+ )
59
+ existing_variations_names = set(
60
+ map(lambda variation: variation.name, existing_variations)
61
+ )
62
+ ignored_variations = existing_variations_names.difference(
63
+ requested_variations_names
64
+ )
65
+ if ignored_variations:
66
+ raise QwakException(
67
+ f"The given variation configuration does not contain the configuration for the following "
68
+ f"variations {list(ignored_variations)}. You must include all the existing variations when updating the "
69
+ f"model traffic {list(existing_variations_names)}"
70
+ )
71
+
72
+ unexpected_variations = requested_variations_names.difference(
73
+ existing_variations_names
74
+ )
75
+
76
+ if unexpected_variations:
77
+ raise QwakException(
78
+ f"The given variation configuration contains the configuration for the following "
79
+ f"variations {list(unexpected_variations)} which are not expected. You must include only the existing "
80
+ f"variations when updating the model traffic {list(existing_variations_names)}"
81
+ )
82
+
83
+ validate_percentages(requested_variations)
84
+ validate_shadow_variation(requested_variations)
@@ -0,0 +1,37 @@
1
+ from typing import Tuple
2
+
3
+ import click
4
+ from qwak.exceptions import QwakException
5
+
6
+ from qwak_sdk.commands.models.runtime.traffic_update._logic.execute_runtime_update_traffic import (
7
+ execute_runtime_traffic_update,
8
+ )
9
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
10
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
11
+
12
+ logger = get_qwak_logger()
13
+
14
+
15
+ @click.command("traffic_update", cls=QwakCommand)
16
+ @click.option("-m", "--model-id", required=True, help="Model named ID")
17
+ @click.option(
18
+ "--environment-name",
19
+ required=False,
20
+ type=str,
21
+ help="Environments to deploy on (if not specified uses your default environment)",
22
+ multiple=True,
23
+ )
24
+ @click.option(
25
+ "--from-file",
26
+ required=True,
27
+ help="The variations config file path",
28
+ type=click.Path(exists=True, resolve_path=True, dir_okay=False),
29
+ )
30
+ def runtime_traffic_update(
31
+ model_id: str, from_file: str, environment_name: Tuple[str], **kwargs
32
+ ):
33
+ try:
34
+ execute_runtime_traffic_update(model_id, from_file, environment_name)
35
+ logger.info(f"Successfully updated traffic for models {model_id}")
36
+ except Exception as e:
37
+ raise QwakException(f'Failed to apply traffic configurations. Error is "{e}"')
File without changes
@@ -0,0 +1,9 @@
1
+ from qwak.clients.deployment.client import DeploymentManagementClient
2
+ from qwak.clients.model_management import ModelsManagementClient
3
+
4
+
5
+ def execute_runtime_update(model_id, log_level):
6
+ model_uuid = ModelsManagementClient().get_model_uuid(model_id)
7
+ DeploymentManagementClient().update_runtime_configurations(
8
+ model_id=model_id, model_uuid=model_uuid, log_level=log_level
9
+ )
@@ -0,0 +1,15 @@
1
+ import click
2
+ from qwak.exceptions import QwakException
3
+
4
+ from qwak_sdk.commands.models.runtime.update._logic import execute_runtime_update
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+
8
+ @click.command("update", cls=QwakCommand)
9
+ @click.option("-l", "--log-level", required=True, help="Log level to set.")
10
+ @click.option("-m", "--model-id", required=True, help="Model named ID")
11
+ def runtime_update(model_id, log_level, **kwargs):
12
+ try:
13
+ execute_runtime_update(model_id, log_level=log_level)
14
+ except Exception as e:
15
+ raise QwakException(f'Failed to update runtime configurations. Error is "{e}"')
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ from qwak.clients.project.client import ProjectsManagementClient
2
+
3
+
4
+ def execute(project_name: str, project_description: str):
5
+ projects_management = ProjectsManagementClient()
6
+ return projects_management.create_project(project_name, project_description)
@@ -0,0 +1,21 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.projects.create._logic import execute as execute_create
4
+ from qwak_sdk.commands.ui_tools import output_as_json
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+
8
+ @click.command("create", cls=QwakCommand)
9
+ @click.argument("name", metavar="name", required=True)
10
+ @click.option(
11
+ "--description",
12
+ metavar="DESCRIPTION",
13
+ required=False,
14
+ help="Project description",
15
+ )
16
+ def create_project(name, description, format: str = "text", *args, **kwargs):
17
+ response = execute_create(name, description)
18
+ if format == "json":
19
+ output_as_json(response)
20
+ else:
21
+ print(f"Project created\nproject id : {response.project.project_id}")
File without changes
@@ -0,0 +1,6 @@
1
+ from qwak.clients.project.client import ProjectsManagementClient
2
+
3
+
4
+ def execute(project_id):
5
+ projects_management = ProjectsManagementClient()
6
+ return projects_management.delete_project(project_id)
@@ -0,0 +1,15 @@
1
+ import click
2
+ from google.protobuf.json_format import MessageToJson
3
+
4
+ from qwak_sdk.commands.projects.delete._logic import execute as execute_delete
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+
8
+ @click.command("delete", cls=QwakCommand)
9
+ @click.option("--project-id", metavar="NAME", required=True, help="Project name")
10
+ def delete_project(project_id, **kwargs):
11
+ response = execute_delete(project_id)
12
+ if kwargs["format"] == "json":
13
+ print(MessageToJson(response))
14
+ else:
15
+ print(f"Project deleted\nproject id : {project_id}")
File without changes
@@ -0,0 +1,6 @@
1
+ from qwak.clients.project.client import ProjectsManagementClient
2
+
3
+
4
+ def execute():
5
+ projects_management = ProjectsManagementClient()
6
+ return projects_management.list_projects()
@@ -0,0 +1,36 @@
1
+ from datetime import datetime
2
+
3
+ import click
4
+
5
+ from qwak_sdk.commands.projects.list._logic import execute as execute_list
6
+ from qwak_sdk.commands.ui_tools import output_as_json, output_as_table
7
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
8
+
9
+
10
+ def parse_project(project):
11
+ return [
12
+ project.project_id,
13
+ project.project_name,
14
+ datetime.fromtimestamp(
15
+ project.created_at.seconds + project.created_at.nanos / 1e9
16
+ ).strftime("%A, %B %d, %Y %I:%M:%S"),
17
+ datetime.fromtimestamp(
18
+ project.last_modified_at.seconds + project.last_modified_at.nanos / 1e9
19
+ ).strftime("%A, %B %d, %Y %I:%M:%S"),
20
+ ]
21
+
22
+
23
+ @click.command("list", cls=QwakCommand)
24
+ def projects_list(format: str = "text", **kwargs):
25
+ projects_data = execute_list()
26
+ if format == "json":
27
+ output_as_json(projects_data)
28
+ elif format == "text":
29
+ columns = [
30
+ "Project id",
31
+ "Project name",
32
+ "Creation date",
33
+ "Last updated",
34
+ "Models count",
35
+ ]
36
+ output_as_table(projects_data.projects, parse_project, columns)
@@ -0,0 +1,19 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.projects.create.ui import create_project
4
+ from qwak_sdk.commands.projects.delete.ui import delete_project
5
+ from qwak_sdk.commands.projects.list.ui import projects_list
6
+
7
+
8
+ @click.group(
9
+ name="projects",
10
+ help="Commands for interacting with Qwak based project",
11
+ )
12
+ def projects_command_group():
13
+ # Intentionally left empty since this is how we inject this CLI to the general CLI group
14
+ pass
15
+
16
+
17
+ projects_command_group.add_command(create_project)
18
+ projects_command_group.add_command(projects_list)
19
+ projects_command_group.add_command(delete_project)
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ from qwak.clients.secret_service import SecretServiceClient
2
+
3
+
4
+ def execute_delete_secret(name):
5
+ SecretServiceClient().delete_secret(name)
@@ -0,0 +1,21 @@
1
+ import click
2
+ import grpc
3
+
4
+ from qwak_sdk.commands.secrets.delete._logic import execute_delete_secret
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+
8
+ @click.command("delete", cls=QwakCommand)
9
+ @click.option("--name", metavar="TEXT", required=True, help="The secret name")
10
+ def delete_secret(name, **kwargs):
11
+ print(f"Deleting secret named '{name}'")
12
+ try:
13
+ execute_delete_secret(name)
14
+ print(f"Secret '{name}' has been deleted")
15
+ except grpc.RpcError as e:
16
+ if e.code() == grpc.StatusCode.NOT_FOUND:
17
+ print(f"Secret '{name}' does not exist")
18
+ else:
19
+ print(f"Error deleting secret. Error is {e}")
20
+ except Exception as e:
21
+ print(f"Error deleting secret. Error is {e}")
File without changes
@@ -0,0 +1,5 @@
1
+ from qwak.clients.secret_service import SecretServiceClient
2
+
3
+
4
+ def execute_get_secret(name):
5
+ return SecretServiceClient().get_secret(name)
@@ -0,0 +1,17 @@
1
+ import click
2
+ from qwak.exceptions import QwakNotFoundException
3
+
4
+ from qwak_sdk.commands.secrets.get._logic import execute_get_secret
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+
8
+ @click.command("get", cls=QwakCommand)
9
+ @click.option("--name", metavar="TEXT", required=True, help="the secret name")
10
+ def get_secret(name, **kwargs):
11
+ try:
12
+ value = execute_get_secret(name)
13
+ print(value)
14
+ except QwakNotFoundException:
15
+ print(f"Secret '{name}' does not exists")
16
+ except Exception as e:
17
+ print(f"Error getting secret. Error is {e}")