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,60 @@
1
+ import click
2
+ from frogml._proto.qwak.models.models_pb2 import DeploymentModelStatus
3
+
4
+ from frogml_cli.commands.models.list_models._logic import list_models as _list_models
5
+ from frogml_cli.commands.ui_tools import output_as_json, output_as_table
6
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
7
+
8
+
9
+ def parse_model(model):
10
+ return [
11
+ model.model_id,
12
+ model.uuid,
13
+ model.display_name,
14
+ model.model_description,
15
+ model.project_id,
16
+ model.created_by,
17
+ model.created_at,
18
+ model.last_modified_by,
19
+ model.last_modified_at,
20
+ model.model_status,
21
+ "\n".join(
22
+ [f"{branch.branch_name} {branch.branch_id}" for branch in model.branches]
23
+ ),
24
+ DeploymentModelStatus.DESCRIPTOR.values_by_number[
25
+ model.deployment_model_status
26
+ ].name,
27
+ ]
28
+
29
+
30
+ @click.command("list-models", cls=FrogMLCommand)
31
+ @click.option("--project-key", metavar="NAME", required=True, help="JFrog Project key")
32
+ @click.option(
33
+ "--format",
34
+ default="text",
35
+ show_default=True,
36
+ type=click.Choice(["text", "json"], case_sensitive=True),
37
+ metavar="FORMAT",
38
+ required=False,
39
+ help="The formatting style for command output (choose from text, json)",
40
+ )
41
+ def list_models(project_key, format, **kwargs):
42
+ model_list_result = _list_models(project_key)
43
+ columns = [
44
+ "Model id",
45
+ "Model UUID",
46
+ "Model Name",
47
+ "Model Description",
48
+ "Project ID",
49
+ "Created By",
50
+ "Created At",
51
+ "Last Modified At",
52
+ "Last Modified By",
53
+ "Model Status",
54
+ "Branches",
55
+ "Deployment Status",
56
+ ]
57
+ if format == "json":
58
+ output_as_json(model_list_result)
59
+ elif format == "text":
60
+ output_as_table(model_list_result.models, parse_model, headers=columns)
File without changes
@@ -0,0 +1,12 @@
1
+ from frogml._proto.qwak.projects.projects_pb2 import GetProjectResponse
2
+ from frogml.core.clients.model_management.client import ModelsManagementClient
3
+ from frogml.core.clients.project.client import ProjectsManagementClient
4
+
5
+
6
+ def list_models_metadata(project_key: str):
7
+ project_response: GetProjectResponse = ProjectsManagementClient().get_project(
8
+ project_name=project_key
9
+ )
10
+ project_id: str = project_response.project.spec.project_id
11
+
12
+ return ModelsManagementClient().list_models_metadata(project_id)
@@ -0,0 +1,60 @@
1
+ import re
2
+
3
+ import click
4
+ from google.protobuf.json_format import MessageToDict
5
+ from tabulate import tabulate
6
+
7
+ from frogml_cli.commands.models.metadata._logic import (
8
+ list_models_metadata as _list_models_metadata,
9
+ )
10
+ from frogml_cli.commands.ui_tools import output_as_json
11
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
12
+
13
+
14
+ def print_text_data(metadata):
15
+ def dict_to_table(data, prefix=""):
16
+ headers = []
17
+ values = []
18
+ for key, value in data.items():
19
+ key = re.sub(r"(\w)([A-Z])", r"\1 \2", key).lower()
20
+ if isinstance(value, dict):
21
+ headers.append(key.title())
22
+ values.append(dict_to_table(value, prefix=key + ": "))
23
+ elif isinstance(value, list):
24
+ headers.append(key.title())
25
+ values.append(
26
+ "\n".join(
27
+ [
28
+ dict_to_table(item, prefix=key + ": ")
29
+ for item in value
30
+ if isinstance(item, dict)
31
+ ]
32
+ )
33
+ )
34
+ else:
35
+ headers.append((prefix + key).title())
36
+ values.append(value)
37
+ return tabulate([values], headers=headers)
38
+
39
+ for model_metadata in metadata.model_metadata:
40
+ print(dict_to_table(MessageToDict(model_metadata)))
41
+ print("")
42
+
43
+
44
+ @click.command("metadata", cls=FrogMLCommand)
45
+ @click.option("--project-key", metavar="NAME", required=True, help="JFrog Project key")
46
+ @click.option(
47
+ "--format",
48
+ default="text",
49
+ show_default=True,
50
+ type=click.Choice(["text", "json"], case_sensitive=True),
51
+ metavar="FORMAT",
52
+ required=False,
53
+ help="The formatting style for command output (choose from text, json)",
54
+ )
55
+ def list_models_metadata(project_key, format, **kwargs):
56
+ model_list_result = _list_models_metadata(project_key)
57
+ if format == "json":
58
+ output_as_json(model_list_result)
59
+ elif format == "text":
60
+ print_text_data(model_list_result)
@@ -0,0 +1,44 @@
1
+ import click
2
+
3
+ from frogml_cli.commands.auto_scalling.autoscaling_commands_group import (
4
+ autoscaling_commands_group,
5
+ )
6
+
7
+ from .build.ui import models_build
8
+ from .builds.builds_commands_group import builds_commands_group
9
+ from .create.ui import model_create
10
+ from .delete.ui import model_delete
11
+ from .deployments.deploy.deploy_commands_group import deploy_group
12
+ from .deployments.undeploy.ui import models_undeploy
13
+ from .describe.ui import model_describe
14
+ from .executions.execution_commands_group import execution_commands_group
15
+ from .init.ui import model_init
16
+ from .list.ui import model_list
17
+ from .list_models.ui import list_models
18
+ from .metadata.ui import list_models_metadata
19
+ from .runtime.runtime_commands_group import runtime_commands_group
20
+
21
+
22
+ @click.group(
23
+ name="models",
24
+ help="Commands for interacting with Frogml based models",
25
+ )
26
+ def models_command_group():
27
+ # Click group injection
28
+ pass
29
+
30
+
31
+ models_command_group.add_command(autoscaling_commands_group)
32
+ models_command_group.add_command(builds_commands_group)
33
+ models_command_group.add_command(execution_commands_group)
34
+ models_command_group.add_command(model_init)
35
+ models_command_group.add_command(model_create)
36
+ models_command_group.add_command(model_delete)
37
+ models_command_group.add_command(model_list)
38
+ models_command_group.add_command(models_build)
39
+ models_command_group.add_command(deploy_group, "deploy")
40
+ models_command_group.add_command(models_undeploy, "undeploy")
41
+ models_command_group.add_command(model_describe)
42
+ models_command_group.add_command(runtime_commands_group)
43
+ models_command_group.add_command(list_models)
44
+ models_command_group.add_command(list_models_metadata)
File without changes
File without changes
@@ -0,0 +1,63 @@
1
+ import click
2
+
3
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
4
+ from frogml_cli.tools.colors import Color
5
+ from frogml_cli.tools.log_handling import FrogmlLogHandling
6
+
7
+
8
+ @click.command("logs", cls=FrogMLCommand)
9
+ @click.option("-f", "--follow", is_flag=True, default=False, help="Follow log tail")
10
+ @click.option(
11
+ "-d",
12
+ "--deployment-id",
13
+ required=False,
14
+ help="Runtime model Deployment ID to show logs of",
15
+ )
16
+ @click.option(
17
+ "-b",
18
+ "--build-id",
19
+ required=False,
20
+ help="Runtime model Build ID to show logs of",
21
+ )
22
+ @click.option(
23
+ "-s",
24
+ "--since",
25
+ required=False,
26
+ metavar="X [TYPE] ago",
27
+ help=f"Get logs from X1 [type] X2 [type]... Xn [type] ago. "
28
+ f"(x = INT; type = {FrogmlLogHandling.TIME_UNITS}) i.e. [1 day 2 hours ago]",
29
+ )
30
+ @click.option(
31
+ "-n",
32
+ "--number-of-results",
33
+ required=False,
34
+ type=int,
35
+ help="Maximum number of results per query",
36
+ )
37
+ @click.option(
38
+ "-g", "--grep", required=False, help="Filter by log content contains [expression]"
39
+ )
40
+ def runtime_logs(
41
+ follow=True,
42
+ deployment_id=None,
43
+ build_id=None,
44
+ since=None,
45
+ number_of_results=None,
46
+ grep=None,
47
+ **kwargs,
48
+ ):
49
+ if not deployment_id and not build_id:
50
+ print(
51
+ f"{Color.YELLOW}Please provide either a Deployment or a Build ID{Color.END}"
52
+ )
53
+ return
54
+
55
+ frogml_log_handling = FrogmlLogHandling()
56
+ frogml_log_handling.get_logs(
57
+ follow,
58
+ since,
59
+ number_of_results,
60
+ grep,
61
+ {"build_id": build_id, "deployment_id": deployment_id},
62
+ "runtime_model",
63
+ )
@@ -0,0 +1,17 @@
1
+ import click
2
+
3
+ from frogml_cli.commands.models.runtime.logs.ui import runtime_logs
4
+ from frogml_cli.commands.models.runtime.update.ui import runtime_update
5
+
6
+
7
+ @click.group(
8
+ name="runtime",
9
+ help="Runtime configurations for deployed models",
10
+ )
11
+ def runtime_commands_group():
12
+ # Click commands group injection
13
+ pass
14
+
15
+
16
+ runtime_commands_group.add_command(runtime_logs)
17
+ runtime_commands_group.add_command(runtime_update)
File without changes
@@ -0,0 +1,9 @@
1
+ from frogml.core.clients.deployment.client import DeploymentManagementClient
2
+ from frogml.core.clients.model_management import ModelsManagementClient
3
+
4
+
5
+ def execute_runtime_update(model_id, log_level):
6
+ model_uuid = ModelsManagementClient().get_model_uuid(model_id)
7
+ DeploymentManagementClient().update_runtime_configurations(
8
+ model_id=model_id, model_uuid=model_uuid, log_level=log_level
9
+ )
@@ -0,0 +1,17 @@
1
+ import click
2
+ from frogml.core.exceptions import FrogmlException
3
+
4
+ from frogml_cli.commands.models.runtime.update._logic import execute_runtime_update
5
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
6
+
7
+
8
+ @click.command("update", cls=FrogMLCommand)
9
+ @click.option("-l", "--log-level", required=True, help="Log level to set.")
10
+ @click.option("-m", "--model-id", required=True, help="Model named ID")
11
+ def runtime_update(model_id, log_level, **kwargs):
12
+ try:
13
+ execute_runtime_update(model_id, log_level=log_level)
14
+ except Exception as e:
15
+ raise FrogmlException(
16
+ f'Failed to update runtime configurations. Error is "{e}"'
17
+ )
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ from frogml.core.clients.secret_service import SecretServiceClient
2
+
3
+
4
+ def execute_delete_secret(name):
5
+ SecretServiceClient().delete_secret(name)
@@ -0,0 +1,21 @@
1
+ import click
2
+ import grpc
3
+
4
+ from frogml_cli.commands.secrets.delete._logic import execute_delete_secret
5
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
6
+
7
+
8
+ @click.command("delete", cls=FrogMLCommand)
9
+ @click.option("--name", metavar="TEXT", required=True, help="The secret name")
10
+ def delete_secret(name, **kwargs):
11
+ print(f"Deleting secret named '{name}'")
12
+ try:
13
+ execute_delete_secret(name)
14
+ print(f"Secret '{name}' has been deleted")
15
+ except grpc.RpcError as e:
16
+ if e.code() == grpc.StatusCode.NOT_FOUND:
17
+ print(f"Secret '{name}' does not exist")
18
+ else:
19
+ print(f"Error deleting secret. Error is {e}")
20
+ except Exception as e:
21
+ print(f"Error deleting secret. Error is {e}")
File without changes
@@ -0,0 +1,5 @@
1
+ from frogml.core.clients.secret_service import SecretServiceClient
2
+
3
+
4
+ def execute_get_secret(name):
5
+ return SecretServiceClient().get_secret(name)
@@ -0,0 +1,17 @@
1
+ import click
2
+ from frogml.core.exceptions import FrogmlNotFoundException
3
+
4
+ from frogml_cli.commands.secrets.get._logic import execute_get_secret
5
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
6
+
7
+
8
+ @click.command("get", cls=FrogMLCommand)
9
+ @click.option("--name", metavar="TEXT", required=True, help="the secret name")
10
+ def get_secret(name, **kwargs):
11
+ try:
12
+ value = execute_get_secret(name)
13
+ print(value)
14
+ except FrogmlNotFoundException:
15
+ print(f"Secret '{name}' does not exists")
16
+ except Exception as e:
17
+ print(f"Error getting secret. Error is {e}")
@@ -0,0 +1,19 @@
1
+ import click
2
+
3
+ from frogml_cli.commands.secrets.delete.ui import delete_secret
4
+ from frogml_cli.commands.secrets.get.ui import get_secret
5
+ from frogml_cli.commands.secrets.set.ui import set_secret
6
+
7
+
8
+ @click.group(
9
+ "secrets",
10
+ help="Commands for interacting with the secret store",
11
+ )
12
+ def secrets_commands_group():
13
+ # Click commands group injection
14
+ pass
15
+
16
+
17
+ secrets_commands_group.add_command(set_secret)
18
+ secrets_commands_group.add_command(get_secret)
19
+ secrets_commands_group.add_command(delete_secret)
File without changes
@@ -0,0 +1,5 @@
1
+ from frogml.core.clients.secret_service import SecretServiceClient
2
+
3
+
4
+ def execute_set_secret(name, value):
5
+ SecretServiceClient().set_secret(name, value)
@@ -0,0 +1,16 @@
1
+ import click
2
+
3
+ from frogml_cli.commands.secrets.set._logic import execute_set_secret
4
+ from frogml_cli.inner.tools.cli_tools import FrogMLCommand
5
+
6
+
7
+ @click.command("set", cls=FrogMLCommand)
8
+ @click.option("--name", metavar="TEXT", required=True, help="the secret name")
9
+ @click.option("--value", hide_input=True, confirmation_prompt=False, prompt=True)
10
+ def set_secret(name, value, **kwargs):
11
+ print(f"Creating secret named '{name}' with value length of {len(value)}...")
12
+ try:
13
+ execute_set_secret(name, value)
14
+ print("Created!")
15
+ except Exception as e:
16
+ print(f"Error setting secret. Error is {e}")
@@ -0,0 +1,18 @@
1
+ from typing import Any, Callable, Iterable, List
2
+
3
+ from google.protobuf.json_format import MessageToJson
4
+ from tabulate import tabulate
5
+
6
+
7
+ def output_as_json(data: Any):
8
+ print(MessageToJson(data))
9
+
10
+
11
+ def output_as_table(
12
+ data_source: Iterable[Any], data_extractor: Callable, headers: List[str]
13
+ ):
14
+ data = []
15
+ for item in data_source:
16
+ data.append(data_extractor(item))
17
+
18
+ print(tabulate(data, headers=headers))
@@ -0,0 +1,14 @@
1
+ from frogml.core.exceptions import (
2
+ FrogmlGeneralBuildException,
3
+ FrogmlSuggestionException,
4
+ )
5
+
6
+ from .frogml_command_exception import FrogmlCommandException
7
+ from .frogml_resource_not_found import FrogmlResourceNotFound
8
+
9
+ __all__ = [
10
+ "FrogmlGeneralBuildException",
11
+ "FrogmlSuggestionException",
12
+ "FrogmlResourceNotFound",
13
+ "FrogmlCommandException",
14
+ ]
@@ -0,0 +1,2 @@
1
+ class FrogmlCommandException(Exception):
2
+ pass
@@ -0,0 +1,5 @@
1
+ from frogml.core.exceptions import FrogmlSuggestionException
2
+
3
+
4
+ class FrogmlDeployNewBuildFailedException(FrogmlSuggestionException):
5
+ pass
@@ -0,0 +1,2 @@
1
+ class FrogmlResourceNotFound(Exception):
2
+ pass
File without changes
@@ -0,0 +1,98 @@
1
+ import importlib.util
2
+ import os
3
+ import sys
4
+ from contextlib import contextmanager
5
+ from pathlib import Path
6
+ from typing import List, Tuple
7
+
8
+ from yaspin.core import Yaspin
9
+
10
+
11
+ def list_qwak_python_files(path: Path, sp: Yaspin) -> List[Tuple[str, str]]:
12
+ """
13
+ Helper function which finds python files with qwak imports in a given module
14
+
15
+ Args:
16
+ path: path to a directory
17
+ sp: spinner object, used to print
18
+ Returns:
19
+ List of python files which use the Frogml cli
20
+ """
21
+
22
+ file_paths = []
23
+ if Path.is_dir(path):
24
+ for object_path in path.glob("**/*.py"):
25
+ try:
26
+ if not object_path.is_file():
27
+ continue
28
+ mod_name, file_ext = os.path.splitext(object_path.name)
29
+ if file_ext != ".py" or mod_name == "setup":
30
+ continue
31
+
32
+ with object_path.open("rb") as fp:
33
+ content = fp.read()
34
+ contains_qwak_feature = all(
35
+ [token in content for token in (b"frogml")]
36
+ )
37
+
38
+ if not contains_qwak_feature:
39
+ continue
40
+
41
+ with _add_to_python_path(object_path):
42
+ # Test that the file can be imported cleanly
43
+ spec = importlib.util.spec_from_file_location(mod_name, object_path)
44
+ if not spec:
45
+ sp.write(f"Could not load file: {object_path}. Skipping.")
46
+ continue
47
+ module = importlib.util.module_from_spec(spec)
48
+ spec.loader.exec_module(module)
49
+
50
+ file_paths.append((mod_name, object_path))
51
+ except Exception as e:
52
+ sp.write(
53
+ f"Got an error trying to handle the file {object_path}, error is: {e}. Skipping."
54
+ )
55
+ return file_paths
56
+
57
+
58
+ def extract_class_objects(python_files, clazz):
59
+ """
60
+ Helper function which given a list of python files extracts objects of the type `clazz`
61
+
62
+ Args
63
+ python_files: list of python files
64
+ clazz: class object which its instances should be extracted
65
+ Returns
66
+ list of extracted objects of type clazz from the given python files
67
+ """
68
+ clazz_objects = []
69
+ for mod, file in python_files:
70
+ with _add_to_python_path(Path(file)):
71
+ spec = importlib.util.spec_from_file_location(mod, file)
72
+ if not spec:
73
+ continue
74
+
75
+ module = importlib.util.module_from_spec(spec)
76
+ spec.loader.exec_module(module)
77
+ for feature in list(module.__dict__.values()):
78
+ if isinstance(feature, clazz):
79
+ clazz_objects.append((feature, file))
80
+
81
+ return clazz_objects
82
+
83
+
84
+ @contextmanager
85
+ def _add_to_python_path(path: Path):
86
+ """
87
+ Helper function - context adding path to python path and then remove it
88
+
89
+ Args
90
+ path: path of file or folder to add to python path, in case of file adds the containing folder
91
+ Returns
92
+ """
93
+ try:
94
+ folder = str(path.parent) if path.is_file() else str(path)
95
+ sys.path.append(folder)
96
+ yield
97
+ finally:
98
+ sys.path.remove(folder)
File without changes