frogml-cli 0.0.1__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 (287) hide show
  1. frogml_cli/__init__.py +10 -0
  2. frogml_cli/cli.py +40 -0
  3. frogml_cli/commands/__init__.py +0 -0
  4. frogml_cli/commands/_logic/__init__.py +0 -0
  5. frogml_cli/commands/_logic/tools.py +6 -0
  6. frogml_cli/commands/alerts/__init__.py +0 -0
  7. frogml_cli/commands/alerts/alerts_commnad_group.py +18 -0
  8. frogml_cli/commands/alerts/delete/__init__.py +0 -0
  9. frogml_cli/commands/alerts/delete/_logic.py +5 -0
  10. frogml_cli/commands/alerts/delete/ui.py +10 -0
  11. frogml_cli/commands/alerts/list/__init__.py +0 -0
  12. frogml_cli/commands/alerts/list/_logic.py +23 -0
  13. frogml_cli/commands/alerts/list/ui.py +17 -0
  14. frogml_cli/commands/alerts/register/__init__.py +0 -0
  15. frogml_cli/commands/alerts/register/_logic.py +72 -0
  16. frogml_cli/commands/alerts/register/ui.py +30 -0
  17. frogml_cli/commands/audience/__init__.py +0 -0
  18. frogml_cli/commands/audience/_logic/__init__.py +0 -0
  19. frogml_cli/commands/audience/_logic/config/__init__.py +0 -0
  20. frogml_cli/commands/audience/_logic/config/config_base.py +15 -0
  21. frogml_cli/commands/audience/_logic/config/parser.py +30 -0
  22. frogml_cli/commands/audience/_logic/config/v1/__init__.py +0 -0
  23. frogml_cli/commands/audience/_logic/config/v1/audience_config.py +25 -0
  24. frogml_cli/commands/audience/_logic/config/v1/conditions_config.py +59 -0
  25. frogml_cli/commands/audience/_logic/config/v1/config_v1.py +23 -0
  26. frogml_cli/commands/audience/_logic/config/v1/route_config.py +15 -0
  27. frogml_cli/commands/audience/_logic/config/v1/spec.py +9 -0
  28. frogml_cli/commands/audience/audience_api_dump.py +86 -0
  29. frogml_cli/commands/audience/audience_commands_group.py +30 -0
  30. frogml_cli/commands/audience/create/__init__.py +0 -0
  31. frogml_cli/commands/audience/create/logic.py +41 -0
  32. frogml_cli/commands/audience/create/ui.py +21 -0
  33. frogml_cli/commands/audience/delete/__init__.py +0 -0
  34. frogml_cli/commands/audience/delete/logic.py +13 -0
  35. frogml_cli/commands/audience/delete/ui.py +17 -0
  36. frogml_cli/commands/audience/get/__init__.py +0 -0
  37. frogml_cli/commands/audience/get/logic.py +14 -0
  38. frogml_cli/commands/audience/get/ui.py +25 -0
  39. frogml_cli/commands/audience/list/__init__.py +0 -0
  40. frogml_cli/commands/audience/list/logic.py +16 -0
  41. frogml_cli/commands/audience/list/ui.py +26 -0
  42. frogml_cli/commands/audience/update/__init__.py +0 -0
  43. frogml_cli/commands/audience/update/logic.py +37 -0
  44. frogml_cli/commands/audience/update/ui.py +26 -0
  45. frogml_cli/commands/auto_scalling/__init__.py +0 -0
  46. frogml_cli/commands/auto_scalling/_logic/__init__.py +0 -0
  47. frogml_cli/commands/auto_scalling/_logic/config/__init__.py +3 -0
  48. frogml_cli/commands/auto_scalling/_logic/config/config.py +152 -0
  49. frogml_cli/commands/auto_scalling/_logic/config/parser.py +21 -0
  50. frogml_cli/commands/auto_scalling/attach/__init__.py +0 -0
  51. frogml_cli/commands/auto_scalling/attach/_logic.py +43 -0
  52. frogml_cli/commands/auto_scalling/attach/ui.py +21 -0
  53. frogml_cli/commands/auto_scalling/autoscaling_commands_group.py +15 -0
  54. frogml_cli/commands/automations/__init__.py +0 -0
  55. frogml_cli/commands/automations/automations_commands_group.py +30 -0
  56. frogml_cli/commands/automations/delete/__init__.py +0 -0
  57. frogml_cli/commands/automations/delete/_logic.py +6 -0
  58. frogml_cli/commands/automations/delete/ui.py +23 -0
  59. frogml_cli/commands/automations/executions/__init__.py +0 -0
  60. frogml_cli/commands/automations/executions/executions_commands_group.py +14 -0
  61. frogml_cli/commands/automations/executions/list/__init__.py +0 -0
  62. frogml_cli/commands/automations/executions/list/_logic.py +8 -0
  63. frogml_cli/commands/automations/executions/list/ui.py +27 -0
  64. frogml_cli/commands/automations/list/__init__.py +0 -0
  65. frogml_cli/commands/automations/list/_logic.py +36 -0
  66. frogml_cli/commands/automations/list/ui.py +21 -0
  67. frogml_cli/commands/automations/register/__init__.py +0 -0
  68. frogml_cli/commands/automations/register/_logic.py +43 -0
  69. frogml_cli/commands/automations/register/ui.py +44 -0
  70. frogml_cli/commands/config/__init__.py +0 -0
  71. frogml_cli/commands/config/add/__init__.py +0 -0
  72. frogml_cli/commands/config/add/ui.py +62 -0
  73. frogml_cli/commands/config/config_commands_group.py +11 -0
  74. frogml_cli/commands/feature_store/__init__.py +0 -0
  75. frogml_cli/commands/feature_store/backfill/__init__.py +0 -0
  76. frogml_cli/commands/feature_store/backfill/_logic.py +140 -0
  77. frogml_cli/commands/feature_store/backfill/ui.py +129 -0
  78. frogml_cli/commands/feature_store/delete/__init__.py +0 -0
  79. frogml_cli/commands/feature_store/delete/_logic.py +107 -0
  80. frogml_cli/commands/feature_store/delete/ui.py +40 -0
  81. frogml_cli/commands/feature_store/execution/__init__.py +0 -0
  82. frogml_cli/commands/feature_store/execution/ui.py +19 -0
  83. frogml_cli/commands/feature_store/feature_store_command_group.py +29 -0
  84. frogml_cli/commands/feature_store/list/__init__.py +0 -0
  85. frogml_cli/commands/feature_store/list/ui.py +140 -0
  86. frogml_cli/commands/feature_store/pause/__init__.py +0 -0
  87. frogml_cli/commands/feature_store/pause/ui.py +18 -0
  88. frogml_cli/commands/feature_store/register/__init__.py +0 -0
  89. frogml_cli/commands/feature_store/register/_logic.py +369 -0
  90. frogml_cli/commands/feature_store/register/ui.py +111 -0
  91. frogml_cli/commands/feature_store/resume/__init__.py +0 -0
  92. frogml_cli/commands/feature_store/resume/ui.py +18 -0
  93. frogml_cli/commands/feature_store/trigger/__init__.py +0 -0
  94. frogml_cli/commands/feature_store/trigger/ui.py +39 -0
  95. frogml_cli/commands/models/__init__.py +0 -0
  96. frogml_cli/commands/models/build/__init__.py +0 -0
  97. frogml_cli/commands/models/build/_logic/__init__.py +0 -0
  98. frogml_cli/commands/models/build/_logic/build_steps.py +42 -0
  99. frogml_cli/commands/models/build/_logic/client_logs/__init__.py +0 -0
  100. frogml_cli/commands/models/build/_logic/client_logs/cli_phase_run_handler.py +123 -0
  101. frogml_cli/commands/models/build/_logic/client_logs/cli_trigger_build_logger.py +19 -0
  102. frogml_cli/commands/models/build/_logic/client_logs/logger.py +88 -0
  103. frogml_cli/commands/models/build/_logic/client_logs/messages.py +36 -0
  104. frogml_cli/commands/models/build/_logic/client_logs/spinner.py +14 -0
  105. frogml_cli/commands/models/build/_logic/client_logs/trigger_build_logger.py +54 -0
  106. frogml_cli/commands/models/build/_logic/client_logs/utils.py +12 -0
  107. frogml_cli/commands/models/build/_logic/phase/__init__.py +0 -0
  108. frogml_cli/commands/models/build/_logic/phase/a_fetch_model_code/__init__.py +20 -0
  109. frogml_cli/commands/models/build/_logic/phase/a_fetch_model_code/get_sdk_version_step.py +15 -0
  110. frogml_cli/commands/models/build/_logic/phase/b_remote_register_frogml_build/__init__.py +16 -0
  111. frogml_cli/commands/models/build/_logic/phase/c_deploy/__init__.py +6 -0
  112. frogml_cli/commands/models/build/_logic/phase/c_deploy/build_polling_status.py +55 -0
  113. frogml_cli/commands/models/build/_logic/phase/c_deploy/deploy_build.py +61 -0
  114. frogml_cli/commands/models/build/_logic/util/__init__.py +0 -0
  115. frogml_cli/commands/models/build/_logic/util/protobuf_factory.py +45 -0
  116. frogml_cli/commands/models/build/_logic/util/step_decorator.py +60 -0
  117. frogml_cli/commands/models/build/_logic/util/text.py +9 -0
  118. frogml_cli/commands/models/build/_logic/wait_until_finished.py +27 -0
  119. frogml_cli/commands/models/build/ui.py +337 -0
  120. frogml_cli/commands/models/builds/__init__.py +0 -0
  121. frogml_cli/commands/models/builds/builds_commands_group.py +16 -0
  122. frogml_cli/commands/models/builds/cancel/__init__.py +0 -0
  123. frogml_cli/commands/models/builds/cancel/_logic.py +5 -0
  124. frogml_cli/commands/models/builds/cancel/ui.py +15 -0
  125. frogml_cli/commands/models/builds/logs/__init__.py +0 -0
  126. frogml_cli/commands/models/builds/logs/ui.py +35 -0
  127. frogml_cli/commands/models/builds/status/__init__.py +0 -0
  128. frogml_cli/commands/models/builds/status/_logic.py +6 -0
  129. frogml_cli/commands/models/builds/status/ui.py +39 -0
  130. frogml_cli/commands/models/create/__init__.py +0 -0
  131. frogml_cli/commands/models/create/_logic.py +40 -0
  132. frogml_cli/commands/models/create/ui.py +46 -0
  133. frogml_cli/commands/models/delete/__init__.py +0 -0
  134. frogml_cli/commands/models/delete/_logic.py +18 -0
  135. frogml_cli/commands/models/delete/ui.py +25 -0
  136. frogml_cli/commands/models/deployments/__init__.py +0 -0
  137. frogml_cli/commands/models/deployments/deploy/__init__.py +0 -0
  138. frogml_cli/commands/models/deployments/deploy/_logic/__init__.py +0 -0
  139. frogml_cli/commands/models/deployments/deploy/_logic/advance_deployment_options_handler.py +31 -0
  140. frogml_cli/commands/models/deployments/deploy/_logic/base_deploy_executor.py +70 -0
  141. frogml_cli/commands/models/deployments/deploy/_logic/deploy_config.py +261 -0
  142. frogml_cli/commands/models/deployments/deploy/_logic/deployment.py +407 -0
  143. frogml_cli/commands/models/deployments/deploy/_logic/deployment_message_helpers.py +116 -0
  144. frogml_cli/commands/models/deployments/deploy/_logic/deployment_response_handler.py +156 -0
  145. frogml_cli/commands/models/deployments/deploy/_logic/deployment_size_mapper.py +98 -0
  146. frogml_cli/commands/models/deployments/deploy/_logic/get_latest_successful_build.py +28 -0
  147. frogml_cli/commands/models/deployments/deploy/_logic/local_deployment.py +193 -0
  148. frogml_cli/commands/models/deployments/deploy/batch/__init__.py +0 -0
  149. frogml_cli/commands/models/deployments/deploy/batch/_logic/__init__.py +0 -0
  150. frogml_cli/commands/models/deployments/deploy/batch/_logic/advanced_deployment_mapper.py +15 -0
  151. frogml_cli/commands/models/deployments/deploy/batch/_logic/deploy_executor.py +24 -0
  152. frogml_cli/commands/models/deployments/deploy/batch/ui.py +119 -0
  153. frogml_cli/commands/models/deployments/deploy/deploy_commands_group.py +19 -0
  154. frogml_cli/commands/models/deployments/deploy/realtime/__init__.py +0 -0
  155. frogml_cli/commands/models/deployments/deploy/realtime/_logic/__init__.py +0 -0
  156. frogml_cli/commands/models/deployments/deploy/realtime/_logic/advanced_deployment_mapper.py +21 -0
  157. frogml_cli/commands/models/deployments/deploy/realtime/_logic/deploy_executor.py +24 -0
  158. frogml_cli/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py +75 -0
  159. frogml_cli/commands/models/deployments/deploy/realtime/ui.py +202 -0
  160. frogml_cli/commands/models/deployments/deploy/streaming/__init__.py +0 -0
  161. frogml_cli/commands/models/deployments/deploy/streaming/_logic/__init__.py +0 -0
  162. frogml_cli/commands/models/deployments/deploy/streaming/_logic/deploy_executor.py +24 -0
  163. frogml_cli/commands/models/deployments/deploy/streaming/_logic/serving_strategy_mapper.py +38 -0
  164. frogml_cli/commands/models/deployments/deploy/streaming/ui.py +206 -0
  165. frogml_cli/commands/models/deployments/undeploy/__init__.py +0 -0
  166. frogml_cli/commands/models/deployments/undeploy/_logic/__init__.py +0 -0
  167. frogml_cli/commands/models/deployments/undeploy/_logic/request_undeploy.py +249 -0
  168. frogml_cli/commands/models/deployments/undeploy/ui.py +61 -0
  169. frogml_cli/commands/models/describe/__init__.py +0 -0
  170. frogml_cli/commands/models/describe/_logic.py +169 -0
  171. frogml_cli/commands/models/describe/ui.py +35 -0
  172. frogml_cli/commands/models/executions/__init__.py +0 -0
  173. frogml_cli/commands/models/executions/cancel/__init__.py +0 -0
  174. frogml_cli/commands/models/executions/cancel/_logic.py +9 -0
  175. frogml_cli/commands/models/executions/cancel/ui.py +27 -0
  176. frogml_cli/commands/models/executions/execution_commands_group.py +24 -0
  177. frogml_cli/commands/models/executions/report/__init__.py +0 -0
  178. frogml_cli/commands/models/executions/report/_logic.py +14 -0
  179. frogml_cli/commands/models/executions/report/ui.py +43 -0
  180. frogml_cli/commands/models/executions/start/__init__.py +0 -0
  181. frogml_cli/commands/models/executions/start/_logic.py +83 -0
  182. frogml_cli/commands/models/executions/start/ui.py +208 -0
  183. frogml_cli/commands/models/executions/status/__init__.py +0 -0
  184. frogml_cli/commands/models/executions/status/_logic.py +13 -0
  185. frogml_cli/commands/models/executions/status/ui.py +27 -0
  186. frogml_cli/commands/models/init/__init__.py +0 -0
  187. frogml_cli/commands/models/init/_logic/__init__.py +0 -0
  188. frogml_cli/commands/models/init/_logic/initialize_model_structure.py +40 -0
  189. frogml_cli/commands/models/init/_logic/template/__init__.py +0 -0
  190. frogml_cli/commands/models/init/_logic/template/churn/__init__.py +0 -0
  191. frogml_cli/commands/models/init/_logic/template/churn/cookiecutter.json +3 -0
  192. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/__init__.py +0 -0
  193. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  194. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
  195. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  196. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/model.py +99 -0
  197. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  198. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  199. frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/test_churn.py +32 -0
  200. frogml_cli/commands/models/init/_logic/template/credit_risk/__init__.py +0 -0
  201. frogml_cli/commands/models/init/_logic/template/credit_risk/cookiecutter.json +3 -0
  202. frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/__init__.py +0 -0
  203. frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  204. frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
  205. frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
  206. frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py +108 -0
  207. frogml_cli/commands/models/init/_logic/template/general/__init__.py +0 -0
  208. frogml_cli/commands/models/init/_logic/template/general/cookiecutter.json +6 -0
  209. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py +0 -0
  210. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py +5 -0
  211. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml +8 -0
  212. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/model.py +66 -0
  213. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/__init__.py +0 -0
  214. frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/test_qwak_model.py +5 -0
  215. frogml_cli/commands/models/init/_logic/template/titanic/__init__.py +0 -0
  216. frogml_cli/commands/models/init/_logic/template/titanic/cookiecutter.json +3 -0
  217. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/__init__.py +0 -0
  218. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  219. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
  220. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/model.py +98 -0
  221. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  222. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  223. frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +24 -0
  224. frogml_cli/commands/models/init/_logic/template/titanic_poetry/__init__.py +0 -0
  225. frogml_cli/commands/models/init/_logic/template/titanic_poetry/cookiecutter.json +3 -0
  226. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/__init__.py +0 -0
  227. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
  228. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/model.py +98 -0
  229. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/pyproject.toml +20 -0
  230. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
  231. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
  232. frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +25 -0
  233. frogml_cli/commands/models/init/ui.py +61 -0
  234. frogml_cli/commands/models/list/__init__.py +0 -0
  235. frogml_cli/commands/models/list/_logic.py +5 -0
  236. frogml_cli/commands/models/list/ui.py +41 -0
  237. frogml_cli/commands/models/list_models/__init__.py +0 -0
  238. frogml_cli/commands/models/list_models/_logic.py +11 -0
  239. frogml_cli/commands/models/list_models/ui.py +60 -0
  240. frogml_cli/commands/models/metadata/__init__.py +0 -0
  241. frogml_cli/commands/models/metadata/_logic.py +12 -0
  242. frogml_cli/commands/models/metadata/ui.py +60 -0
  243. frogml_cli/commands/models/models_command_group.py +44 -0
  244. frogml_cli/commands/models/runtime/__init__.py +0 -0
  245. frogml_cli/commands/models/runtime/logs/__init__.py +0 -0
  246. frogml_cli/commands/models/runtime/logs/ui.py +63 -0
  247. frogml_cli/commands/models/runtime/runtime_commands_group.py +17 -0
  248. frogml_cli/commands/models/runtime/update/__init__.py +0 -0
  249. frogml_cli/commands/models/runtime/update/_logic.py +9 -0
  250. frogml_cli/commands/models/runtime/update/ui.py +17 -0
  251. frogml_cli/commands/secrets/__init__.py +0 -0
  252. frogml_cli/commands/secrets/delete/__init__.py +0 -0
  253. frogml_cli/commands/secrets/delete/_logic.py +5 -0
  254. frogml_cli/commands/secrets/delete/ui.py +21 -0
  255. frogml_cli/commands/secrets/get/__init__.py +0 -0
  256. frogml_cli/commands/secrets/get/_logic.py +5 -0
  257. frogml_cli/commands/secrets/get/ui.py +17 -0
  258. frogml_cli/commands/secrets/secrets_commands_group.py +19 -0
  259. frogml_cli/commands/secrets/set/__init__.py +0 -0
  260. frogml_cli/commands/secrets/set/_logic.py +5 -0
  261. frogml_cli/commands/secrets/set/ui.py +16 -0
  262. frogml_cli/commands/ui_tools.py +18 -0
  263. frogml_cli/exceptions/__init__.py +14 -0
  264. frogml_cli/exceptions/frogml_command_exception.py +2 -0
  265. frogml_cli/exceptions/frogml_deploy_new_build_failed.py +5 -0
  266. frogml_cli/exceptions/frogml_resource_not_found.py +2 -0
  267. frogml_cli/inner/__init__.py +0 -0
  268. frogml_cli/inner/file_registry.py +98 -0
  269. frogml_cli/inner/tools/__init__.py +0 -0
  270. frogml_cli/inner/tools/cli_tools.py +179 -0
  271. frogml_cli/inner/tools/config_handler.py +29 -0
  272. frogml_cli/inner/tools/dataclasses_utils.py +21 -0
  273. frogml_cli/inner/tools/logger/__init__.py +3 -0
  274. frogml_cli/inner/tools/logger/logger.py +278 -0
  275. frogml_cli/inner/tools/logger/logging.yml +79 -0
  276. frogml_cli/inner/tools/tracking.py +47 -0
  277. frogml_cli/main.py +9 -0
  278. frogml_cli/tools/__init__.py +0 -0
  279. frogml_cli/tools/colors.py +13 -0
  280. frogml_cli/tools/const.py +3 -0
  281. frogml_cli/tools/files.py +63 -0
  282. frogml_cli/tools/log_handling.py +159 -0
  283. frogml_cli/tools/utils.py +45 -0
  284. frogml_cli-0.0.1.dist-info/METADATA +51 -0
  285. frogml_cli-0.0.1.dist-info/RECORD +287 -0
  286. frogml_cli-0.0.1.dist-info/WHEEL +4 -0
  287. frogml_cli-0.0.1.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,83 @@
