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.
- frogml_cli/__init__.py +10 -0
- frogml_cli/cli.py +40 -0
- frogml_cli/commands/__init__.py +0 -0
- frogml_cli/commands/_logic/__init__.py +0 -0
- frogml_cli/commands/_logic/tools.py +6 -0
- frogml_cli/commands/alerts/__init__.py +0 -0
- frogml_cli/commands/alerts/alerts_commnad_group.py +18 -0
- frogml_cli/commands/alerts/delete/__init__.py +0 -0
- frogml_cli/commands/alerts/delete/_logic.py +5 -0
- frogml_cli/commands/alerts/delete/ui.py +10 -0
- frogml_cli/commands/alerts/list/__init__.py +0 -0
- frogml_cli/commands/alerts/list/_logic.py +23 -0
- frogml_cli/commands/alerts/list/ui.py +17 -0
- frogml_cli/commands/alerts/register/__init__.py +0 -0
- frogml_cli/commands/alerts/register/_logic.py +72 -0
- frogml_cli/commands/alerts/register/ui.py +30 -0
- frogml_cli/commands/audience/__init__.py +0 -0
- frogml_cli/commands/audience/_logic/__init__.py +0 -0
- frogml_cli/commands/audience/_logic/config/__init__.py +0 -0
- frogml_cli/commands/audience/_logic/config/config_base.py +15 -0
- frogml_cli/commands/audience/_logic/config/parser.py +30 -0
- frogml_cli/commands/audience/_logic/config/v1/__init__.py +0 -0
- frogml_cli/commands/audience/_logic/config/v1/audience_config.py +25 -0
- frogml_cli/commands/audience/_logic/config/v1/conditions_config.py +59 -0
- frogml_cli/commands/audience/_logic/config/v1/config_v1.py +23 -0
- frogml_cli/commands/audience/_logic/config/v1/route_config.py +15 -0
- frogml_cli/commands/audience/_logic/config/v1/spec.py +9 -0
- frogml_cli/commands/audience/audience_api_dump.py +86 -0
- frogml_cli/commands/audience/audience_commands_group.py +30 -0
- frogml_cli/commands/audience/create/__init__.py +0 -0
- frogml_cli/commands/audience/create/logic.py +41 -0
- frogml_cli/commands/audience/create/ui.py +21 -0
- frogml_cli/commands/audience/delete/__init__.py +0 -0
- frogml_cli/commands/audience/delete/logic.py +13 -0
- frogml_cli/commands/audience/delete/ui.py +17 -0
- frogml_cli/commands/audience/get/__init__.py +0 -0
- frogml_cli/commands/audience/get/logic.py +14 -0
- frogml_cli/commands/audience/get/ui.py +25 -0
- frogml_cli/commands/audience/list/__init__.py +0 -0
- frogml_cli/commands/audience/list/logic.py +16 -0
- frogml_cli/commands/audience/list/ui.py +26 -0
- frogml_cli/commands/audience/update/__init__.py +0 -0
- frogml_cli/commands/audience/update/logic.py +37 -0
- frogml_cli/commands/audience/update/ui.py +26 -0
- frogml_cli/commands/auto_scalling/__init__.py +0 -0
- frogml_cli/commands/auto_scalling/_logic/__init__.py +0 -0
- frogml_cli/commands/auto_scalling/_logic/config/__init__.py +3 -0
- frogml_cli/commands/auto_scalling/_logic/config/config.py +152 -0
- frogml_cli/commands/auto_scalling/_logic/config/parser.py +21 -0
- frogml_cli/commands/auto_scalling/attach/__init__.py +0 -0
- frogml_cli/commands/auto_scalling/attach/_logic.py +43 -0
- frogml_cli/commands/auto_scalling/attach/ui.py +21 -0
- frogml_cli/commands/auto_scalling/autoscaling_commands_group.py +15 -0
- frogml_cli/commands/automations/__init__.py +0 -0
- frogml_cli/commands/automations/automations_commands_group.py +30 -0
- frogml_cli/commands/automations/delete/__init__.py +0 -0
- frogml_cli/commands/automations/delete/_logic.py +6 -0
- frogml_cli/commands/automations/delete/ui.py +23 -0
- frogml_cli/commands/automations/executions/__init__.py +0 -0
- frogml_cli/commands/automations/executions/executions_commands_group.py +14 -0
- frogml_cli/commands/automations/executions/list/__init__.py +0 -0
- frogml_cli/commands/automations/executions/list/_logic.py +8 -0
- frogml_cli/commands/automations/executions/list/ui.py +27 -0
- frogml_cli/commands/automations/list/__init__.py +0 -0
- frogml_cli/commands/automations/list/_logic.py +36 -0
- frogml_cli/commands/automations/list/ui.py +21 -0
- frogml_cli/commands/automations/register/__init__.py +0 -0
- frogml_cli/commands/automations/register/_logic.py +43 -0
- frogml_cli/commands/automations/register/ui.py +44 -0
- frogml_cli/commands/config/__init__.py +0 -0
- frogml_cli/commands/config/add/__init__.py +0 -0
- frogml_cli/commands/config/add/ui.py +62 -0
- frogml_cli/commands/config/config_commands_group.py +11 -0
- frogml_cli/commands/feature_store/__init__.py +0 -0
- frogml_cli/commands/feature_store/backfill/__init__.py +0 -0
- frogml_cli/commands/feature_store/backfill/_logic.py +140 -0
- frogml_cli/commands/feature_store/backfill/ui.py +129 -0
- frogml_cli/commands/feature_store/delete/__init__.py +0 -0
- frogml_cli/commands/feature_store/delete/_logic.py +107 -0
- frogml_cli/commands/feature_store/delete/ui.py +40 -0
- frogml_cli/commands/feature_store/execution/__init__.py +0 -0
- frogml_cli/commands/feature_store/execution/ui.py +19 -0
- frogml_cli/commands/feature_store/feature_store_command_group.py +29 -0
- frogml_cli/commands/feature_store/list/__init__.py +0 -0
- frogml_cli/commands/feature_store/list/ui.py +140 -0
- frogml_cli/commands/feature_store/pause/__init__.py +0 -0
- frogml_cli/commands/feature_store/pause/ui.py +18 -0
- frogml_cli/commands/feature_store/register/__init__.py +0 -0
- frogml_cli/commands/feature_store/register/_logic.py +369 -0
- frogml_cli/commands/feature_store/register/ui.py +111 -0
- frogml_cli/commands/feature_store/resume/__init__.py +0 -0
- frogml_cli/commands/feature_store/resume/ui.py +18 -0
- frogml_cli/commands/feature_store/trigger/__init__.py +0 -0
- frogml_cli/commands/feature_store/trigger/ui.py +39 -0
- frogml_cli/commands/models/__init__.py +0 -0
- frogml_cli/commands/models/build/__init__.py +0 -0
- frogml_cli/commands/models/build/_logic/__init__.py +0 -0
- frogml_cli/commands/models/build/_logic/build_steps.py +42 -0
- frogml_cli/commands/models/build/_logic/client_logs/__init__.py +0 -0
- frogml_cli/commands/models/build/_logic/client_logs/cli_phase_run_handler.py +123 -0
- frogml_cli/commands/models/build/_logic/client_logs/cli_trigger_build_logger.py +19 -0
- frogml_cli/commands/models/build/_logic/client_logs/logger.py +88 -0
- frogml_cli/commands/models/build/_logic/client_logs/messages.py +36 -0
- frogml_cli/commands/models/build/_logic/client_logs/spinner.py +14 -0
- frogml_cli/commands/models/build/_logic/client_logs/trigger_build_logger.py +54 -0
- frogml_cli/commands/models/build/_logic/client_logs/utils.py +12 -0
- frogml_cli/commands/models/build/_logic/phase/__init__.py +0 -0
- frogml_cli/commands/models/build/_logic/phase/a_fetch_model_code/__init__.py +20 -0
- frogml_cli/commands/models/build/_logic/phase/a_fetch_model_code/get_sdk_version_step.py +15 -0
- frogml_cli/commands/models/build/_logic/phase/b_remote_register_frogml_build/__init__.py +16 -0
- frogml_cli/commands/models/build/_logic/phase/c_deploy/__init__.py +6 -0
- frogml_cli/commands/models/build/_logic/phase/c_deploy/build_polling_status.py +55 -0
- frogml_cli/commands/models/build/_logic/phase/c_deploy/deploy_build.py +61 -0
- frogml_cli/commands/models/build/_logic/util/__init__.py +0 -0
- frogml_cli/commands/models/build/_logic/util/protobuf_factory.py +45 -0
- frogml_cli/commands/models/build/_logic/util/step_decorator.py +60 -0
- frogml_cli/commands/models/build/_logic/util/text.py +9 -0
- frogml_cli/commands/models/build/_logic/wait_until_finished.py +27 -0
- frogml_cli/commands/models/build/ui.py +337 -0
- frogml_cli/commands/models/builds/__init__.py +0 -0
- frogml_cli/commands/models/builds/builds_commands_group.py +16 -0
- frogml_cli/commands/models/builds/cancel/__init__.py +0 -0
- frogml_cli/commands/models/builds/cancel/_logic.py +5 -0
- frogml_cli/commands/models/builds/cancel/ui.py +15 -0
- frogml_cli/commands/models/builds/logs/__init__.py +0 -0
- frogml_cli/commands/models/builds/logs/ui.py +35 -0
- frogml_cli/commands/models/builds/status/__init__.py +0 -0
- frogml_cli/commands/models/builds/status/_logic.py +6 -0
- frogml_cli/commands/models/builds/status/ui.py +39 -0
- frogml_cli/commands/models/create/__init__.py +0 -0
- frogml_cli/commands/models/create/_logic.py +40 -0
- frogml_cli/commands/models/create/ui.py +46 -0
- frogml_cli/commands/models/delete/__init__.py +0 -0
- frogml_cli/commands/models/delete/_logic.py +18 -0
- frogml_cli/commands/models/delete/ui.py +25 -0
- frogml_cli/commands/models/deployments/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/_logic/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/_logic/advance_deployment_options_handler.py +31 -0
- frogml_cli/commands/models/deployments/deploy/_logic/base_deploy_executor.py +70 -0
- frogml_cli/commands/models/deployments/deploy/_logic/deploy_config.py +261 -0
- frogml_cli/commands/models/deployments/deploy/_logic/deployment.py +407 -0
- frogml_cli/commands/models/deployments/deploy/_logic/deployment_message_helpers.py +116 -0
- frogml_cli/commands/models/deployments/deploy/_logic/deployment_response_handler.py +156 -0
- frogml_cli/commands/models/deployments/deploy/_logic/deployment_size_mapper.py +98 -0
- frogml_cli/commands/models/deployments/deploy/_logic/get_latest_successful_build.py +28 -0
- frogml_cli/commands/models/deployments/deploy/_logic/local_deployment.py +193 -0
- frogml_cli/commands/models/deployments/deploy/batch/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/batch/_logic/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/batch/_logic/advanced_deployment_mapper.py +15 -0
- frogml_cli/commands/models/deployments/deploy/batch/_logic/deploy_executor.py +24 -0
- frogml_cli/commands/models/deployments/deploy/batch/ui.py +119 -0
- frogml_cli/commands/models/deployments/deploy/deploy_commands_group.py +19 -0
- frogml_cli/commands/models/deployments/deploy/realtime/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/realtime/_logic/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/realtime/_logic/advanced_deployment_mapper.py +21 -0
- frogml_cli/commands/models/deployments/deploy/realtime/_logic/deploy_executor.py +24 -0
- frogml_cli/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py +75 -0
- frogml_cli/commands/models/deployments/deploy/realtime/ui.py +202 -0
- frogml_cli/commands/models/deployments/deploy/streaming/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/streaming/_logic/__init__.py +0 -0
- frogml_cli/commands/models/deployments/deploy/streaming/_logic/deploy_executor.py +24 -0
- frogml_cli/commands/models/deployments/deploy/streaming/_logic/serving_strategy_mapper.py +38 -0
- frogml_cli/commands/models/deployments/deploy/streaming/ui.py +206 -0
- frogml_cli/commands/models/deployments/undeploy/__init__.py +0 -0
- frogml_cli/commands/models/deployments/undeploy/_logic/__init__.py +0 -0
- frogml_cli/commands/models/deployments/undeploy/_logic/request_undeploy.py +249 -0
- frogml_cli/commands/models/deployments/undeploy/ui.py +61 -0
- frogml_cli/commands/models/describe/__init__.py +0 -0
- frogml_cli/commands/models/describe/_logic.py +169 -0
- frogml_cli/commands/models/describe/ui.py +35 -0
- frogml_cli/commands/models/executions/__init__.py +0 -0
- frogml_cli/commands/models/executions/cancel/__init__.py +0 -0
- frogml_cli/commands/models/executions/cancel/_logic.py +9 -0
- frogml_cli/commands/models/executions/cancel/ui.py +27 -0
- frogml_cli/commands/models/executions/execution_commands_group.py +24 -0
- frogml_cli/commands/models/executions/report/__init__.py +0 -0
- frogml_cli/commands/models/executions/report/_logic.py +14 -0
- frogml_cli/commands/models/executions/report/ui.py +43 -0
- frogml_cli/commands/models/executions/start/__init__.py +0 -0
- frogml_cli/commands/models/executions/start/_logic.py +83 -0
- frogml_cli/commands/models/executions/start/ui.py +208 -0
- frogml_cli/commands/models/executions/status/__init__.py +0 -0
- frogml_cli/commands/models/executions/status/_logic.py +13 -0
- frogml_cli/commands/models/executions/status/ui.py +27 -0
- frogml_cli/commands/models/init/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/initialize_model_structure.py +40 -0
- frogml_cli/commands/models/init/_logic/template/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/churn/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/churn/cookiecutter.json +3 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/model.py +99 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/test_churn.py +32 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/cookiecutter.json +3 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
- frogml_cli/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py +108 -0
- frogml_cli/commands/models/init/_logic/template/general/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/general/cookiecutter.json +6 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py +5 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml +8 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/model.py +66 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/test_qwak_model.py +5 -0
- frogml_cli/commands/models/init/_logic/template/titanic/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic/cookiecutter.json +3 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/conda.yml +11 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/model.py +98 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +24 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/cookiecutter.json +3 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/model.py +98 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/pyproject.toml +20 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- frogml_cli/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +25 -0
- frogml_cli/commands/models/init/ui.py +61 -0
- frogml_cli/commands/models/list/__init__.py +0 -0
- frogml_cli/commands/models/list/_logic.py +5 -0
- frogml_cli/commands/models/list/ui.py +41 -0
- frogml_cli/commands/models/list_models/__init__.py +0 -0
- frogml_cli/commands/models/list_models/_logic.py +11 -0
- frogml_cli/commands/models/list_models/ui.py +60 -0
- frogml_cli/commands/models/metadata/__init__.py +0 -0
- frogml_cli/commands/models/metadata/_logic.py +12 -0
- frogml_cli/commands/models/metadata/ui.py +60 -0
- frogml_cli/commands/models/models_command_group.py +44 -0
- frogml_cli/commands/models/runtime/__init__.py +0 -0
- frogml_cli/commands/models/runtime/logs/__init__.py +0 -0
- frogml_cli/commands/models/runtime/logs/ui.py +63 -0
- frogml_cli/commands/models/runtime/runtime_commands_group.py +17 -0
- frogml_cli/commands/models/runtime/update/__init__.py +0 -0
- frogml_cli/commands/models/runtime/update/_logic.py +9 -0
- frogml_cli/commands/models/runtime/update/ui.py +17 -0
- frogml_cli/commands/secrets/__init__.py +0 -0
- frogml_cli/commands/secrets/delete/__init__.py +0 -0
- frogml_cli/commands/secrets/delete/_logic.py +5 -0
- frogml_cli/commands/secrets/delete/ui.py +21 -0
- frogml_cli/commands/secrets/get/__init__.py +0 -0
- frogml_cli/commands/secrets/get/_logic.py +5 -0
- frogml_cli/commands/secrets/get/ui.py +17 -0
- frogml_cli/commands/secrets/secrets_commands_group.py +19 -0
- frogml_cli/commands/secrets/set/__init__.py +0 -0
- frogml_cli/commands/secrets/set/_logic.py +5 -0
- frogml_cli/commands/secrets/set/ui.py +16 -0
- frogml_cli/commands/ui_tools.py +18 -0
- frogml_cli/exceptions/__init__.py +14 -0
- frogml_cli/exceptions/frogml_command_exception.py +2 -0
- frogml_cli/exceptions/frogml_deploy_new_build_failed.py +5 -0
- frogml_cli/exceptions/frogml_resource_not_found.py +2 -0
- frogml_cli/inner/__init__.py +0 -0
- frogml_cli/inner/file_registry.py +98 -0
- frogml_cli/inner/tools/__init__.py +0 -0
- frogml_cli/inner/tools/cli_tools.py +179 -0
- frogml_cli/inner/tools/config_handler.py +29 -0
- frogml_cli/inner/tools/dataclasses_utils.py +21 -0
- frogml_cli/inner/tools/logger/__init__.py +3 -0
- frogml_cli/inner/tools/logger/logger.py +278 -0
- frogml_cli/inner/tools/logger/logging.yml +79 -0
- frogml_cli/inner/tools/tracking.py +47 -0
- frogml_cli/main.py +9 -0
- frogml_cli/tools/__init__.py +0 -0
- frogml_cli/tools/colors.py +13 -0
- frogml_cli/tools/const.py +3 -0
- frogml_cli/tools/files.py +63 -0
- frogml_cli/tools/log_handling.py +159 -0
- frogml_cli/tools/utils.py +45 -0
- frogml_cli-0.0.1.dist-info/METADATA +51 -0
- frogml_cli-0.0.1.dist-info/RECORD +287 -0
- frogml_cli-0.0.1.dist-info/WHEEL +4 -0
- frogml_cli-0.0.1.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
import click
|
2
|
+
|
3
|
+
from frogml_cli.commands.models.delete._logic import execute_model_delete
|
4
|
+
from frogml_cli.commands.ui_tools import output_as_json
|
5
|
+
from frogml_cli.inner.tools.cli_tools import FrogMLCommand
|
6
|
+
|
7
|
+
|
8
|
+
@click.command("delete", cls=FrogMLCommand)
|
9
|
+
@click.option("--project-key", metavar="NAME", required=True, help="JFrog Project key")
|
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_key, model_id, format, **kwargs):
|
21
|
+
response = execute_model_delete(project_key, 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
|
File without changes
|
File without changes
|
@@ -0,0 +1,31 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from frogml._proto.qwak.deployment.deployment_pb2 import (
|
4
|
+
AdvancedDeploymentOptions,
|
5
|
+
KubeDeploymentType,
|
6
|
+
)
|
7
|
+
from frogml.core.exceptions import FrogmlException
|
8
|
+
|
9
|
+
from frogml_cli.commands.models.deployments.deploy.batch._logic.advanced_deployment_mapper import (
|
10
|
+
batch_advanced_deployment_options_from_deploy_config,
|
11
|
+
)
|
12
|
+
from frogml_cli.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 FrogmlException(ADVANCED_DEPLOYMENT_UNRECOGNIZED_TYPE_ERROR)
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from abc import ABC, abstractmethod
|
2
|
+
from time import sleep
|
3
|
+
from typing import List
|
4
|
+
|
5
|
+
from frogml._proto.qwak.deployment.deployment_pb2 import ModelDeploymentStatus
|
6
|
+
from frogml._proto.qwak.deployment.deployment_service_pb2 import DeployModelResponse
|
7
|
+
from frogml.core.clients.administration.eco_system.client import EcosystemClient
|
8
|
+
from frogml.core.clients.deployment.client import DeploymentManagementClient
|
9
|
+
from frogml.core.clients.instance_template.client import (
|
10
|
+
InstanceTemplateManagementClient,
|
11
|
+
)
|
12
|
+
from frogml.core.inner.di_configuration import UserAccountConfiguration
|
13
|
+
|
14
|
+
from frogml_cli.commands.models.deployments.deploy._logic.deploy_config import (
|
15
|
+
DeployConfig,
|
16
|
+
)
|
17
|
+
|
18
|
+
FAILED_STATUS = [
|
19
|
+
"FAILED_DEPLOYMENT",
|
20
|
+
"FAILED_INITIATING_DEPLOYMENT",
|
21
|
+
]
|
22
|
+
SUCCESSFUL_STATUS = ["SUCCESSFUL_DEPLOYMENT"]
|
23
|
+
END_STATUSES = SUCCESSFUL_STATUS + FAILED_STATUS
|
24
|
+
|
25
|
+
|
26
|
+
class BaseDeployExecutor(ABC):
|
27
|
+
def __init__(self, config: DeployConfig):
|
28
|
+
self.config = config
|
29
|
+
self.deploy_client = DeploymentManagementClient()
|
30
|
+
self.ecosystem_client = EcosystemClient()
|
31
|
+
self.user_config = UserAccountConfiguration().get_user_config()
|
32
|
+
self.instance_template_client = InstanceTemplateManagementClient()
|
33
|
+
|
34
|
+
def poll_until_complete(self, deployment_id: str, check_every_n_seconds: int):
|
35
|
+
def deployment_status():
|
36
|
+
status_response = self.deploy_client.get_deployment_status(
|
37
|
+
deployment_named_id=deployment_id
|
38
|
+
)
|
39
|
+
if ModelDeploymentStatus.Name(status_response.status) in END_STATUSES:
|
40
|
+
return ModelDeploymentStatus.Name(status_response.status)
|
41
|
+
|
42
|
+
status = deployment_status()
|
43
|
+
while status not in END_STATUSES:
|
44
|
+
sleep(check_every_n_seconds)
|
45
|
+
status = deployment_status()
|
46
|
+
return status
|
47
|
+
|
48
|
+
def poll_until_complete_multiple(
|
49
|
+
self, deployment_ids: List[str], check_every_n_seconds: int
|
50
|
+
):
|
51
|
+
def deployment_status(deployment_id: str):
|
52
|
+
status_response = self.deploy_client.get_deployment_status(
|
53
|
+
deployment_named_id=deployment_id
|
54
|
+
)
|
55
|
+
if ModelDeploymentStatus.Name(status_response.status) in END_STATUSES:
|
56
|
+
return ModelDeploymentStatus.Name(status_response.status)
|
57
|
+
|
58
|
+
statuses = [
|
59
|
+
deployment_status(deployment_id) for deployment_id in deployment_ids
|
60
|
+
]
|
61
|
+
while all(status not in END_STATUSES for status in statuses):
|
62
|
+
sleep(check_every_n_seconds)
|
63
|
+
statuses = [
|
64
|
+
deployment_status(deployment_id) for deployment_id in deployment_ids
|
65
|
+
]
|
66
|
+
return dict(zip(deployment_ids, statuses))
|
67
|
+
|
68
|
+
@abstractmethod
|
69
|
+
def deploy(self) -> DeployModelResponse:
|
70
|
+
pass
|
@@ -0,0 +1,261 @@
|
|
1
|
+
from dataclasses import dataclass, field
|
2
|
+
from enum import Enum
|
3
|
+
from typing import Dict, List, Optional, Tuple, Union
|
4
|
+
|
5
|
+
from frogml.core.inner.tool.run_config import (
|
6
|
+
ConfigCliMap,
|
7
|
+
FrogmlConfigBase,
|
8
|
+
YamlConfigMixin,
|
9
|
+
validate_bool,
|
10
|
+
validate_enum,
|
11
|
+
validate_float,
|
12
|
+
validate_int,
|
13
|
+
validate_list_of_strings,
|
14
|
+
validate_string,
|
15
|
+
)
|
16
|
+
from frogml.core.inner.tool.run_config.utils import validate_variations
|
17
|
+
|
18
|
+
from frogml_cli.commands.audience._logic.config.v1.audience_config import AudienceConfig
|
19
|
+
from frogml_cli.commands.auto_scalling._logic.config.config import AutoScaling
|
20
|
+
from frogml_cli.commands.models.deployments.deploy._logic.get_latest_successful_build import (
|
21
|
+
get_latest_successful_build_from_model,
|
22
|
+
)
|
23
|
+
|
24
|
+
|
25
|
+
class CompressionTypes(Enum):
|
26
|
+
UNCOMPRESSED = "uncompressed"
|
27
|
+
GZIP = "gzip"
|
28
|
+
SNAPPY = "snappy"
|
29
|
+
LZ4 = "lz4"
|
30
|
+
ZSTD = "zstd"
|
31
|
+
|
32
|
+
|
33
|
+
class AutoOffsetReset(Enum):
|
34
|
+
UNSET = "unset"
|
35
|
+
LATEST = "latest"
|
36
|
+
EARLIEST = "earliest"
|
37
|
+
|
38
|
+
|
39
|
+
class PurchaseOption(Enum):
|
40
|
+
SPOT = "spot"
|
41
|
+
ONDEMAND = "ondemand"
|
42
|
+
|
43
|
+
|
44
|
+
DEPLOYMENT_CLI_CONFIG_MAPPING: List[ConfigCliMap] = [
|
45
|
+
# Stream
|
46
|
+
# General
|
47
|
+
ConfigCliMap("model_id", "model_id", validate_string, True),
|
48
|
+
ConfigCliMap("build_id", "build_id", validate_string, False),
|
49
|
+
ConfigCliMap("environment_name", "environments", validate_list_of_strings, False),
|
50
|
+
# Kafka
|
51
|
+
ConfigCliMap(
|
52
|
+
"bootstrap_server", "stream.kafka.bootstrap_servers", validate_list_of_strings
|
53
|
+
),
|
54
|
+
# Kafka - Consumer
|
55
|
+
ConfigCliMap(
|
56
|
+
"consumer_bootstrap_server",
|
57
|
+
"stream.kafka.consumer.bootstrap_servers",
|
58
|
+
validate_list_of_strings,
|
59
|
+
False,
|
60
|
+
),
|
61
|
+
ConfigCliMap(
|
62
|
+
"consumer_topic", "stream.kafka.consumer.topic", validate_string, True
|
63
|
+
),
|
64
|
+
ConfigCliMap(
|
65
|
+
"consumer_group", "stream.kafka.consumer.group", validate_string, True
|
66
|
+
),
|
67
|
+
ConfigCliMap(
|
68
|
+
"consumer_auto_offset_reset",
|
69
|
+
"stream.kafka.consumer.auto_offset_reset",
|
70
|
+
validate_enum(AutoOffsetReset),
|
71
|
+
False,
|
72
|
+
),
|
73
|
+
ConfigCliMap(
|
74
|
+
"consumer_timeout", "stream.kafka.consumer.timeout", validate_int, True
|
75
|
+
),
|
76
|
+
ConfigCliMap(
|
77
|
+
"consumer_max_batch_size",
|
78
|
+
"stream.kafka.consumer.max_batch_size",
|
79
|
+
validate_int,
|
80
|
+
True,
|
81
|
+
),
|
82
|
+
ConfigCliMap(
|
83
|
+
"consumer_max_poll_latency",
|
84
|
+
"stream.kafka.consumer.max_poll_latency",
|
85
|
+
validate_float,
|
86
|
+
True,
|
87
|
+
),
|
88
|
+
# Kafka - Producer
|
89
|
+
ConfigCliMap(
|
90
|
+
"producer_bootstrap_server",
|
91
|
+
"stream.kafka.producer.bootstrap_servers",
|
92
|
+
validate_list_of_strings,
|
93
|
+
False,
|
94
|
+
),
|
95
|
+
ConfigCliMap(
|
96
|
+
"producer_topic", "stream.kafka.producer.topic", validate_string, True
|
97
|
+
),
|
98
|
+
ConfigCliMap(
|
99
|
+
"producer_compression_type",
|
100
|
+
"stream.kafka.producer.compression_type",
|
101
|
+
validate_enum(CompressionTypes),
|
102
|
+
False,
|
103
|
+
),
|
104
|
+
ConfigCliMap("env_vars", "stream.env_vars", validate_list_of_strings),
|
105
|
+
# Realtime
|
106
|
+
ConfigCliMap("timeout", "realtime.timeout", validate_int, False),
|
107
|
+
ConfigCliMap("workers", "realtime.workers", validate_int, False),
|
108
|
+
ConfigCliMap("daemon_mode", "realtime.daemon_mode", validate_bool, False),
|
109
|
+
ConfigCliMap("server_workers", "realtime.workers", validate_int, False),
|
110
|
+
ConfigCliMap("max_batch_size", "realtime.max_batch_size", validate_int, False),
|
111
|
+
ConfigCliMap(
|
112
|
+
"deployment_timeout", "realtime.deployment_timeout", validate_int, False
|
113
|
+
),
|
114
|
+
ConfigCliMap("variation_name", "realtime.variation_name", validate_string, False),
|
115
|
+
ConfigCliMap(
|
116
|
+
"variation_protected_state",
|
117
|
+
"realtime.variation_protected_state",
|
118
|
+
validate_bool,
|
119
|
+
False,
|
120
|
+
),
|
121
|
+
ConfigCliMap(
|
122
|
+
"environment_name", "realtime.environments", validate_list_of_strings, False
|
123
|
+
),
|
124
|
+
ConfigCliMap(
|
125
|
+
"variations",
|
126
|
+
"realtime.variations",
|
127
|
+
validate_variations,
|
128
|
+
False,
|
129
|
+
),
|
130
|
+
ConfigCliMap("env_vars", "realtime.env_vars", validate_list_of_strings),
|
131
|
+
# Batch
|
132
|
+
# Resources
|
133
|
+
ConfigCliMap("pods", "resources.pods", validate_int, False),
|
134
|
+
ConfigCliMap("cpus", "resources.cpus", validate_int, False),
|
135
|
+
ConfigCliMap("memory", "resources.memory", validate_int, False),
|
136
|
+
ConfigCliMap("gpu_type", "resources.gpu_type", validate_string, False),
|
137
|
+
ConfigCliMap("gpu_amount", "resources.gpu_amount", validate_int, False),
|
138
|
+
ConfigCliMap("instance", "resources.instance_size", validate_string, False),
|
139
|
+
# Permissions
|
140
|
+
ConfigCliMap(
|
141
|
+
"iam_role_arn", "advanced_options.iam_role_arn", validate_string, False
|
142
|
+
),
|
143
|
+
ConfigCliMap(
|
144
|
+
"service_account_key_secret_name",
|
145
|
+
"advanced_options.service_account_key_secret_name",
|
146
|
+
validate_string,
|
147
|
+
False,
|
148
|
+
),
|
149
|
+
ConfigCliMap(
|
150
|
+
"purchase_option",
|
151
|
+
"advanced_options.purchase_option",
|
152
|
+
validate_enum(PurchaseOption),
|
153
|
+
False,
|
154
|
+
),
|
155
|
+
]
|
156
|
+
|
157
|
+
|
158
|
+
@dataclass
|
159
|
+
class DeployConfig(YamlConfigMixin, FrogmlConfigBase):
|
160
|
+
def _post_merge_cli(self):
|
161
|
+
if self.stream.kafka.bootstrap_servers:
|
162
|
+
if not self.stream.kafka.consumer.bootstrap_servers:
|
163
|
+
self.stream.kafka.consumer.bootstrap_servers = (
|
164
|
+
self.stream.kafka.bootstrap_servers
|
165
|
+
)
|
166
|
+
if not self.stream.kafka.producer.bootstrap_servers:
|
167
|
+
self.stream.kafka.producer.bootstrap_servers = (
|
168
|
+
self.stream.kafka.bootstrap_servers
|
169
|
+
)
|
170
|
+
if not self.build_id:
|
171
|
+
self.build_id = get_latest_successful_build_from_model(self.model_id)
|
172
|
+
|
173
|
+
@property
|
174
|
+
def _config_mapping(self) -> List[ConfigCliMap]:
|
175
|
+
return DEPLOYMENT_CLI_CONFIG_MAPPING
|
176
|
+
|
177
|
+
@dataclass
|
178
|
+
class Stream:
|
179
|
+
@dataclass
|
180
|
+
class Kafka:
|
181
|
+
@dataclass
|
182
|
+
class Consumer:
|
183
|
+
bootstrap_servers: List[str] = field(default_factory=list)
|
184
|
+
topic: str = field(default="")
|
185
|
+
group: str = field(default="")
|
186
|
+
auto_offset_reset: str = field(default=AutoOffsetReset.LATEST.name)
|
187
|
+
timeout: int = field(default=20)
|
188
|
+
max_batch_size: int = field(default=1)
|
189
|
+
max_poll_latency: float = field(default=1.0)
|
190
|
+
|
191
|
+
@dataclass
|
192
|
+
class Producer:
|
193
|
+
bootstrap_servers: List[str] = field(default_factory=list)
|
194
|
+
topic: str = field(default="")
|
195
|
+
compression_type: str = field(default=CompressionTypes.GZIP.name)
|
196
|
+
|
197
|
+
bootstrap_servers: List[str] = field(default_factory=list)
|
198
|
+
consumer: Consumer = field(default_factory=Consumer)
|
199
|
+
producer: Producer = field(default_factory=Producer)
|
200
|
+
|
201
|
+
kafka: Kafka = field(default_factory=Kafka)
|
202
|
+
env_vars: Optional[Union[List[str], Dict[str, str], Tuple]] = field(
|
203
|
+
default_factory=list
|
204
|
+
)
|
205
|
+
|
206
|
+
@dataclass
|
207
|
+
class Realtime:
|
208
|
+
@dataclass
|
209
|
+
class VariationConfig:
|
210
|
+
@dataclass
|
211
|
+
class TrafficConfig:
|
212
|
+
percentage: int = field(default=100)
|
213
|
+
shadow: bool = field(default=False)
|
214
|
+
|
215
|
+
name: str = field(default="default")
|
216
|
+
traffic: TrafficConfig = field(default_factory=TrafficConfig)
|
217
|
+
|
218
|
+
timeout: int = field(default=6000)
|
219
|
+
workers: int = field(default=2)
|
220
|
+
deployment_timeout: int = field(default=0)
|
221
|
+
daemon_mode: bool = field(default=True)
|
222
|
+
max_batch_size: int = field(default=1)
|
223
|
+
variation_name: str = field(default="")
|
224
|
+
variations: List[VariationConfig] = field(default_factory=list)
|
225
|
+
audiences: List[AudienceConfig] = field(default_factory=list)
|
226
|
+
environments: List[str] = field(default_factory=list)
|
227
|
+
fallback_variation: str = field(default="")
|
228
|
+
variation_protected_state: bool = field(default=False)
|
229
|
+
env_vars: Optional[Union[List[str], Dict[str, str], Tuple]] = field(
|
230
|
+
default_factory=list
|
231
|
+
)
|
232
|
+
|
233
|
+
@dataclass
|
234
|
+
class Batch:
|
235
|
+
pass
|
236
|
+
|
237
|
+
@dataclass
|
238
|
+
class Resources:
|
239
|
+
pods: int = field(default=1)
|
240
|
+
cpus: int = field(default=2)
|
241
|
+
memory: int = field(default=512)
|
242
|
+
gpu_type: str = field(default=None)
|
243
|
+
gpu_amount: int = field(default=0)
|
244
|
+
instance_size: str = field(default="")
|
245
|
+
|
246
|
+
@dataclass
|
247
|
+
class AdvancedOptions:
|
248
|
+
iam_role_arn: str = field(default=None)
|
249
|
+
purchase_option: str = field(default="")
|
250
|
+
service_account_key_secret_name: str = field(default=None)
|
251
|
+
|
252
|
+
model_id: str = field(default="")
|
253
|
+
build_id: str = field(default="")
|
254
|
+
environments: List[str] = field(default_factory=list)
|
255
|
+
|
256
|
+
stream: Stream = field(default_factory=Stream)
|
257
|
+
auto_scaling: AutoScaling = field(default=None)
|
258
|
+
realtime: Realtime = field(default_factory=Realtime)
|
259
|
+
batch: Batch = field(default_factory=Batch)
|
260
|
+
resources: Resources = field(default_factory=Resources)
|
261
|
+
advanced_options: AdvancedOptions = field(default_factory=AdvancedOptions)
|