qwak-sdk 0.5.102__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.
Files changed (328) hide show
  1. qwak_sdk/__init__.py +9 -0
  2. qwak_sdk/cli.py +79 -0
  3. qwak_sdk/commands/__init__.py +0 -0
  4. qwak_sdk/commands/_logic/__init__.py +0 -0
  5. qwak_sdk/commands/_logic/tools.py +6 -0
  6. qwak_sdk/commands/admin/__init__.py +0 -0
  7. qwak_sdk/commands/admin/admin_commands_group.py +17 -0
  8. qwak_sdk/commands/admin/apikeys/__init__.py +0 -0
  9. qwak_sdk/commands/admin/apikeys/api_keys_commands_group.py +17 -0
  10. qwak_sdk/commands/admin/apikeys/generate/__init__.py +0 -0
  11. qwak_sdk/commands/admin/apikeys/generate/_logic.py +21 -0
  12. qwak_sdk/commands/admin/apikeys/generate/ui.py +45 -0
  13. qwak_sdk/commands/admin/apikeys/revoke/__init__.py +0 -0
  14. qwak_sdk/commands/admin/apikeys/revoke/_logic.py +22 -0
  15. qwak_sdk/commands/admin/apikeys/revoke/ui.py +31 -0
  16. qwak_sdk/commands/alerts/__init__.py +0 -0
  17. qwak_sdk/commands/alerts/alerts_commnad_group.py +18 -0
  18. qwak_sdk/commands/alerts/delete/__init__.py +0 -0
  19. qwak_sdk/commands/alerts/delete/_logic.py +5 -0
  20. qwak_sdk/commands/alerts/delete/ui.py +10 -0
  21. qwak_sdk/commands/alerts/list/__init__.py +0 -0
  22. qwak_sdk/commands/alerts/list/_logic.py +23 -0
  23. qwak_sdk/commands/alerts/list/ui.py +17 -0
  24. qwak_sdk/commands/alerts/register/__init__.py +0 -0
  25. qwak_sdk/commands/alerts/register/_logic.py +72 -0
  26. qwak_sdk/commands/alerts/register/ui.py +30 -0
  27. qwak_sdk/commands/audience/__init__.py +0 -0
  28. qwak_sdk/commands/audience/_logic/__init__.py +0 -0
  29. qwak_sdk/commands/audience/_logic/config/__init__.py +0 -0
  30. qwak_sdk/commands/audience/_logic/config/config_base.py +15 -0
  31. qwak_sdk/commands/audience/_logic/config/parser.py +30 -0
  32. qwak_sdk/commands/audience/_logic/config/v1/__init__.py +0 -0
  33. qwak_sdk/commands/audience/_logic/config/v1/audience_config.py +26 -0
  34. qwak_sdk/commands/audience/_logic/config/v1/conditions_config.py +59 -0
  35. qwak_sdk/commands/audience/_logic/config/v1/config_v1.py +23 -0
  36. qwak_sdk/commands/audience/_logic/config/v1/route_config.py +15 -0
  37. qwak_sdk/commands/audience/_logic/config/v1/spec.py +9 -0
  38. qwak_sdk/commands/audience/audience_api_dump.py +86 -0
  39. qwak_sdk/commands/audience/audience_commands_group.py +30 -0
  40. qwak_sdk/commands/audience/create/__init__.py +0 -0
  41. qwak_sdk/commands/audience/create/logic.py +41 -0
  42. qwak_sdk/commands/audience/create/ui.py +21 -0
  43. qwak_sdk/commands/audience/delete/__init__.py +0 -0
  44. qwak_sdk/commands/audience/delete/logic.py +13 -0
  45. qwak_sdk/commands/audience/delete/ui.py +17 -0
  46. qwak_sdk/commands/audience/get/__init__.py +0 -0
  47. qwak_sdk/commands/audience/get/logic.py +14 -0
  48. qwak_sdk/commands/audience/get/ui.py +25 -0
  49. qwak_sdk/commands/audience/list/__init__.py +0 -0
  50. qwak_sdk/commands/audience/list/logic.py +16 -0
  51. qwak_sdk/commands/audience/list/ui.py +26 -0
  52. qwak_sdk/commands/audience/update/__init__.py +0 -0
  53. qwak_sdk/commands/audience/update/logic.py +37 -0
  54. qwak_sdk/commands/audience/update/ui.py +26 -0
  55. qwak_sdk/commands/auto_scalling/__init__.py +0 -0
  56. qwak_sdk/commands/auto_scalling/_logic/__init__.py +0 -0
  57. qwak_sdk/commands/auto_scalling/_logic/config/__init__.py +3 -0
  58. qwak_sdk/commands/auto_scalling/_logic/config/config.py +152 -0
  59. qwak_sdk/commands/auto_scalling/_logic/config/parser.py +21 -0
  60. qwak_sdk/commands/auto_scalling/attach/__init__.py +0 -0
  61. qwak_sdk/commands/auto_scalling/attach/_logic.py +43 -0
  62. qwak_sdk/commands/auto_scalling/attach/ui.py +21 -0
  63. qwak_sdk/commands/auto_scalling/autoscaling_commands_group.py +15 -0
  64. qwak_sdk/commands/automations/__init__.py +0 -0
  65. qwak_sdk/commands/automations/automations_commands_group.py +30 -0
  66. qwak_sdk/commands/automations/delete/__init__.py +0 -0
  67. qwak_sdk/commands/automations/delete/_logic.py +6 -0
  68. qwak_sdk/commands/automations/delete/ui.py +23 -0
  69. qwak_sdk/commands/automations/executions/__init__.py +0 -0
  70. qwak_sdk/commands/automations/executions/executions_commands_group.py +14 -0
  71. qwak_sdk/commands/automations/executions/list/__init__.py +0 -0
  72. qwak_sdk/commands/automations/executions/list/_logic.py +8 -0
  73. qwak_sdk/commands/automations/executions/list/ui.py +25 -0
  74. qwak_sdk/commands/automations/list/__init__.py +0 -0
  75. qwak_sdk/commands/automations/list/_logic.py +36 -0
  76. qwak_sdk/commands/automations/list/ui.py +21 -0
  77. qwak_sdk/commands/automations/register/__init__.py +0 -0
  78. qwak_sdk/commands/automations/register/_logic.py +43 -0
  79. qwak_sdk/commands/automations/register/ui.py +44 -0
  80. qwak_sdk/commands/feature_store/__init__.py +0 -0
  81. qwak_sdk/commands/feature_store/backfill/__init__.py +0 -0
  82. qwak_sdk/commands/feature_store/backfill/_logic.py +140 -0
  83. qwak_sdk/commands/feature_store/backfill/streaming/__init__.py +0 -0
  84. qwak_sdk/commands/feature_store/backfill/streaming/_logic.py +50 -0
  85. qwak_sdk/commands/feature_store/backfill/streaming/ui.py +67 -0
  86. qwak_sdk/commands/feature_store/backfill/ui.py +146 -0
  87. qwak_sdk/commands/feature_store/delete/__init__.py +0 -0
  88. qwak_sdk/commands/feature_store/delete/_logic.py +104 -0
  89. qwak_sdk/commands/feature_store/delete/ui.py +40 -0
  90. qwak_sdk/commands/feature_store/execution/__init__.py +0 -0
  91. qwak_sdk/commands/feature_store/execution/ui.py +19 -0
  92. qwak_sdk/commands/feature_store/feature_store_command_group.py +29 -0
  93. qwak_sdk/commands/feature_store/list/__init__.py +0 -0
  94. qwak_sdk/commands/feature_store/list/ui.py +140 -0
  95. qwak_sdk/commands/feature_store/pause/__init__.py +0 -0
  96. qwak_sdk/commands/feature_store/pause/ui.py +18 -0
  97. qwak_sdk/commands/feature_store/register/__init__.py +0 -0
  98. qwak_sdk/commands/feature_store/register/_logic.py +367 -0
  99. qwak_sdk/commands/feature_store/register/ui.py +111 -0
  100. qwak_sdk/commands/feature_store/resume/__init__.py +0 -0
  101. qwak_sdk/commands/feature_store/resume/ui.py +18 -0
  102. qwak_sdk/commands/feature_store/trigger/__init__.py +0 -0
  103. qwak_sdk/commands/feature_store/trigger/ui.py +39 -0
  104. qwak_sdk/commands/models/__init__.py +0 -0
  105. qwak_sdk/commands/models/build/__init__.py +0 -0
  106. qwak_sdk/commands/models/build/_logic/__init__.py +0 -0
  107. qwak_sdk/commands/models/build/_logic/build_steps.py +42 -0
  108. qwak_sdk/commands/models/build/_logic/client_logs/__init__.py +0 -0
  109. qwak_sdk/commands/models/build/_logic/client_logs/cli_phase_run_handler.py +123 -0
  110. qwak_sdk/commands/models/build/_logic/client_logs/cli_trigger_build_logger.py +19 -0
  111. qwak_sdk/commands/models/build/_logic/client_logs/logger.py +88 -0
  112. qwak_sdk/commands/models/build/_logic/client_logs/messages.py +36 -0
  113. qwak_sdk/commands/models/build/_logic/client_logs/spinner.py +14 -0
  114. qwak_sdk/commands/models/build/_logic/client_logs/trigger_build_logger.py +54 -0
  115. qwak_sdk/commands/models/build/_logic/client_logs/utils.py +12 -0
  116. qwak_sdk/commands/models/build/_logic/phase/__init__.py +0 -0
  117. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/__init__.py +20 -0
  118. qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/get_sdk_version_step.py +14 -0
  119. qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/__init__.py +16 -0
  120. qwak_sdk/commands/models/build/_logic/phase/c_deploy/__init__.py +6 -0
  121. qwak_sdk/commands/models/build/_logic/phase/c_deploy/build_polling_status.py +55 -0
  122. qwak_sdk/commands/models/build/_logic/phase/c_deploy/deploy_build.py +61 -0
  123. qwak_sdk/commands/models/build/_logic/util/__init__.py +0 -0
  124. qwak_sdk/commands/models/build/_logic/util/protobuf_factory.py +45 -0
  125. qwak_sdk/commands/models/build/_logic/util/step_decorator.py +60 -0
  126. qwak_sdk/commands/models/build/_logic/util/text.py +9 -0
  127. qwak_sdk/commands/models/build/_logic/wait_until_finished.py +27 -0
  128. qwak_sdk/commands/models/build/ui.py +337 -0
  129. qwak_sdk/commands/models/builds/__init__.py +0 -0
  130. qwak_sdk/commands/models/builds/builds_commands_group.py +16 -0
  131. qwak_sdk/commands/models/builds/cancel/__init__.py +0 -0
  132. qwak_sdk/commands/models/builds/cancel/_logic.py +5 -0
  133. qwak_sdk/commands/models/builds/cancel/ui.py +15 -0
  134. qwak_sdk/commands/models/builds/logs/__init__.py +0 -0
  135. qwak_sdk/commands/models/builds/logs/ui.py +35 -0
  136. qwak_sdk/commands/models/builds/status/__init__.py +0 -0
  137. qwak_sdk/commands/models/builds/status/_logic.py +6 -0
  138. qwak_sdk/commands/models/builds/status/ui.py +39 -0
  139. qwak_sdk/commands/models/create/__init__.py +0 -0
  140. qwak_sdk/commands/models/create/_logic.py +36 -0
  141. qwak_sdk/commands/models/create/ui.py +43 -0
  142. qwak_sdk/commands/models/delete/__init__.py +0 -0
  143. qwak_sdk/commands/models/delete/_logic.py +5 -0
  144. qwak_sdk/commands/models/delete/ui.py +25 -0
  145. qwak_sdk/commands/models/deployments/__init__.py +0 -0
  146. qwak_sdk/commands/models/deployments/deploy/__init__.py +0 -0
  147. qwak_sdk/commands/models/deployments/deploy/_logic/__init__.py +0 -0
  148. qwak_sdk/commands/models/deployments/deploy/_logic/advance_deployment_options_handler.py +31 -0
  149. qwak_sdk/commands/models/deployments/deploy/_logic/base_deploy_executor.py +68 -0
  150. qwak_sdk/commands/models/deployments/deploy/_logic/deploy_config.py +261 -0
  151. qwak_sdk/commands/models/deployments/deploy/_logic/deployment.py +405 -0
  152. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_message_helpers.py +114 -0
  153. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_response_handler.py +156 -0
  154. qwak_sdk/commands/models/deployments/deploy/_logic/deployment_size_mapper.py +96 -0
  155. qwak_sdk/commands/models/deployments/deploy/_logic/get_latest_successful_build.py +28 -0
  156. qwak_sdk/commands/models/deployments/deploy/_logic/local_deployment.py +193 -0
  157. qwak_sdk/commands/models/deployments/deploy/batch/__init__.py +0 -0
  158. qwak_sdk/commands/models/deployments/deploy/batch/_logic/__init__.py +0 -0
  159. qwak_sdk/commands/models/deployments/deploy/batch/_logic/advanced_deployment_mapper.py +15 -0
  160. qwak_sdk/commands/models/deployments/deploy/batch/_logic/deploy_executor.py +24 -0
  161. qwak_sdk/commands/models/deployments/deploy/batch/ui.py +126 -0
  162. qwak_sdk/commands/models/deployments/deploy/deploy_commands_group.py +19 -0
  163. qwak_sdk/commands/models/deployments/deploy/realtime/__init__.py +0 -0
  164. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/__init__.py +0 -0
  165. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/advanced_deployment_mapper.py +21 -0
  166. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/deploy_executor.py +24 -0
  167. qwak_sdk/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py +75 -0
  168. qwak_sdk/commands/models/deployments/deploy/realtime/ui.py +209 -0
  169. qwak_sdk/commands/models/deployments/deploy/streaming/__init__.py +0 -0
  170. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/__init__.py +0 -0
  171. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/deploy_executor.py +24 -0
  172. qwak_sdk/commands/models/deployments/deploy/streaming/_logic/serving_strategy_mapper.py +38 -0
  173. qwak_sdk/commands/models/deployments/deploy/streaming/ui.py +213 -0
  174. qwak_sdk/commands/models/deployments/undeploy/__init__.py +0 -0
  175. qwak_sdk/commands/models/deployments/undeploy/_logic/__init__.py +0 -0
  176. qwak_sdk/commands/models/deployments/undeploy/_logic/request_undeploy.py +249 -0
  177. qwak_sdk/commands/models/deployments/undeploy/ui.py +72 -0
  178. qwak_sdk/commands/models/describe/__init__.py +0 -0
  179. qwak_sdk/commands/models/describe/_logic.py +169 -0
  180. qwak_sdk/commands/models/describe/ui.py +35 -0
  181. qwak_sdk/commands/models/executions/__init__.py +0 -0
  182. qwak_sdk/commands/models/executions/cancel/__init__.py +0 -0
  183. qwak_sdk/commands/models/executions/cancel/_logic.py +9 -0
  184. qwak_sdk/commands/models/executions/cancel/ui.py +27 -0
  185. qwak_sdk/commands/models/executions/execution_commands_group.py +24 -0
  186. qwak_sdk/commands/models/executions/report/__init__.py +0 -0
  187. qwak_sdk/commands/models/executions/report/_logic.py +14 -0
  188. qwak_sdk/commands/models/executions/report/ui.py +43 -0
  189. qwak_sdk/commands/models/executions/start/__init__.py +0 -0
  190. qwak_sdk/commands/models/executions/start/_logic.py +81 -0
  191. qwak_sdk/commands/models/executions/start/ui.py +208 -0
  192. qwak_sdk/commands/models/executions/status/__init__.py +0 -0
  193. qwak_sdk/commands/models/executions/status/_logic.py +13 -0
  194. qwak_sdk/commands/models/executions/status/ui.py +27 -0
  195. qwak_sdk/commands/models/init/__init__.py +0 -0
  196. qwak_sdk/commands/models/init/_logic/__init__.py +0 -0
  197. qwak_sdk/commands/models/init/_logic/initialize_model_structure.py +40 -0
  198. qwak_sdk/commands/models/init/_logic/template/__init__.py +0 -0
  199. qwak_sdk/commands/models/init/_logic/template/churn/__init__.py +0 -0
  200. qwak_sdk/commands/models/init/_logic/template/churn/cookiecutter.json +3 -0
  201. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/__init__.py +0 -0
  202. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  203. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
  204. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  205. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/model.py +95 -0
  206. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  207. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  208. qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/test_churn.py +32 -0
  209. qwak_sdk/commands/models/init/_logic/template/credit_risk/__init__.py +0 -0
  210. qwak_sdk/commands/models/init/_logic/template/credit_risk/cookiecutter.json +3 -0
  211. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/__init__.py +0 -0
  212. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  213. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
  214. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  215. qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py +108 -0
  216. qwak_sdk/commands/models/init/_logic/template/general/__init__.py +0 -0
  217. qwak_sdk/commands/models/init/_logic/template/general/cookiecutter.json +6 -0
  218. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py +0 -0
  219. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py +5 -0
  220. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml +8 -0
  221. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/model.py +66 -0
  222. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/__init__.py +0 -0
  223. qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/test_qwak_model.py +5 -0
  224. qwak_sdk/commands/models/init/_logic/template/titanic/__init__.py +0 -0
  225. qwak_sdk/commands/models/init/_logic/template/titanic/cookiecutter.json +3 -0
  226. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/__init__.py +0 -0
  227. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  228. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
  229. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/model.py +98 -0
  230. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  231. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  232. qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +24 -0
  233. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/__init__.py +0 -0
  234. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/cookiecutter.json +3 -0
  235. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/__init__.py +0 -0
  236. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  237. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/model.py +98 -0
  238. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/pyproject.toml +20 -0
  239. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  240. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  241. qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +25 -0
  242. qwak_sdk/commands/models/init/ui.py +61 -0
  243. qwak_sdk/commands/models/list/__init__.py +0 -0
  244. qwak_sdk/commands/models/list/_logic.py +5 -0
  245. qwak_sdk/commands/models/list/ui.py +40 -0
  246. qwak_sdk/commands/models/list_models/__init__.py +0 -0
  247. qwak_sdk/commands/models/list_models/_logic.py +5 -0
  248. qwak_sdk/commands/models/list_models/ui.py +60 -0
  249. qwak_sdk/commands/models/metadata/__init__.py +0 -0
  250. qwak_sdk/commands/models/metadata/_logic.py +5 -0
  251. qwak_sdk/commands/models/metadata/ui.py +60 -0
  252. qwak_sdk/commands/models/models_command_group.py +44 -0
  253. qwak_sdk/commands/models/runtime/__init__.py +0 -0
  254. qwak_sdk/commands/models/runtime/logs/__init__.py +0 -0
  255. qwak_sdk/commands/models/runtime/logs/ui.py +63 -0
  256. qwak_sdk/commands/models/runtime/runtime_commands_group.py +17 -0
  257. qwak_sdk/commands/models/runtime/update/__init__.py +0 -0
  258. qwak_sdk/commands/models/runtime/update/_logic.py +9 -0
  259. qwak_sdk/commands/models/runtime/update/ui.py +15 -0
  260. qwak_sdk/commands/projects/__init__.py +0 -0
  261. qwak_sdk/commands/projects/create/__init__.py +0 -0
  262. qwak_sdk/commands/projects/create/_logic.py +9 -0
  263. qwak_sdk/commands/projects/create/ui.py +68 -0
  264. qwak_sdk/commands/projects/delete/__init__.py +0 -0
  265. qwak_sdk/commands/projects/delete/_logic.py +6 -0
  266. qwak_sdk/commands/projects/delete/ui.py +24 -0
  267. qwak_sdk/commands/projects/list/__init__.py +0 -0
  268. qwak_sdk/commands/projects/list/_logic.py +6 -0
  269. qwak_sdk/commands/projects/list/ui.py +45 -0
  270. qwak_sdk/commands/projects/projects_command_group.py +19 -0
  271. qwak_sdk/commands/secrets/__init__.py +0 -0
  272. qwak_sdk/commands/secrets/delete/__init__.py +0 -0
  273. qwak_sdk/commands/secrets/delete/_logic.py +5 -0
  274. qwak_sdk/commands/secrets/delete/ui.py +21 -0
  275. qwak_sdk/commands/secrets/get/__init__.py +0 -0
  276. qwak_sdk/commands/secrets/get/_logic.py +5 -0
  277. qwak_sdk/commands/secrets/get/ui.py +17 -0
  278. qwak_sdk/commands/secrets/secrets_commands_group.py +19 -0
  279. qwak_sdk/commands/secrets/set/__init__.py +0 -0
  280. qwak_sdk/commands/secrets/set/_logic.py +5 -0
  281. qwak_sdk/commands/secrets/set/ui.py +16 -0
  282. qwak_sdk/commands/ui_tools.py +18 -0
  283. qwak_sdk/commands/workspaces/__init__.py +0 -0
  284. qwak_sdk/commands/workspaces/_logic/__init__.py +0 -0
  285. qwak_sdk/commands/workspaces/_logic/tools.py +44 -0
  286. qwak_sdk/commands/workspaces/_logic/workspace_validations.py +41 -0
  287. qwak_sdk/commands/workspaces/config/__init__.py +0 -0
  288. qwak_sdk/commands/workspaces/config/workspace_config.py +35 -0
  289. qwak_sdk/commands/workspaces/create/__init__.py +0 -0
  290. qwak_sdk/commands/workspaces/create/_logic.py +54 -0
  291. qwak_sdk/commands/workspaces/create/ui.py +48 -0
  292. qwak_sdk/commands/workspaces/delete/__init__.py +0 -0
  293. qwak_sdk/commands/workspaces/delete/_logic.py +30 -0
  294. qwak_sdk/commands/workspaces/delete/ui.py +23 -0
  295. qwak_sdk/commands/workspaces/start/__init__.py +0 -0
  296. qwak_sdk/commands/workspaces/start/_logic.py +30 -0
  297. qwak_sdk/commands/workspaces/start/ui.py +23 -0
  298. qwak_sdk/commands/workspaces/stop/__init__.py +0 -0
  299. qwak_sdk/commands/workspaces/stop/_logic.py +30 -0
  300. qwak_sdk/commands/workspaces/stop/ui.py +23 -0
  301. qwak_sdk/commands/workspaces/update/__init__.py +0 -0
  302. qwak_sdk/commands/workspaces/update/_logic.py +82 -0
  303. qwak_sdk/commands/workspaces/update/ui.py +57 -0
  304. qwak_sdk/commands/workspaces/workspaces_commands_group.py +23 -0
  305. qwak_sdk/exceptions/__init__.py +11 -0
  306. qwak_sdk/exceptions/qwak_command_exception.py +2 -0
  307. qwak_sdk/exceptions/qwak_deploy_new_build_failed.py +5 -0
  308. qwak_sdk/exceptions/qwak_resource_not_found.py +2 -0
  309. qwak_sdk/inner/__init__.py +0 -0
  310. qwak_sdk/inner/file_registry.py +98 -0
  311. qwak_sdk/inner/tools/__init__.py +0 -0
  312. qwak_sdk/inner/tools/cli_tools.py +220 -0
  313. qwak_sdk/inner/tools/config_handler.py +27 -0
  314. qwak_sdk/inner/tools/dataclasses_utils.py +21 -0
  315. qwak_sdk/inner/tools/logger/__init__.py +3 -0
  316. qwak_sdk/inner/tools/logger/logger.py +269 -0
  317. qwak_sdk/inner/tools/logger/logging.yml +79 -0
  318. qwak_sdk/inner/tools/tracking.py +47 -0
  319. qwak_sdk/main.py +9 -0
  320. qwak_sdk/tools/__init__.py +0 -0
  321. qwak_sdk/tools/colors.py +13 -0
  322. qwak_sdk/tools/files.py +63 -0
  323. qwak_sdk/tools/log_handling.py +159 -0
  324. qwak_sdk/tools/utils.py +42 -0
  325. qwak_sdk-0.5.102.dist-info/METADATA +51 -0
  326. qwak_sdk-0.5.102.dist-info/RECORD +328 -0
  327. qwak_sdk-0.5.102.dist-info/WHEEL +4 -0
  328. qwak_sdk-0.5.102.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,337 @@