1
+ from typing import Tuple
2
+
3
+ from frogml.core.clients.batch_job_management import BatchJobManagerClient
4
+ from frogml.core.clients.batch_job_management.executions_config import ExecutionConfig
5
+ from frogml.core.clients.batch_job_management.results import StartExecutionResult
6
+ from frogml.core.clients.instance_template.client import (
7
+ InstanceTemplateManagementClient,
8
+ )
9
+ from frogml.core.tools.logger.logger import get_frogml_logger
10
+ from frogml_inference.batch_client.instance_validation import verify_template_id
11
+
12
+ logger = get_frogml_logger()
13
+
14
+
15
+ def execute_start_execution(config: ExecutionConfig) -> Tuple[str, bool, str]:
16
+ if config.resources.instance_size:
17
+ verify_template_id(
18
+ config.resources.instance_size, InstanceTemplateManagementClient()
19
+ )
20
+ batch_job_start_response: StartExecutionResult = (
21
+ BatchJobManagerClient().start_execution(config)
22
+ )
23
+ return (
24
+ batch_job_start_response.execution_id,
25
+ batch_job_start_response.success,
26
+ batch_job_start_response.failure_message,
27
+ )
28
+
29
+
30
+ def execute_in_local_mode(kwargs):
31
+ from frogml_inference.batch_client.batch_client import BatchInferenceClient
32
+
33
+ logger.info("Executing a batch run in local file mode...")
34
+
35
+ model_id = kwargs.get("model_id")
36
+ source_folder = kwargs.get("source_folder")
37
+ destination_folder = kwargs.get("destination_folder")
38
+ input_file_type = kwargs.get("input_file_type")
39
+ output_file_type = kwargs.get("output_file_type", None)
40
+ job_timeout = kwargs.get("job_timeout", 0)
41
+ task_timeout = kwargs.get("task_timeout", 0)
42
+ executors = kwargs.get("executors", None)
43
+ cpus = kwargs.get("cpus", None)
44
+ memory = kwargs.get("memory", None)
45
+ gpus = kwargs.get("gpus", 0)
46
+ gpu_type = kwargs.get("gpu_type", None)
47
+ iam_role_arn = kwargs.get("iam_role_arn", None)
48
+ build_id = kwargs.get("build_id", None)
49
+ parameters = kwargs.get("parameters", None)
50
+ instance = kwargs.get("instance", "")
51
+
52
+ if (
53
+ not model_id
54
+ or not source_folder
55
+ or not destination_folder
56
+ or not input_file_type
57
+ ):
58
+ raise ValueError(
59
+ "model-id, source-folder, destination-folder and input-file-type are required"
60
+ )
61
+
62
+ client = BatchInferenceClient()
63
+ client.local_file_run(
64
+ model_id=model_id,
65
+ source_folder=source_folder,
66
+ destination_folder=destination_folder,
67
+ input_file_type=input_file_type,
68
+ output_file_type=output_file_type,
69
+ job_timeout=job_timeout,
70
+ task_timeout=task_timeout,
71
+ executors=executors,
72
+ cpus=cpus,
73
+ memory=memory,
74
+ gpus=gpus,
75
+ gpu_type=gpu_type,
76
+ iam_role_arn=iam_role_arn,
77
+ build_id=build_id,
78
+ parameters=parameters,
79
+ instance=instance,
80
+ )
81
+ logger.info(
82
+ "Batch run completed successfully. Results are available in the destination folder."
83
+ )
@@ -0,0 +1,208 @@
1
+ import click
2
+ from frogml.core.clients.batch_job_management.executions_config import (
3
+ GPU_TYPE_MAP,
4
+ INPUT_FORMATTERS_MAP,
5
+ OUTPUT_FORMATTERS_MAP,
6
+ ExecutionConfig,
7
+ )
8
+ from frogml.core.exceptions import FrogmlException
9
+ from frogml.core.tools.logger.logger import get_frogml_logger
10
+ from tabulate import tabulate
11
+
12
+ from frogml_cli.commands.models.executions.start._logic import (
13
+ execute_in_local_mode,
14
+ execute_start_execution,
15
+ )
16
+ from frogml_cli.inner.tools.cli_tools import DeprecatedOption, FrogMLCommand
17
+ from frogml_cli.inner.tools.config_handler import config_handler
18
+ from frogml_cli.tools.const import GPU_TYPES
19
+
20
+ logger = get_frogml_logger()
21
+
22
+
23
+ @click.command(
24
+ name="start", help="Start an execution job on a deployed model.", cls=FrogMLCommand
25
+ )
26
+ @click.option("--model-id", required=True, help="Model ID", type=str)
27
+ @click.option(
28
+ "--build-id",
29
+ type=str,
30
+ help="Explicit Build ID to invoke the execution against. If empty, the deployed build ID will be applied",
31
+ )
32
+ @click.option(
33
+ "--bucket",
34
+ type=str,
35
+ help="The bucket to read and write the data to/from.",
36
+ )
37
+ @click.option(
38
+ "--source-bucket",
39
+ type=str,
40
+ help="The source bucket to read the data from.",
41
+ )
42
+ @click.option(
43
+ "--source-folder",
44
+ required=True,
45
+ type=str,
46
+ help="The source folder to read the data from.",
47
+ )
48
+ @click.option(
49
+ "--destination-bucket",
50
+ type=str,
51
+ help="The destination bucket to store results on.",
52
+ )
53
+ @click.option(
54
+ "--destination-folder",
55
+ type=str,
56
+ required=True,
57
+ help="The destination folder to store results on.",
58
+ )
59
+ @click.option(
60
+ "--input-file-type",
61
+ type=click.Choice(
62
+ [fmt for fmt in INPUT_FORMATTERS_MAP.keys()], case_sensitive=False
63
+ ),
64
+ help="The input file type to read.",
65
+ )
66
+ @click.option(
67
+ "--output-file-type",
68
+ type=click.Choice(
69
+ [fmt for fmt in OUTPUT_FORMATTERS_MAP.keys()], case_sensitive=False
70
+ ),
71
+ help="The output file type to to receive.",
72
+ )
73
+ @click.option(
74
+ "--access-token-name",
75
+ type=str,
76
+ required=False,
77
+ help="The access token secret name (should be created before by using `frogml secret`).",
78
+ )
79
+ @click.option(
80
+ "--access-secret-name",
81
+ type=str,
82
+ required=False,
83
+ help="The access secret secret name (should be created before by using `frogml secret`).",
84
+ )
85
+ @click.option(
86
+ "--job-timeout",
87
+ type=int,
88
+ default=0,
89
+ help="Total inference job timeout in seconds, (e.g. 2000). Default is unlimited.",
90
+ )
91
+ @click.option(
92
+ "--file-timeout",
93
+ type=int,
94
+ default=0,
95
+ help="A single file inference timeout in seconds, (e.g. 2000). Default is unlimited.",
96
+ )
97
+ @click.option(
98
+ "--pods",
99
+ "--replicas",
100
+ type=int,
101
+ default=0,
102
+ help="Number of replicas to deploy. (concurrent files processing). Default is as deployed.",
103
+ deprecated=["--pods"],
104
+ preferred="--replicas",
105
+ cls=DeprecatedOption,
106
+ )
107
+ @click.option(
108
+ "--cpus",
109
+ type=float,
110
+ default=0,
111
+ help="Number of CPU cores, can be fraction of a core "
112
+ "(e.g. 0.4). Default is as deployed.",
113
+ )
114
+ @click.option(
115
+ "--memory",
116
+ type=int,
117
+ default=0,
118
+ help="Memory amount in Mib (e.g. 256). Default is as deployed.",
119
+ )
120
+ @click.option(
121
+ "--gpu-type",
122
+ type=click.Choice([fmt for fmt in GPU_TYPE_MAP.keys()], case_sensitive=False),
123
+ help=f"Type of GPU to use on the deployment ({', '.join([x for x in GPU_TYPES])}).",
124
+ )
125
+ @click.option(
126
+ "--gpu-amount",
127
+ type=int,
128
+ help="Amount of GPU's to use on the in the batch inference.",
129
+ )
130
+ @click.option(
131
+ "-f",
132
+ "--from-file",
133
+ help="Build by run_config file, Command arguments will overwrite any run_config.",
134
+ required=False,
135
+ type=click.Path(exists=True, resolve_path=True, dir_okay=False),
136
+ )
137
+ @click.option(
138
+ "--out-conf",
139
+ help="Extract deploy conf from command arguments, the command will not run it wil only output valid yaml "
140
+ "structure",
141
+ default=False,
142
+ is_flag=True,
143
+ )
144
+ @click.option(
145
+ "-P",
146
+ "--param-list",
147
+ required=False,
148
+ metavar="NAME=VALUE",
149
+ multiple=True,
150
+ help="A parameter for the batch execution, of the form -P name=value",
151
+ )
152
+ @click.option(
153
+ "--instance",
154
+ required=False,
155
+ type=str,
156
+ help="The instance size to run batch on - 'small', 'medium', 'large', etc...",
157
+ default=None,
158
+ )
159
+ @click.option(
160
+ "--purchase-option",
161
+ required=False,
162
+ type=str,
163
+ help="The instance purchase option 'on-demand' or 'spot'",
164
+ default=None,
165
+ )
166
+ def execution_start(from_file: str, out_conf: bool, **kwargs):
167
+ if kwargs["source_folder"].startswith("file:") and kwargs[
168
+ "destination_folder"
169
+ ].startswith("file:"):
170
+ execute_in_local_mode(kwargs)
171
+ return
172
+ else:
173
+ access_token_name = kwargs.get("access_token_name", None)
174
+ access_secret_name = kwargs.get("access_secret_name", None)
175
+ if access_token_name is None or access_secret_name is None:
176
+ raise FrogmlException(
177
+ "Both access-token-name and access-secret-name must be provided"
178
+ )
179
+
180
+ config: ExecutionConfig = config_handler(
181
+ config=ExecutionConfig,
182
+ from_file=from_file,
183
+ out_conf=out_conf,
184
+ sections=("execution", "resources"),
185
+ **kwargs,
186
+ )
187
+ if not out_conf:
188
+ try:
189
+ execution_id, success, fail_message = execute_start_execution(config)
190
+ if success:
191
+ logger.info(
192
+ tabulate(
193
+ tabular_data=[
194
+ ["Model ID", config.execution.model_id],
195
+ ["Execution ID", execution_id],
196
+ ],
197
+ tablefmt="fancy_grid",
198
+ )
199
+ )
200
+ else:
201
+ raise FrogmlException(fail_message + f" {execution_id}")
202
+
203
+ logger.info(
204
+ "Execution initiated successfully, Use --status to get execution current status."
205
+ )
206
+ except Exception as e:
207
+ logger.error(f"Execution failed, Error: {e}")
208
+ raise
@@ -0,0 +1,13 @@
1
+ from frogml.core.clients.batch_job_management import BatchJobManagerClient
2
+ from frogml.core.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
+ )
@@ -0,0 +1,27 @@
1
+ import click
2
+ from frogml.core.exceptions import FrogmlException
3
+ from frogml.core.tools.logger.logger import get_frogml_logger
4
+
5
+ from frogml_cli.commands.models.executions.status._logic import execute_execution_status
6
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
7
+
8
+ logger = get_frogml_logger()
9
+
10
+
11
+ @click.command(name="status", help="Get the status of an execution.", cls=FrogMLCommand)
12
+ @click.option(
13
+ "--execution-id",
14
+ type=str,
15
+ help="The execution id.",
16
+ )
17
+ def execution_status(execution_id: str, **kwargs):
18
+ try:
19
+ job_status, success, fail_message = execute_execution_status(execution_id)
20
+ if not success:
21
+ raise FrogmlException(fail_message)
22
+
23
+ logger.info(f"Status is: {job_status}.")
24
+
25
+ except Exception as e:
26
+ logger.error(f"Failed to cancel execution, Error: {e}")
27
+ raise
File without changes
File without changes
@@ -0,0 +1,40 @@
1
+ from pathlib import Path
2
+
3
+ from cookiecutter import generate
4
+ from frogml.core.exceptions import FrogmlException
5
+
6
+
7
+ def initialize_model_structure(uri: str, template: str, logger, **template_args):
8
+ if Path(uri).is_file():
9
+ raise FrogmlException(
10
+ f"Unable to create the model directory structure - given path {uri} is an existing file"
11
+ )
12
+
13
+ if not Path(uri).is_dir():
14
+ logger.info(f"Given path {uri} doesn't exists - creating it")
15
+ Path(uri).mkdir(parents=True, exist_ok=True)
16
+
17
+ context = generate.generate_context(
18
+ context_file=(
19
+ Path(__file__).parent / "template" / template / "cookiecutter.json"
20
+ ).resolve(),
21
+ default_context=None,
22
+ extra_context={**template_args},
23
+ )
24
+
25
+ output_dir = uri + "/" + context.get("cookiecutter", {}).get("model_directory")
26
+ if Path(output_dir).exists():
27
+ raise FrogmlException(
28
+ f"Folder with the name {output_dir} is already exists. "
29
+ f"Please change model name or change the working path."
30
+ )
31
+ logger.info("Generating structure...")
32
+ generate.generate_files(
33
+ (Path(__file__).parent / "template" / template).resolve(),
34
+ context,
35
+ output_dir=uri,
36
+ overwrite_if_exists=False,
37
+ skip_if_file_exists=False,
38
+ )
39
+
40
+ logger.info(f"Created base model at {Path(output_dir).resolve()}")
@@ -0,0 +1,3 @@
1
+ {
2
+ "model_directory": "churn"
3
+ }
@@ -0,0 +1,5 @@
1
+ from .model import ChurnPrediction
2
+
3
+
4
+ def load_model():
5
+ return ChurnPrediction()
@@ -0,0 +1,10 @@
1
+ # name: churn-example
2
+ channels:
3
+ - defaults
4
+ - conda-forge
5
+ dependencies:
6
+ - python=3.9
7
+ - pip=22.2.2
8
+ - pandas=1.1.5
9
+ - scikit-learn=0.24.1
10
+ - catboost=0.26.1