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,176 @@
1
+ from typing import Dict, List, Set
2
+
3
+ from _qwak_proto.qwak.audience.v1.audience_pb2 import AudienceRoutesEntry
4
+ from _qwak_proto.qwak.deployment.deployment_pb2 import (
5
+ DeploymentHostingServiceType,
6
+ EnvironmentDeploymentDetailsMessage,
7
+ EnvironmentUndeploymentMessage,
8
+ ModelDeploymentStatus,
9
+ TrafficConfig,
10
+ Variation,
11
+ )
12
+ from _qwak_proto.qwak.ecosystem.v0.ecosystem_pb2 import EnvironmentDetails
13
+ from qwak.clients.administration.eco_system.client import EcosystemClient
14
+ from qwak.clients.deployment.client import DeploymentManagementClient
15
+ from qwak.exceptions import QwakException
16
+
17
+ from qwak_sdk.commands.models._logic.variations import (
18
+ create_variation_from_variation_config,
19
+ )
20
+ from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
21
+ DeployConfig,
22
+ )
23
+ from qwak_sdk.commands.models.deployments.undeploy._logic.variations import (
24
+ validate_variations_for_undeploy,
25
+ )
26
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
27
+
28
+ NO_DEPLOYED_VARIATIONS_ERROR_MSG = (
29
+ "There are currently no deployed variations for model {model_id} in {env_name}"
30
+ )
31
+
32
+ logger = get_qwak_logger()
33
+
34
+
35
+ def get_deployed_variation_name(existing_variations_names: Set[str]) -> str:
36
+ return list(existing_variations_names)[0]
37
+
38
+
39
+ def get_environment_undeploy_message(
40
+ audiences: List[AudienceRoutesEntry],
41
+ env_name: str,
42
+ existing_variations_names: Set[str],
43
+ fallback_variation: str,
44
+ model_id: str,
45
+ model_uuid: str,
46
+ requested_variations: List[Variation],
47
+ variation_name: str,
48
+ ):
49
+ if not variation_name and len(existing_variations_names) == 1:
50
+ variation_name = get_deployed_variation_name(
51
+ existing_variations_names=existing_variations_names
52
+ )
53
+
54
+ if not audiences:
55
+ validate_variations_for_undeploy(
56
+ variation_name,
57
+ existing_variations_names,
58
+ requested_variations,
59
+ env_name,
60
+ )
61
+ return EnvironmentUndeploymentMessage(
62
+ model_id=model_id,
63
+ model_uuid=model_uuid,
64
+ hosting_service_type=DeploymentHostingServiceType.KUBE_DEPLOYMENT,
65
+ traffic_config=TrafficConfig(
66
+ selected_variation_name=variation_name,
67
+ variations=requested_variations,
68
+ audience_routes_entries=audiences,
69
+ fallback_variation=fallback_variation,
70
+ ),
71
+ )
72
+
73
+
74
+ def get_env_to_undeploy_message(
75
+ audiences: List[AudienceRoutesEntry],
76
+ model_uuid: str,
77
+ env_id_to_deployment_details: Dict[str, EnvironmentDeploymentDetailsMessage],
78
+ env_name_to_env_details: Dict[str, EnvironmentDetails],
79
+ model_id: str,
80
+ requested_variations: List[Variation],
81
+ variation_name: str,
82
+ fallback_variation: str,
83
+ ) -> Dict[str, EnvironmentUndeploymentMessage]:
84
+ env_undeployment_requests = dict()
85
+ errors = []
86
+ for env_name, env_details in env_name_to_env_details.items():
87
+ env_deployments_details_message = env_id_to_deployment_details.get(
88
+ env_details.id
89
+ )
90
+ if not env_deployments_details_message:
91
+ errors.append(
92
+ NO_DEPLOYED_VARIATIONS_ERROR_MSG.format(
93
+ model_id=model_id, env_name=env_name
94
+ )
95
+ )
96
+ continue
97
+
98
+ env_deployments_details = env_deployments_details_message.deployments_details
99
+ existing_variations_names = {
100
+ deployment.variation.name for deployment in env_deployments_details
101
+ }
102
+ try:
103
+ env_undeployment_requests[
104
+ env_details.id
105
+ ] = get_environment_undeploy_message(
106
+ audiences,
107
+ env_name,
108
+ existing_variations_names,
109
+ fallback_variation,
110
+ model_id,
111
+ model_uuid,
112
+ requested_variations,
113
+ variation_name,
114
+ )
115
+ except QwakException as e:
116
+ errors.append(e.message)
117
+ if errors:
118
+ raise QwakException("\n".join(errors))
119
+ return env_undeployment_requests
120
+
121
+
122
+ def undeploy(
123
+ model_id: str,
124
+ branch_id: str,
125
+ config: DeployConfig,
126
+ model_uuid: str = "",
127
+ ):
128
+ deployment_client = DeploymentManagementClient()
129
+ ecosystem_client = EcosystemClient()
130
+ audiences: List[AudienceRoutesEntry] = [
131
+ audience.to_audience_route_entry(index)
132
+ for index, audience in enumerate(config.realtime.audiences)
133
+ ]
134
+ requested_variations = list(
135
+ map(
136
+ create_variation_from_variation_config,
137
+ config.realtime.variations if config.realtime else [],
138
+ )
139
+ )
140
+
141
+ _model_uuid = model_uuid if model_uuid else branch_id
142
+ if not _model_uuid:
143
+ raise QwakException("missing argument model uuid or branch id.")
144
+
145
+ environments_names = config.realtime.environments if config.realtime else []
146
+
147
+ deployment_details = deployment_client.get_deployment_details(model_id, _model_uuid)
148
+ env_id_to_deployment_details = dict(
149
+ deployment_details.environment_to_deployment_details
150
+ )
151
+ env_name_to_env_details = ecosystem_client.get_environments_names_to_details(
152
+ environments_names
153
+ )
154
+
155
+ env_undeployment_requests = get_env_to_undeploy_message(
156
+ audiences,
157
+ _model_uuid,
158
+ env_id_to_deployment_details,
159
+ env_name_to_env_details,
160
+ model_id,
161
+ requested_variations,
162
+ config.realtime.variation_name,
163
+ config.realtime.fallback_variation,
164
+ )
165
+
166
+ undeployment_response = deployment_client.undeploy_model(
167
+ model_id=model_id,
168
+ model_uuid=_model_uuid,
169
+ env_undeployment_requests=env_undeployment_requests,
170
+ )
171
+
172
+ logger.info(
173
+ f"Current status is {ModelDeploymentStatus.Name(undeployment_response.status)}."
174
+ )
175
+
176
+ return undeployment_response
@@ -0,0 +1,74 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import List, Set
4
+
5
+ from _qwak_proto.qwak.deployment.deployment_pb2 import Variation
6
+ from qwak.exceptions import QwakException
7
+
8
+ from qwak_sdk.commands.models.deployments.deploy._logic.variations import (
9
+ validate_percentages,
10
+ validate_shadow_variation,
11
+ )
12
+
13
+
14
+ def validate_variations_for_undeploy(
15
+ variation_name: str,
16
+ existing_variations_names: Set[str],
17
+ requested_variations: List[Variation],
18
+ environment_name: str,
19
+ ):
20
+ if variation_name not in existing_variations_names:
21
+ if not variation_name:
22
+ raise QwakException(
23
+ f"No selected variation. You must specify a variation since there is more than one deployed in "
24
+ f"{environment_name}. Currently {list(existing_variations_names)} are deployed"
25
+ )
26
+ raise QwakException(
27
+ f"The selected variation {variation_name} is not deployed in {environment_name}. "
28
+ f"Only {list(existing_variations_names)} are deployed"
29
+ )
30
+
31
+ requested_variations_names = set(
32
+ map(lambda variation: variation.name, requested_variations)
33
+ )
34
+ if variation_name in requested_variations_names:
35
+ raise QwakException(
36
+ f"Selected undeploy to variation '{variation_name}', but it is part of "
37
+ f"the requested variations {list(requested_variations_names)}. "
38
+ f"Please modify the variation name, or supply the requested variations definitions with"
39
+ f" the necessary changes"
40
+ )
41
+ if variation_name not in existing_variations_names:
42
+ raise QwakException(
43
+ f"Selected undeploy to variation {variation_name} but it is not one of "
44
+ f"the existing variations {list(existing_variations_names)}. "
45
+ f"Please modify the variation name."
46
+ )
47
+
48
+ ignored_variations = existing_variations_names.difference(
49
+ requested_variations_names
50
+ )
51
+ if variation_name in ignored_variations:
52
+ ignored_variations.remove(variation_name)
53
+
54
+ if len(existing_variations_names) != 2 and ignored_variations:
55
+ raise QwakException(
56
+ f"The given variation configuration does not contain the configuration for the following "
57
+ f"variations {list(ignored_variations)}. You must include all the variations that will exist after "
58
+ f"undeploy in the configuration"
59
+ )
60
+
61
+ unexpected_variations = requested_variations_names.difference(
62
+ existing_variations_names
63
+ )
64
+
65
+ if unexpected_variations:
66
+ raise QwakException(
67
+ f"The given variation configuration contains the configuration for the following "
68
+ f"variations {list(unexpected_variations)} which are not expected. When undeploying, the variations "
69
+ f"configuration must contain all expected remaining variations (from the existing ones)."
70
+ )
71
+
72
+ if requested_variations:
73
+ validate_percentages(requested_variations)
74
+ validate_shadow_variation(requested_variations)
@@ -0,0 +1,78 @@
1
+ from typing import List
2
+
3
+ import click
4
+ from qwak.clients.model_management import ModelsManagementClient
5
+
6
+ from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
7
+ DeployConfig,
8
+ )
9
+ from qwak_sdk.commands.models.deployments.undeploy._logic.request_undeploy import (
10
+ undeploy,
11
+ )
12
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
13
+ from qwak_sdk.inner.tools.config_handler import config_handler
14
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
15
+
16
+ logger = get_qwak_logger()
17
+
18
+
19
+ @click.command(
20
+ name="undeploy",
21
+ help="Model undeploy operation",
22
+ cls=QwakCommand,
23
+ )
24
+ @click.option("--model-id", metavar="NAME", required=True, help="Model ID")
25
+ @click.option(
26
+ "--branch",
27
+ metavar="NAME",
28
+ default="main",
29
+ help="Branch to deploy under. Default is 'main'.",
30
+ )
31
+ @click.option(
32
+ "--variation-name",
33
+ required=False,
34
+ type=str,
35
+ help="The variation name",
36
+ )
37
+ @click.option(
38
+ "--environment-name",
39
+ required=False,
40
+ type=str,
41
+ help="Environment to undeploy from (if not specified uses your default environment",
42
+ multiple=True,
43
+ )
44
+ @click.option(
45
+ "-f",
46
+ "--from-file",
47
+ help="Undeploy by run_config file, Command arguments will overwrite any run_config.",
48
+ required=False,
49
+ type=click.Path(exists=True, resolve_path=True, dir_okay=False),
50
+ )
51
+ def models_undeploy(
52
+ model_id: str,
53
+ branch: str,
54
+ variation_name: str,
55
+ environment_name: List[str],
56
+ from_file: str = None,
57
+ **kwargs,
58
+ ):
59
+ logger.info(f"Initiating undeployment for model '{model_id}'")
60
+ models_management = ModelsManagementClient()
61
+ config: DeployConfig = config_handler(
62
+ config=DeployConfig,
63
+ from_file=from_file,
64
+ out_conf=False,
65
+ sections=("realtime",),
66
+ model_id=model_id,
67
+ branch=branch,
68
+ variation_name=variation_name,
69
+ environment_name=environment_name,
70
+ )
71
+ model_uuid = models_management.get_model_uuid(model_id)
72
+
73
+ undeploy(
74
+ model_id=model_id,
75
+ branch_id=model_uuid,
76
+ config=config,
77
+ model_uuid=model_uuid,
78
+ )
File without changes
File without changes
@@ -0,0 +1,9 @@
1
+ from qwak.clients.batch_job_management import BatchJobManagerClient
2
+ from qwak.clients.batch_job_management.results import CancelExecutionResult
3
+
4
+
5
+ def execute_execution_cancel(execution_id: str):
6
+ batch_job_cancel_response: CancelExecutionResult = (
7
+ BatchJobManagerClient().cancel_execution(execution_id)
8
+ )
9
+ return batch_job_cancel_response.success, batch_job_cancel_response.failure_message
@@ -0,0 +1,27 @@
1
+ import click
2
+ from qwak.exceptions import QwakException
3
+
4
+ from qwak_sdk.commands.models.executions.cancel._logic import execute_execution_cancel
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
7
+
8
+ logger = get_qwak_logger()
9
+
10
+
11
+ @click.command(name="cancel", help="Cancel a running execution.", cls=QwakCommand)
12
+ @click.option(
13
+ "--execution-id",
14
+ type=str,
15
+ help="The execution id.",
16
+ )
17
+ def execution_cancel(execution_id: str, **kwargs):
18
+ try:
19
+ success, fail_message = execute_execution_cancel(execution_id)
20
+ if not success:
21
+ raise QwakException(fail_message)
22
+
23
+ logger.info(f"Execution {execution_id} cancelled successfully.")
24
+
25
+ except Exception as e:
26
+ logger.error(f"Failed to cancel execution, Error: {e}")
27
+ raise
@@ -0,0 +1,24 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.executions.cancel.ui import execution_cancel
4
+ from qwak_sdk.commands.models.executions.report.ui import execution_report
5
+ from qwak_sdk.commands.models.executions.start.ui import execution_start
6
+ from qwak_sdk.commands.models.executions.status.ui import execution_status
7
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
8
+
9
+ logger = get_qwak_logger()
10
+
11
+
12
+ @click.group(
13
+ name="execution",
14
+ help="Executions of a batch job on deployed model.",
15
+ )
16
+ def execution_commands_group():
17
+ # Click commands group injection
18
+ pass
19
+
20
+
21
+ execution_commands_group.add_command(execution_cancel)
22
+ execution_commands_group.add_command(execution_report)
23
+ execution_commands_group.add_command(execution_start)
24
+ execution_commands_group.add_command(execution_status)
File without changes
@@ -0,0 +1,14 @@
1
+ from qwak.clients.batch_job_management import BatchJobManagerClient
2
+ from qwak.clients.batch_job_management.results import GetExecutionReportResult
3
+
4
+
5
+ def execute_execution_report(execution_id: str):
6
+ batch_job_report_response: GetExecutionReportResult = (
7
+ BatchJobManagerClient().get_execution_report(execution_id)
8
+ )
9
+ return (
10
+ batch_job_report_response.records,
11
+ batch_job_report_response.model_logs,
12
+ batch_job_report_response.success,
13
+ batch_job_report_response.failure_message,
14
+ )
@@ -0,0 +1,43 @@
1
+ import click
2
+ from qwak.exceptions import QwakException
3
+
4
+ from qwak_sdk.commands.models.executions.report._logic import execute_execution_report
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
7
+ from qwak_sdk.tools.colors import Color
8
+
9
+ logger = get_qwak_logger()
10
+
11
+
12
+ @click.command(name="report", help="Get the report of an execution.", cls=QwakCommand)
13
+ @click.option(
14
+ "--execution-id",
15
+ type=str,
16
+ help="The execution id.",
17
+ )
18
+ def execution_report(execution_id: str, **kwargs):
19
+ try:
20
+ report_messages, model_logs, success, fail_message = execute_execution_report(
21
+ execution_id
22
+ )
23
+ if not success:
24
+ raise QwakException(fail_message)
25
+
26
+ colored_report_lines = [
27
+ f"{Color.BLUE}{message}{Color.END}" for message in report_messages
28
+ ]
29
+
30
+ colored_log_lines = [
31
+ f"{Color.BLUE}{message}{Color.END}" for message in model_logs
32
+ ]
33
+
34
+ print(f"{Color.WHITE}Execution Report{Color.END}")
35
+ print(f"{Color.WHITE}================{Color.END}")
36
+ print("\n".join(colored_report_lines), end="\n")
37
+ print(f"{Color.WHITE}Execution Logs{Color.END}")
38
+ print(f"{Color.WHITE}=============={Color.END}")
39
+ print("\n".join(colored_log_lines), end="\n")
40
+
41
+ except Exception as e:
42
+ logger.error(f"Failed to get execution report, Error: {e}")
43
+ raise
File without changes
@@ -0,0 +1,16 @@
1
+ from typing import Tuple
2
+
3
+ from qwak.clients.batch_job_management import BatchJobManagerClient
4
+ from qwak.clients.batch_job_management.executions_config import ExecutionConfig
5
+ from qwak.clients.batch_job_management.results import StartExecutionResult
6
+
7
+
8
+ def execute_start_execution(config: ExecutionConfig) -> Tuple[str, bool, str]:
9
+ batch_job_start_response: StartExecutionResult = (
10
+ BatchJobManagerClient().start_execution(config)
11
+ )
12
+ return (
13
+ batch_job_start_response.execution_id,
14
+ batch_job_start_response.success,
15
+ batch_job_start_response.failure_message,
16
+ )
@@ -0,0 +1,176 @@
1
+ import click
2
+ from qwak.clients.batch_job_management.executions_config import (
3
+ GPU_TYPE_MAP,
4
+ INPUT_FORMATTERS_MAP,
5
+ OUTPUT_FORMATTERS_MAP,
6
+ ExecutionConfig,
7
+ )
8
+ from qwak.exceptions import QwakException
9
+ from qwak.inner.const import QwakConstants
10
+ from tabulate import tabulate
11
+
12
+ from qwak_sdk.commands.models.executions.start._logic import execute_start_execution
13
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
14
+ from qwak_sdk.inner.tools.config_handler import config_handler
15
+ from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
16
+
17
+ logger = get_qwak_logger()
18
+
19
+
20
+ @click.command(
21
+ name="start", help="Start an execution job on a deployed model.", cls=QwakCommand
22
+ )
23
+ @click.option("--model-id", required=True, help="Model ID", type=str)
24
+ @click.option("--branch", required=True, help="Branch", type=str, default="main")
25
+ @click.option(
26
+ "--build-id",
27
+ type=str,
28
+ help="Explicit Build ID to invoke the execution against. If empty, the deployed build ID will be applied",
29
+ )
30
+ @click.option(
31
+ "--bucket",
32
+ type=str,
33
+ help="The bucket to read and write the data to/from.",
34
+ )
35
+ @click.option(
36
+ "--source-bucket",
37
+ type=str,
38
+ help="The source bucket to read the data from.",
39
+ )
40
+ @click.option(
41
+ "--source-folder",
42
+ required=True,
43
+ type=str,
44
+ help="The source folder to read the data from.",
45
+ )
46
+ @click.option(
47
+ "--destination-bucket",
48
+ type=str,
49
+ help="The destination bucket to store results on.",
50
+ )
51
+ @click.option(
52
+ "--destination-folder",
53
+ type=str,
54
+ required=True,
55
+ help="The destination folder to store results on.",
56
+ )
57
+ @click.option(
58
+ "--input-file-type",
59
+ type=click.Choice(
60
+ [fmt for fmt in INPUT_FORMATTERS_MAP.keys()], case_sensitive=False
61
+ ),
62
+ help="The input file type to read.",
63
+ )
64
+ @click.option(
65
+ "--output-file-type",
66
+ type=click.Choice(
67
+ [fmt for fmt in OUTPUT_FORMATTERS_MAP.keys()], case_sensitive=False
68
+ ),
69
+ help="The output file type to to receive.",
70
+ )
71
+ @click.option(
72
+ "--access-token-name",
73
+ type=str,
74
+ required=True,
75
+ help="The access token secret name (should be created before by using `qwak secret`).",
76
+ )
77
+ @click.option(
78
+ "--access-secret-name",
79
+ type=str,
80
+ required=True,
81
+ help="The access secret secret name (should be created before by using `qwak secret`).",
82
+ )
83
+ @click.option(
84
+ "--job-timeout",
85
+ type=int,
86
+ default=0,
87
+ help="Total inference job timeout in seconds, (e.g. 2000). Default is unlimited.",
88
+ )
89
+ @click.option(
90
+ "--file-timeout",
91
+ type=int,
92
+ default=0,
93
+ help="A single file inference timeout in seconds, (e.g. 2000). Default is unlimited.",
94
+ )
95
+ @click.option(
96
+ "--pods",
97
+ type=int,
98
+ default=0,
99
+ help="Number of pods to deploy. (concurrent files processing). Default is as deployed.",
100
+ )
101
+ @click.option(
102
+ "--cpus",
103
+ type=float,
104
+ default=0,
105
+ help="Number of CPU cores, can be fraction of a core "
106
+ "(e.g. 0.4). Default is as deployed.",
107
+ )
108
+ @click.option(
109
+ "--memory",
110
+ type=int,
111
+ default=0,
112
+ help="Memory amount in Mib (e.g. 256). Default is as deployed.",
113
+ )
114
+ @click.option(
115
+ "--gpu-type",
116
+ type=click.Choice([fmt for fmt in GPU_TYPE_MAP.keys()], case_sensitive=False),
117
+ help=f"Type of GPU to use on the deployment ({', '.join([x for x in QwakConstants.GPU_TYPES])}).",
118
+ )
119
+ @click.option(
120
+ "--gpu-amount",
121
+ type=int,
122
+ help="Amount of GPU's to use on the in the batch inference.",
123
+ )
124
+ @click.option(
125
+ "-f",
126
+ "--from-file",
127
+ help="Build by run_config file, Command arguments will overwrite any run_config.",
128
+ required=False,
129
+ type=click.Path(exists=True, resolve_path=True, dir_okay=False),
130
+ )
131
+ @click.option(
132
+ "--out-conf",
133
+ help="Extract deploy conf from command arguments, the command will not run it wil only output valid yaml "
134
+ "structure",
135
+ default=False,
136
+ is_flag=True,
137
+ )
138
+ @click.option(
139
+ "-P",
140
+ "--param-list",
141
+ required=False,
142
+ metavar="NAME=VALUE",
143
+ multiple=True,
144
+ help="A parameter for the batch execution, of the form -P name=value",
145
+ )
146
+ def execution_start(from_file: str, out_conf: bool, **kwargs):
147
+ config: ExecutionConfig = config_handler(
148
+ config=ExecutionConfig,
149
+ from_file=from_file,
150
+ out_conf=out_conf,
151
+ sections=("execution", "resources"),
152
+ **kwargs,
153
+ )
154
+ if not out_conf:
155
+ try:
156
+ execution_id, success, fail_message = execute_start_execution(config)
157
+ if success:
158
+ logger.info(
159
+ tabulate(
160
+ tabular_data=[
161
+ ["Model ID", config.execution.model_id],
162
+ ["Branch", config.execution.branch],
163
+ ["Execution ID", execution_id],
164
+ ],
165
+ tablefmt="fancy_grid",
166
+ )
167
+ )
168
+ else:
169
+ raise QwakException(fail_message + f" {execution_id}")
170
+
171
+ logger.info(
172
+ "Execution initiated successfully, Use --status to get execution current status."
173
+ )
174
+ except Exception as e:
175
+ logger.error(f"Execution failed, Error: {e}")
176
+ raise
File without changes
@@ -0,0 +1,13 @@
1
+ from qwak.clients.batch_job_management import BatchJobManagerClient
2
+ from qwak.clients.batch_job_management.results import ExecutionStatusResult
3
+
4
+
5
+ def execute_execution_status(execution_id: str):
6
+ batch_job_status_response: ExecutionStatusResult = (
7
+ BatchJobManagerClient().get_execution_status(execution_id)
8
+ )
9
+ return (
10
+ batch_job_status_response.status,
11
+ batch_job_status_response.success,
12
+ batch_job_status_response.failure_message,
13
+ )