1
+ import click
2
+ from qwak.inner.build_config.build_config_v1 import (
3
+ BuildConfigV1,
4
+ BuildProperties,
5
+ DockerConf,
6
+ ModelUri,
7
+ RemoteBuildResources,
8
+ )
9
+ from qwak.inner.build_logic.execute_build_pipeline import execute_build_pipeline
10
+ from qwak.inner.build_logic.run_handlers.programmatic_phase_run_handler import (
11
+ ProgrammaticPhaseRunHandler,
12
+ )
13
+ from qwak.inner.const import QwakConstants
14
+
15
+ from qwak_sdk.commands.models.build._logic.build_steps import create_pipeline
16
+ from qwak_sdk.commands.models.build._logic.wait_until_finished import wait_until_finished, is_final_status_successful
17
+ from qwak_sdk.commands.models.build._logic.client_logs.cli_phase_run_handler import (
18
+ CLIPhaseRunHandler,
19
+ )
20
+ from qwak_sdk.commands.models.build._logic.client_logs.logger import get_build_logger
21
+ from qwak_sdk.commands.models.build._logic.client_logs.utils import zip_logs
22
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
23
+ from qwak_sdk.inner.tools.config_handler import config_handler
24
+
25
+
26
+ @click.command("build", cls=QwakCommand)
27
+ @click.option(
28
+ "--model-id",
29
+ metavar="NAME",
30
+ required=False,
31
+ help="Model ID to assign the build for",
32
+ )
33
+ @click.option(
34
+ "--main-dir",
35
+ metavar="NAME",
36
+ help=f"Model main directory name, [Default: {ModelUri.main_dir}]",
37
+ )
38
+ @click.option(
39
+ "-P",
40
+ "--param-list",
41
+ required=False,
42
+ metavar="NAME=VALUE",
43
+ multiple=True,
44
+ help="A parameter for the build, of the form -P name=value. the params will be saved and can be viewed later",
45
+ )
46
+ @click.option(
47
+ "-E",
48
+ "--env-vars",
49
+ required=False,
50
+ metavar="NAME=VALUE",
51
+ multiple=True,
52
+ help="A parameter for the build, of the form -E name=value",
53
+ )
54
+ @click.option(
55
+ "-T",
56
+ "--tags",
57
+ required=False,
58
+ multiple=True,
59
+ help="A tag for the model build",
60
+ )
61
+ @click.option(
62
+ "--git-credentials",
63
+ required=False,
64
+ metavar="USERNAME:ACCESS_TOKEN",
65
+ help="Access credentials for private repositories listed in the python dependencies file",
66
+ )
67
+ @click.option(
68
+ "--git-branch",
69
+ metavar="NAME",
70
+ required=False,
71
+ help=f"Branch to use for git repo model code if defined."
72
+ f"\n[Default: {ModelUri.git_branch}]",
73
+ )
74
+ @click.option(
75
+ "--git-credentials-secret",
76
+ metavar="NAME",
77
+ required=False,
78
+ help="Predefined Qwak secret secret name, that contains access credentials to private repositories"
79
+ + "Secrets should be of the form USERNAME:ACCESS_TOKEN. For info regarding defining Qwak Secrets using the"
80
+ + "`qwak secret` command",
81
+ )
82
+ @click.option(
83
+ "--cpus",
84
+ metavar="NAME",
85
+ required=False,
86
+ help="Number of cpus to use on the remote build. [Default (If GPU not configured): 2] "
87
+ "(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
88
+ type=click.FLOAT,
89
+ )
90
+ @click.option(
91
+ "--memory",
92
+ metavar="NAME",
93
+ required=False,
94
+ help="Memory to use on the remote build. [Default (If GPU not configured): 4Gi] "
95
+ "(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
96
+ )
97
+ @click.option(
98
+ "--gpu-type",
99
+ metavar="NAME",
100
+ required=False,
101
+ help=f"Type of GPU to use on the remote build ({', '.join([x for x in QwakConstants.GPU_TYPES])})."
102
+ f"\n[Default: {RemoteBuildResources.gpu_type}]"
103
+ "(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
104
+ type=click.STRING,
105
+ )
106
+ @click.option(
107
+ "--gpu-amount",
108
+ metavar="NAME",
109
+ required=False,
110
+ type=int,
111
+ help=f"Amount of GPU's to use on the remote build."
112
+ f"\n[Default: {RemoteBuildResources.gpu_amount}] "
113
+ "(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
114
+ )
115
+ @click.option(
116
+ "--gpu-compatible",
117
+ help=f"Whether to build an image that is compatible to be deployd on a GPU instance."
118
+ f"\n[Default: {BuildProperties.gpu_compatible}] ",
119
+ default=False,
120
+ is_flag=True,
121
+ )
122
+ @click.option(
123
+ "--iam-role-arn",
124
+ required=False,
125
+ type=str,
126
+ help="Custom IAM Role ARN for AWS based builds",
127
+ )
128
+ @click.option(
129
+ "--service-account-key-secret-name",
130
+ type=str,
131
+ help="Custom service account for GCP",
132
+ )
133
+ @click.option(
134
+ "--cache/--no-cache",
135
+ default=None,
136
+ help="Disable docker build cache. [Default: Cache enabled]",
137
+ )
138
+ @click.option(
139
+ "-v",
140
+ "--verbose",
141
+ count=True,
142
+ default=None,
143
+ help="Log verbosity level - v: INFO, vv: DEBUG [default: WARNING], Default ERROR",
144
+ )
145
+ @click.option(
146
+ "--base-image",
147
+ help="Used for customizing the docker container image built for train, build and deploy."
148
+ "Docker images should be based on qwak images, The entrypoint or cmd of the docker "
149
+ "image should not be changed."
150
+ f"\n[Default: {DockerConf.base_image}]",
151
+ required=False,
152
+ )
153
+ @click.option(
154
+ "-f",
155
+ "--from-file",
156
+ help="Build by run_config file, Command arguments will overwrite any run_config.",
157
+ required=False,
158
+ type=click.Path(exists=True, resolve_path=True, dir_okay=False),
159
+ )
160
+ @click.option(
161
+ "--out-conf",
162
+ help="Extract models build conf from command arguments, the command will not run it wil only output valid yaml "
163
+ "structure",
164
+ default=False,
165
+ is_flag=True,
166
+ )
167
+ @click.option(
168
+ "--json-logs",
169
+ help="Output logs as json for easier parsing",
170
+ default=False,
171
+ is_flag=True,
172
+ )
173
+ @click.option(
174
+ "--programmatic",
175
+ help="Run the _logic without the UI and receive the build id and any exception as return values",
176
+ default=False,
177
+ is_flag=True,
178
+ )
179
+ @click.option(
180
+ "--validate-build-artifact/--no-validate-build-artifact",
181
+ help="Skip validate build artifact step",
182
+ default=None,
183
+ )
184
+ @click.option(
185
+ "--tests/--no-tests",
186
+ help="Skip tests step",
187
+ default=None,
188
+ )
189
+ @click.option(
190
+ "--dependency-file-path",
191
+ help="Custom dependency file path",
192
+ default=None,
193
+ )
194
+ @click.option(
195
+ "--validate-build-artifact-timeout",
196
+ help="Timeout in seconds for the validation step",
197
+ default=120,
198
+ )
199
+ @click.option(
200
+ "--dependency-required-folders",
201
+ help="Folder to be copied into the build. In order to copy several folders, use this flag several times",
202
+ default=None,
203
+ required=False,
204
+ multiple=True,
205
+ )
206
+ @click.option(
207
+ "--deploy",
208
+ help="Whether you want to deploy the build if it finishes successfully. "
209
+ "Choosing this will follow the build process in the terminal and will trigger a deployment when the "
210
+ "build finishes.",
211
+ default=False,
212
+ is_flag=True,
213
+ )
214
+ @click.option(
215
+ "--instance",
216
+ required=False,
217
+ type=str,
218
+ help="The instance size to build on - 'small', 'medium', 'large', etc...",
219
+ default=None,
220
+ )
221
+ @click.option(
222
+ "--deployment-instance",
223
+ required=False,
224
+ type=str,
225
+ help="The instance size to deploy on - 'small', 'medium', 'large', etc...",
226
+ default=None,
227
+ )
228
+ @click.option(
229
+ "--purchase-option",
230
+ required=False,
231
+ type=str,
232
+ help="The type of the instance to build on - 'ondemand' or 'spot'",
233
+ default=None,
234
+ )
235
+ @click.option(
236
+ "--id-only",
237
+ help="Receiving only the build id and any exception as return values (Depends on "
238
+ "--programmatic in order to avoid UI output too)",
239
+ default=False,
240
+ is_flag=True,
241
+ )
242
+ @click.option(
243
+ "--sync",
244
+ help="Waits until the build is finished (successfully or not) and return the build status",
245
+ default=False,
246
+ is_flag=True,
247
+ )
248
+ @click.option(
249
+ "--git-secret-ssh",
250
+ metavar="NAME",
251
+ required=False,
252
+ help="[REMOTE BUILD] Predefined Qwak ssh secret name, that contains access credentials to private repositories"
253
+ + "secret ssh key should contain the private ssh key."
254
+ + "`qwak secret` command",
255
+ )
256
+ @click.option(
257
+ "--push/--no-push",
258
+ help="Whether to push the build image to the registry (default is True)",
259
+ default=True,
260
+ is_flag=True,
261
+ )
262
+ @click.option(
263
+ "--provision-instance-timeout",
264
+ help="Timeout in minutes for the provision instance step",
265
+ default=120,
266
+ )
267
+ @click.option(
268
+ "-N",
269
+ "--name",
270
+ "build_name",
271
+ required=False,
272
+ help="The build's name",
273
+ )
274
+ @click.argument("uri", required=False)
275
+ def models_build(**kwargs):
276
+ return build(**kwargs)
277
+
278
+
279
+ def build(
280
+ from_file: str,
281
+ out_conf: bool,
282
+ json_logs: bool,
283
+ programmatic: bool,
284
+ **kwargs,
285
+ ):
286
+ # If QWAK_DEBUG=true is set then the artifacts will not be deleted, all intermediate files located in ~/.qwak/builds
287
+ # Including all intermediate images
288
+ config: BuildConfigV1 = config_handler(
289
+ config=BuildConfigV1,
290
+ from_file=from_file,
291
+ out_conf=out_conf,
292
+ **kwargs,
293
+ )
294
+ if out_conf:
295
+ return
296
+ else:
297
+ id_only = kwargs.get("id_only")
298
+ is_sync = kwargs.get("sync")
299
+ pipeline, success_msg = create_pipeline(config)
300
+ with get_build_logger(config=config, json_logs=json_logs) as (
301
+ logger,
302
+ log_path,
303
+ ):
304
+ if programmatic:
305
+ build_runner = ProgrammaticPhaseRunHandler(
306
+ logger, config.verbose, json_logs
307
+ )
308
+ else:
309
+ build_runner = CLIPhaseRunHandler(
310
+ logger, log_path, config.verbose, json_logs
311
+ )
312
+
313
+ execute_build_pipeline(
314
+ pipeline,
315
+ build_runner,
316
+ )
317
+
318
+ if is_sync:
319
+ wait_until_finished(pipeline.context.build_id, logger)
320
+ if not is_final_status_successful(pipeline.context.build_id):
321
+ click.echo(f"Build {pipeline.context.build_id} failed")
322
+ exit(1)
323
+
324
+ if id_only:
325
+ print(pipeline.context.build_id)
326
+ else:
327
+ print(
328
+ success_msg.format(
329
+ base_url=pipeline.context.platform_url,
330
+ build_id=pipeline.context.build_id,
331
+ model_id=pipeline.context.model_id,
332
+ project_uuid=pipeline.context.project_uuid,
333
+ )
334
+ )
335
+ zip_logs(log_path=log_path, build_id=pipeline.context.build_id)
336
+
337
+ return pipeline.context.build_id
File without changes
@@ -0,0 +1,16 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.builds.cancel.ui import cancel_build
4
+ from qwak_sdk.commands.models.builds.logs.ui import build_logs
5
+ from qwak_sdk.commands.models.builds.status.ui import get_build_status
6
+
7
+
8
+ @click.group(name="builds", help="Ongoing builds")
9
+ def builds_commands_group():
10
+ # Click commands group injection
11
+ pass
12
+
13
+
14
+ builds_commands_group.add_command(cancel_build)
15
+ builds_commands_group.add_command(get_build_status)
16
+ builds_commands_group.add_command(build_logs)
File without changes
@@ -0,0 +1,5 @@
1
+ from qwak.clients.build_orchestrator import BuildOrchestratorClient
2
+
3
+
4
+ def execute_cancel_build(build_id):
5
+ return BuildOrchestratorClient().cancel_build_model(build_id=build_id)
@@ -0,0 +1,15 @@
1
+ import click
2
+ from qwak.tools.logger.logger import get_qwak_logger
3
+
4
+ from qwak_sdk.commands.models.builds.cancel._logic import execute_cancel_build
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+
7
+ logger = get_qwak_logger()
8
+
9
+
10
+ @click.command("cancel", cls=QwakCommand)
11
+ @click.argument("build_id")
12
+ def cancel_build(build_id, **kwargs):
13
+ logger.info(f"Attempting to cancel remote build with build id [{build_id}]")
14
+ execute_cancel_build(build_id=build_id)
15
+ logger.info("Successfully canceled remote build")
File without changes
@@ -0,0 +1,35 @@
1
+ import click
2
+
3
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
4
+ from qwak_sdk.tools.log_handling import QwakLogHandling
5
+
6
+
7
+ @click.command("logs", cls=QwakCommand)
8
+ @click.option("-f", "--follow", is_flag=True, default=False, help="Follow log tail")
9
+ @click.option(
10
+ "-b", "--build-id", required=True, help="Runtime model Build ID to show logs of"
11
+ )
12
+ @click.option(
13
+ "-s",
14
+ "--since",
15
+ required=False,
16
+ metavar="X [TYPE] ago",
17
+ help=f"Get logs from X1 [type] X2 [type]... Xn [type] ago. "
18
+ f"(x = INT; type = {QwakLogHandling.TIME_UNITS}) i.e. [1 day 2 hours ago]",
19
+ )
20
+ @click.option(
21
+ "-n",
22
+ "--number-of-results",
23
+ required=False,
24
+ type=int,
25
+ help="Maximum number of results per query",
26
+ )
27
+ @click.option(
28
+ "-g", "--grep", required=False, help="Filter by log content contains [expression]"
29
+ )
30
+ def build_logs(
31
+ follow=True, build_id=None, since=None, number_of_results=None, grep=None, **kwargs
32
+ ):
33
+ QwakLogHandling().get_logs(
34
+ follow, since, number_of_results, grep, {"build_id": build_id}, "build"
35
+ )
File without changes
@@ -0,0 +1,6 @@
1
+ from _qwak_proto.qwak.build.v1.build_pb2 import BuildStatus
2
+ from qwak.clients.build_orchestrator import BuildOrchestratorClient
3
+
4
+
5
+ def execute_get_build_status(build_id) -> BuildStatus:
6
+ return BuildOrchestratorClient().get_build(build_id).build.build_status
@@ -0,0 +1,39 @@
1
+ import json
2
+
3
+ import click
4
+ from _qwak_proto.qwak.build.v1.build_pb2 import BuildStatus
5
+ from qwak.tools.logger.logger import get_qwak_logger
6
+
7
+ from qwak_sdk.commands.models.builds.status._logic import execute_get_build_status
8
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
9
+
10
+ logger = get_qwak_logger()
11
+
12
+
13
+ @click.command("status", cls=QwakCommand)
14
+ @click.argument("build_id")
15
+ @click.option(
16
+ "--format",
17
+ default="text",
18
+ show_default=True,
19
+ type=click.Choice(["text", "json"], case_sensitive=True),
20
+ metavar="FORMAT",
21
+ required=False,
22
+ help="The formatting style for commands output (choose from text, json)",
23
+ )
24
+ def get_build_status(build_id, format, **kwargs):
25
+ if format == "text":
26
+ logger.info(f"Getting build status for build id [{build_id}]")
27
+ build_status = execute_get_build_status(build_id)
28
+ if format == "text":
29
+ logger.info(f"Build status: {BuildStatus.Name(build_status)}")
30
+ elif format == "json":
31
+ print(
32
+ json.dumps(
33
+ {
34
+ "build_id": build_id,
35
+ "build_status": BuildStatus.Name(build_status),
36
+ }
37
+ )
38
+ )
39
+ return BuildStatus.Name(build_status)
File without changes
@@ -0,0 +1,36 @@
1
+ from _qwak_proto.qwak.projects.projects_pb2 import (
2
+ CreateProjectResponse,
3
+ GetProjectResponse,
4
+ )
5
+ from qwak.clients.model_management import ModelsManagementClient
6
+ from qwak.clients.project.client import ProjectsManagementClient
7
+ from qwak.exceptions import QwakException
8
+
9
+ from qwak_sdk.exceptions import QwakCommandException
10
+
11
+
12
+ def execute_model_create(model_name, model_description, project, project_id):
13
+ if not (project or project_id):
14
+ raise QwakCommandException("You nust supply either project or project_id")
15
+
16
+ if project_id:
17
+ resolved_project_id = project_id
18
+ else:
19
+ try:
20
+ project: GetProjectResponse = ProjectsManagementClient().get_project(
21
+ project_id="", project_name=project
22
+ )
23
+ resolved_project_id = project.project.spec.project_id
24
+ except QwakException:
25
+ print(f"Project with name {project} doesn't exist. Creating it.")
26
+ project_creation: CreateProjectResponse = (
27
+ ProjectsManagementClient().create_project(
28
+ project_name=project,
29
+ project_description="",
30
+ )
31
+ )
32
+ resolved_project_id = project_creation.project.project_id
33
+
34
+ return ModelsManagementClient().create_model(
35
+ resolved_project_id, model_name, model_description
36
+ )
@@ -0,0 +1,43 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.create._logic import execute_model_create
4
+ from qwak_sdk.commands.ui_tools import output_as_json
5
+ from qwak_sdk.inner.tools.cli_tools import QwakCommand
6
+ from qwak_sdk.tools.colors import Color
7
+
8
+
9
+ @click.command("create", cls=QwakCommand)
10
+ @click.argument("name", metavar="name", required=True)
11
+ @click.option("--project", metavar="NAME", required=False, help="Project name")
12
+ @click.option("--project-id", metavar="ID", required=False, help="Project id")
13
+ @click.option(
14
+ "--description",
15
+ metavar="DESCRIPTION",
16
+ required=False,
17
+ help="Model description",
18
+ )
19
+ @click.option(
20
+ "--format",
21
+ default="text",
22
+ show_default=True,
23
+ type=click.Choice(["text", "json"], case_sensitive=True),
24
+ metavar="FORMAT",
25
+ required=False,
26
+ help="The formatting style for commands output (choose from text, json)",
27
+ )
28
+ def model_create(
29
+ name,
30
+ description,
31
+ project,
32
+ project_id,
33
+ format,
34
+ **kwargs,
35
+ ):
36
+ try:
37
+ response = execute_model_create(name, description, project, project_id)
38
+ if format == "json":
39
+ output_as_json(response)
40
+ else:
41
+ print(f"Model created\nmodel id : {response.model_id}")
42
+ except Exception as e:
43
+ print(f"{Color.RED}Error creating model: {e}{Color.RED}")
File without changes
@@ -0,0 +1,5 @@
1
+ from qwak.clients.model_management import ModelsManagementClient
2
+
3
+
4
+ def execute_model_delete(project_id, model_id):
5
+ return ModelsManagementClient().delete_model(project_id, model_id)
@@ -0,0 +1,25 @@
1
+ import click
2
+
3
+ from qwak_sdk.commands.models.delete._logic import execute_model_delete
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("delete", cls=QwakCommand)
9
+ @click.option("--project-id", metavar="NAME", required=True, help="Project id")
10
+ @click.option("--model-id", metavar="NAME", required=True, help="Model name")
11
+ @click.option(
12
+ "--format",
13
+ default="text",
14
+ show_default=True,
15
+ type=click.Choice(["text", "json"], case_sensitive=True),
16
+ metavar="FORMAT",
17
+ required=False,
18
+ help="The formatting style for commands output (choose from text, json)",
19
+ )
20
+ def model_delete(project_id, model_id, format, **kwargs):
21
+ response = execute_model_delete(project_id, model_id)
22
+ if format == "json":
23
+ output_as_json(response)
24
+ else:
25
+ print(f"Model deleted\nmodel id : {model_id}")
File without changes
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ from _qwak_proto.qwak.deployment.deployment_pb2 import (
4
+ AdvancedDeploymentOptions,
5
+ KubeDeploymentType,
6
+ )
7
+ from qwak.exceptions import QwakException
8
+
9
+ from qwak_sdk.commands.models.deployments.deploy.batch._logic.advanced_deployment_mapper import (
10
+ batch_advanced_deployment_options_from_deploy_config,
11
+ )
12
+ from qwak_sdk.commands.models.deployments.deploy.realtime._logic.advanced_deployment_mapper import (
13
+ realtime_advanced_deployment_options_from_deploy_config,
14
+ )
15
+
16
+ ADVANCED_DEPLOYMENT_UNRECOGNIZED_TYPE_ERROR = (
17
+ "The deployments type doesn't have an advanced deployments options configured"
18
+ )
19
+
20
+
21
+ def get_advanced_deployment_options_from_deploy_config(
22
+ deploy_config, kube_deployment_type
23
+ ) -> AdvancedDeploymentOptions:
24
+ if kube_deployment_type == KubeDeploymentType.ONLINE:
25
+ return realtime_advanced_deployment_options_from_deploy_config(deploy_config)
26
+ elif kube_deployment_type == KubeDeploymentType.BATCH:
27
+ return batch_advanced_deployment_options_from_deploy_config(deploy_config)
28
+ elif kube_deployment_type == KubeDeploymentType.STREAM:
29
+ return AdvancedDeploymentOptions()
30
+ else:
31
+ raise QwakException(ADVANCED_DEPLOYMENT_UNRECOGNIZED_TYPE_ERROR)