qwak-sdk 0.1.0__py3-none-any.whl → 0.2.20rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of qwak-sdk might be problematic. Click here for more details.
- qwak_sdk/__init__.py +9 -0
- qwak_sdk/cli.py +51 -0
- qwak_sdk/commands/admin/__init__.py +0 -0
- qwak_sdk/commands/admin/admin_commands_group.py +17 -0
- qwak_sdk/commands/admin/apikeys/__init__.py +0 -0
- qwak_sdk/commands/admin/apikeys/api_keys_commands_group.py +17 -0
- qwak_sdk/commands/admin/apikeys/generate/__init__.py +0 -0
- qwak_sdk/commands/admin/apikeys/generate/_logic.py +21 -0
- qwak_sdk/commands/admin/apikeys/generate/ui.py +45 -0
- qwak_sdk/commands/admin/apikeys/revoke/__init__.py +0 -0
- qwak_sdk/commands/admin/apikeys/revoke/_logic.py +22 -0
- qwak_sdk/commands/admin/apikeys/revoke/ui.py +31 -0
- qwak_sdk/commands/audience/__init__.py +0 -0
- qwak_sdk/commands/audience/_logic/__init__.py +0 -0
- qwak_sdk/commands/audience/_logic/config/__init__.py +0 -0
- qwak_sdk/commands/audience/_logic/config/config_base.py +16 -0
- qwak_sdk/commands/audience/_logic/config/parser.py +28 -0
- qwak_sdk/commands/audience/_logic/config/v1/__init__.py +0 -0
- qwak_sdk/commands/audience/_logic/config/v1/audience_config.py +26 -0
- qwak_sdk/commands/audience/_logic/config/v1/conditions_config.py +60 -0
- qwak_sdk/commands/audience/_logic/config/v1/config_v1.py +24 -0
- qwak_sdk/commands/audience/_logic/config/v1/route_config.py +14 -0
- qwak_sdk/commands/audience/_logic/config/v1/spec.py +11 -0
- qwak_sdk/commands/auto_scalling/__init__.py +0 -0
- qwak_sdk/commands/auto_scalling/_logic/__init__.py +0 -0
- qwak_sdk/commands/auto_scalling/_logic/config/__init__.py +3 -0
- qwak_sdk/commands/auto_scalling/_logic/config/config.py +100 -0
- qwak_sdk/commands/auto_scalling/_logic/config/parser.py +21 -0
- qwak_sdk/commands/auto_scalling/attach/__init__.py +0 -0
- qwak_sdk/commands/auto_scalling/attach/_logic.py +43 -0
- qwak_sdk/commands/auto_scalling/attach/ui.py +21 -0
- qwak_sdk/commands/auto_scalling/autoscaling_commands_group.py +15 -0
- qwak_sdk/commands/automations/__init__.py +0 -0
- qwak_sdk/commands/automations/automations_commands_group.py +30 -0
- qwak_sdk/commands/automations/delete/__init__.py +0 -0
- qwak_sdk/commands/automations/delete/_logic.py +6 -0
- qwak_sdk/commands/automations/delete/ui.py +23 -0
- qwak_sdk/commands/automations/executions/__init__.py +0 -0
- qwak_sdk/commands/automations/executions/executions_commands_group.py +14 -0
- qwak_sdk/commands/automations/executions/list/__init__.py +0 -0
- qwak_sdk/commands/automations/executions/list/_logic.py +8 -0
- qwak_sdk/commands/automations/executions/list/ui.py +25 -0
- qwak_sdk/commands/automations/list/__init__.py +0 -0
- qwak_sdk/commands/automations/list/_logic.py +8 -0
- qwak_sdk/commands/automations/list/ui.py +21 -0
- qwak_sdk/commands/automations/register/__init__.py +0 -0
- qwak_sdk/commands/automations/register/_logic.py +43 -0
- qwak_sdk/commands/automations/register/ui.py +44 -0
- qwak_sdk/commands/feature_store/__init__.py +0 -0
- qwak_sdk/commands/feature_store/delete/__init__.py +0 -0
- qwak_sdk/commands/feature_store/delete/_logic.py +52 -0
- qwak_sdk/commands/feature_store/delete/ui.py +40 -0
- qwak_sdk/commands/feature_store/feature_store_command_group.py +25 -0
- qwak_sdk/commands/feature_store/list/__init__.py +0 -0
- qwak_sdk/commands/feature_store/list/ui.py +140 -0
- qwak_sdk/commands/feature_store/pause/__init__.py +0 -0
- qwak_sdk/commands/feature_store/pause/ui.py +18 -0
- qwak_sdk/commands/feature_store/register/__init__.py +0 -0
- qwak_sdk/commands/feature_store/register/_logic.py +289 -0
- qwak_sdk/commands/feature_store/register/ui.py +105 -0
- qwak_sdk/commands/feature_store/resume/__init__.py +0 -0
- qwak_sdk/commands/feature_store/resume/ui.py +18 -0
- qwak_sdk/commands/feature_store/trigger/__init__.py +0 -0
- qwak_sdk/commands/feature_store/trigger/ui.py +32 -0
- qwak_sdk/commands/models/__init__.py +0 -0
- qwak_sdk/commands/models/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/_logic/variations.py +55 -0
- qwak_sdk/commands/models/build/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/build_steps.py +68 -0
- qwak_sdk/commands/models/build/_logic/client_logs/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/client_logs/build_run_handlers.py +189 -0
- qwak_sdk/commands/models/build/_logic/client_logs/cli_ui.py +125 -0
- qwak_sdk/commands/models/build/_logic/client_logs/logger.py +88 -0
- qwak_sdk/commands/models/build/_logic/client_logs/messages.py +40 -0
- qwak_sdk/commands/models/build/_logic/client_logs/notifier_impl.py +49 -0
- qwak_sdk/commands/models/build/_logic/client_logs/spinner.py +14 -0
- qwak_sdk/commands/models/build/_logic/client_logs/time_source.py +37 -0
- qwak_sdk/commands/models/build/_logic/client_logs/utils.py +12 -0
- qwak_sdk/commands/models/build/_logic/config/config_v1.py +253 -0
- qwak_sdk/commands/models/build/_logic/constant/host_resource.py +4 -0
- qwak_sdk/commands/models/build/_logic/constant/step_description.py +29 -0
- qwak_sdk/commands/models/build/_logic/constant/temp_dir.py +2 -0
- qwak_sdk/commands/models/build/_logic/constant/upload_tag.py +5 -0
- qwak_sdk/commands/models/build/_logic/context.py +62 -0
- qwak_sdk/commands/models/build/_logic/interface/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/interface/notifier_interface.py +29 -0
- qwak_sdk/commands/models/build/_logic/interface/step_inteface.py +29 -0
- qwak_sdk/commands/models/build/_logic/phase/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/__init__.py +14 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_model_step.py +42 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/common.py +33 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/fetch_strategy_manager.py +60 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/folder/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/folder/folder_strategy.py +73 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/git/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/git/git_strategy.py +149 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/strategy.py +69 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/zip/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/fetch_model_step/fetch_strategy_manager/strategy/zip/zip_strategy.py +64 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/post_fetch_validation_step.py +117 -0
- qwak_sdk/commands/models/build/_logic/phase/a_fetch_model_code/pre_fetch_validation_step.py +135 -0
- qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/__init__.py +11 -0
- qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/cleanup_step.py +20 -0
- qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/start_remote_build_step.py +42 -0
- qwak_sdk/commands/models/build/_logic/phase/b_remote_register_qwak_build/upload_step.py +349 -0
- qwak_sdk/commands/models/build/_logic/phase/c_deploy/__init__.py +6 -0
- qwak_sdk/commands/models/build/_logic/phase/c_deploy/build_polling_status.py +54 -0
- qwak_sdk/commands/models/build/_logic/phase/c_deploy/deploy_build.py +44 -0
- qwak_sdk/commands/models/build/_logic/util/__init__.py +0 -0
- qwak_sdk/commands/models/build/_logic/util/protobuf_factory.py +45 -0
- qwak_sdk/commands/models/build/_logic/util/step_decorator.py +37 -0
- qwak_sdk/commands/models/build/_logic/util/text.py +9 -0
- qwak_sdk/commands/models/build/ui.py +241 -0
- qwak_sdk/commands/models/builds/__init__.py +0 -0
- qwak_sdk/commands/models/builds/builds_commands_group.py +16 -0
- qwak_sdk/commands/models/builds/cancel/__init__.py +0 -0
- qwak_sdk/commands/models/builds/cancel/_logic.py +5 -0
- qwak_sdk/commands/models/builds/cancel/ui.py +15 -0
- qwak_sdk/commands/models/builds/logs/__init__.py +0 -0
- qwak_sdk/commands/models/builds/logs/ui.py +35 -0
- qwak_sdk/commands/models/builds/status/__init__.py +0 -0
- qwak_sdk/commands/models/builds/status/_logic.py +6 -0
- qwak_sdk/commands/models/builds/status/ui.py +30 -0
- qwak_sdk/commands/models/create/__init__.py +0 -0
- qwak_sdk/commands/models/create/_logic.py +35 -0
- qwak_sdk/commands/models/create/ui.py +27 -0
- qwak_sdk/commands/models/delete/__init__.py +0 -0
- qwak_sdk/commands/models/delete/_logic.py +5 -0
- qwak_sdk/commands/models/delete/ui.py +16 -0
- qwak_sdk/commands/models/deployments/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/advance_deployment_options_handler.py +31 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/base_deploy_executor.py +64 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/deploy_config.py +241 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/deployment.py +405 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/deployment_message_helpers.py +98 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/deployment_response_handler.py +154 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/deployment_size_mapper.py +21 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/get_latest_successful_build.py +31 -0
- qwak_sdk/commands/models/deployments/deploy/_logic/variations.py +79 -0
- qwak_sdk/commands/models/deployments/deploy/batch/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/batch/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/batch/_logic/advanced_deployment_mapper.py +14 -0
- qwak_sdk/commands/models/deployments/deploy/batch/_logic/deploy_executor.py +24 -0
- qwak_sdk/commands/models/deployments/deploy/batch/ui.py +104 -0
- qwak_sdk/commands/models/deployments/deploy/deploy_commands_group.py +19 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/_logic/advanced_deployment_mapper.py +20 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/_logic/deploy_executor.py +24 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/_logic/serving_strategy_mapper.py +105 -0
- qwak_sdk/commands/models/deployments/deploy/realtime/ui.py +179 -0
- qwak_sdk/commands/models/deployments/deploy/streaming/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/streaming/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/deploy/streaming/_logic/deploy_executor.py +24 -0
- qwak_sdk/commands/models/deployments/deploy/streaming/_logic/serving_strategy_mapper.py +38 -0
- qwak_sdk/commands/models/deployments/deploy/streaming/ui.py +196 -0
- qwak_sdk/commands/models/deployments/undeploy/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/undeploy/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/deployments/undeploy/_logic/request_undeploy.py +176 -0
- qwak_sdk/commands/models/deployments/undeploy/_logic/variations.py +74 -0
- qwak_sdk/commands/models/deployments/undeploy/ui.py +78 -0
- qwak_sdk/commands/models/executions/__init__.py +0 -0
- qwak_sdk/commands/models/executions/cancel/__init__.py +0 -0
- qwak_sdk/commands/models/executions/cancel/_logic.py +9 -0
- qwak_sdk/commands/models/executions/cancel/ui.py +27 -0
- qwak_sdk/commands/models/executions/execution_commands_group.py +24 -0
- qwak_sdk/commands/models/executions/report/__init__.py +0 -0
- qwak_sdk/commands/models/executions/report/_logic.py +14 -0
- qwak_sdk/commands/models/executions/report/ui.py +43 -0
- qwak_sdk/commands/models/executions/start/__init__.py +0 -0
- qwak_sdk/commands/models/executions/start/_logic.py +16 -0
- qwak_sdk/commands/models/executions/start/ui.py +176 -0
- qwak_sdk/commands/models/executions/status/__init__.py +0 -0
- qwak_sdk/commands/models/executions/status/_logic.py +13 -0
- qwak_sdk/commands/models/executions/status/ui.py +27 -0
- qwak_sdk/commands/models/init/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/initialize_model_structure.py +40 -0
- qwak_sdk/commands/models/init/_logic/template/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/churn/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/churn/cookiecutter.json +3 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/main/model.py +95 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/churn/{{cookiecutter.model_directory}}/tests/it/test_churn.py +32 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/cookiecutter.json +3 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/data.csv +1001 -0
- qwak_sdk/commands/models/init/_logic/template/credit_risk/{{cookiecutter.model_directory}}/main/model.py +108 -0
- qwak_sdk/commands/models/init/_logic/template/general/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/general/cookiecutter.json +6 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/__init__.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/conda.yml +8 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.main_directory}}/model.py +66 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/general/{{cookiecutter.model_directory}}/{{cookiecutter.test_directory}}/test_qwak_model.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/cookiecutter.json +3 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/conda.yml +10 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/main/model.py +98 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +24 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/cookiecutter.json +3 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/__init__.py +5 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/model.py +98 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/main/pyproject.toml +18 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/__init__.py +0 -0
- qwak_sdk/commands/models/init/_logic/template/titanic_poetry/{{cookiecutter.model_directory}}/tests/it/test_titanic.py +25 -0
- qwak_sdk/commands/models/init/ui.py +61 -0
- qwak_sdk/commands/models/list/__init__.py +0 -0
- qwak_sdk/commands/models/list/_logic.py +5 -0
- qwak_sdk/commands/models/list/ui.py +31 -0
- qwak_sdk/commands/models/models_command_group.py +36 -0
- qwak_sdk/commands/models/runtime/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/feedback/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/feedback/_logic.py +81 -0
- qwak_sdk/commands/models/runtime/feedback/ui.py +45 -0
- qwak_sdk/commands/models/runtime/logs/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/logs/ui.py +63 -0
- qwak_sdk/commands/models/runtime/runtime_commands_group.py +21 -0
- qwak_sdk/commands/models/runtime/traffic_update/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/traffic_update/_logic/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/traffic_update/_logic/execute_runtime_update_traffic.py +54 -0
- qwak_sdk/commands/models/runtime/traffic_update/_logic/variations.py +84 -0
- qwak_sdk/commands/models/runtime/traffic_update/ui.py +37 -0
- qwak_sdk/commands/models/runtime/update/__init__.py +0 -0
- qwak_sdk/commands/models/runtime/update/_logic.py +9 -0
- qwak_sdk/commands/models/runtime/update/ui.py +15 -0
- qwak_sdk/commands/projects/__init__.py +0 -0
- qwak_sdk/commands/projects/create/__init__.py +0 -0
- qwak_sdk/commands/projects/create/_logic.py +6 -0
- qwak_sdk/commands/projects/create/ui.py +21 -0
- qwak_sdk/commands/projects/delete/__init__.py +0 -0
- qwak_sdk/commands/projects/delete/_logic.py +6 -0
- qwak_sdk/commands/projects/delete/ui.py +15 -0
- qwak_sdk/commands/projects/list/__init__.py +0 -0
- qwak_sdk/commands/projects/list/_logic.py +6 -0
- qwak_sdk/commands/projects/list/ui.py +36 -0
- qwak_sdk/commands/projects/projects_command_group.py +19 -0
- qwak_sdk/commands/secrets/__init__.py +0 -0
- qwak_sdk/commands/secrets/delete/__init__.py +0 -0
- qwak_sdk/commands/secrets/delete/_logic.py +5 -0
- qwak_sdk/commands/secrets/delete/ui.py +21 -0
- qwak_sdk/commands/secrets/get/__init__.py +0 -0
- qwak_sdk/commands/secrets/get/_logic.py +5 -0
- qwak_sdk/commands/secrets/get/ui.py +17 -0
- qwak_sdk/commands/secrets/secrets_commands_group.py +19 -0
- qwak_sdk/commands/secrets/set/__init__.py +0 -0
- qwak_sdk/commands/secrets/set/_logic.py +5 -0
- qwak_sdk/commands/secrets/set/ui.py +16 -0
- qwak_sdk/commands/ui_tools.py +18 -0
- qwak_sdk/common/__init__.py +0 -0
- qwak_sdk/common/run_config/__init__.py +22 -0
- qwak_sdk/common/run_config/base.py +101 -0
- qwak_sdk/common/run_config/utils.py +249 -0
- qwak_sdk/exceptions/__init__.py +11 -0
- qwak_sdk/exceptions/qwak_command_exception.py +2 -0
- qwak_sdk/exceptions/qwak_deploy_new_build_failed.py +5 -0
- qwak_sdk/exceptions/qwak_general_build_exception.py +13 -0
- qwak_sdk/exceptions/qwak_remote_build_failed.py +5 -0
- qwak_sdk/exceptions/qwak_resource_not_found.py +2 -0
- qwak_sdk/exceptions/qwak_suggestion_exception.py +27 -0
- qwak_sdk/inner/__init__.py +0 -0
- qwak_sdk/inner/file_registry.py +97 -0
- qwak_sdk/inner/tools/__init__.py +0 -0
- qwak_sdk/inner/tools/cli_tools.py +159 -0
- qwak_sdk/inner/tools/config_handler.py +18 -0
- qwak_sdk/inner/tools/logger/__init__.py +3 -0
- qwak_sdk/inner/tools/logger/logger.py +269 -0
- qwak_sdk/inner/tools/logger/logging.yml +79 -0
- qwak_sdk/inner/tools/tracking.py +47 -0
- qwak_sdk/main.py +9 -0
- qwak_sdk/tools/__init__.py +0 -0
- qwak_sdk/tools/colors.py +13 -0
- qwak_sdk/tools/files.py +9 -0
- qwak_sdk/tools/log_handling.py +146 -0
- qwak_sdk/tools/utils.py +46 -0
- qwak_sdk-0.2.20rc0.dist-info/METADATA +42 -0
- qwak_sdk-0.2.20rc0.dist-info/RECORD +302 -0
- {qwak_sdk-0.1.0.dist-info → qwak_sdk-0.2.20rc0.dist-info}/WHEEL +1 -2
- qwak_sdk-0.2.20rc0.dist-info/entry_points.txt +3 -0
- qwak_sdk-0.1.0.dist-info/METADATA +0 -19
- qwak_sdk-0.1.0.dist-info/RECORD +0 -5
- qwak_sdk-0.1.0.dist-info/top_level.txt +0 -1
- {qwak-sdk → qwak_sdk/commands}/__init__.py +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import click
|
|
2
|
+
from qwak.inner.const import QwakConstants
|
|
3
|
+
|
|
4
|
+
from qwak_sdk.commands.models.build._logic.client_logs.cli_ui import (
|
|
5
|
+
execute_build_pipeline,
|
|
6
|
+
)
|
|
7
|
+
from qwak_sdk.commands.models.build._logic.config.config_v1 import ConfigV1
|
|
8
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
9
|
+
from qwak_sdk.inner.tools.config_handler import config_handler
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@click.command("build", cls=QwakCommand)
|
|
13
|
+
@click.option("--model-id", metavar="NAME", required=False, help="Model ID")
|
|
14
|
+
@click.option(
|
|
15
|
+
"--main-dir",
|
|
16
|
+
metavar="NAME",
|
|
17
|
+
help=f"Model main directory name, [Default: {ConfigV1.BuildProperties.ModelUri.main_dir}]",
|
|
18
|
+
)
|
|
19
|
+
@click.option(
|
|
20
|
+
"-P",
|
|
21
|
+
"--param-list",
|
|
22
|
+
required=False,
|
|
23
|
+
metavar="NAME=VALUE",
|
|
24
|
+
multiple=True,
|
|
25
|
+
help="A parameter for the build, of the form -P name=value. the params will be saved and can be viewed later",
|
|
26
|
+
)
|
|
27
|
+
@click.option(
|
|
28
|
+
"-E",
|
|
29
|
+
"--env-vars",
|
|
30
|
+
required=False,
|
|
31
|
+
metavar="NAME=VALUE",
|
|
32
|
+
multiple=True,
|
|
33
|
+
help="A parameter for the build, of the form -E name=value",
|
|
34
|
+
)
|
|
35
|
+
@click.option(
|
|
36
|
+
"-T",
|
|
37
|
+
"--tags",
|
|
38
|
+
required=False,
|
|
39
|
+
multiple=True,
|
|
40
|
+
help="A tag for the model build",
|
|
41
|
+
)
|
|
42
|
+
@click.option(
|
|
43
|
+
"--remote/--no-remote",
|
|
44
|
+
help=f"Whether to use remote mode."
|
|
45
|
+
f"\n[Default: {ConfigV1.BuildEnv.RemoteConf.is_remote}]",
|
|
46
|
+
default=None,
|
|
47
|
+
)
|
|
48
|
+
@click.option(
|
|
49
|
+
"--git-credentials",
|
|
50
|
+
required=False,
|
|
51
|
+
metavar="USERNAME:ACCESS_TOKEN",
|
|
52
|
+
help="Access credentials for private repositories listed in the python dependencies file",
|
|
53
|
+
)
|
|
54
|
+
@click.option(
|
|
55
|
+
"--git-branch",
|
|
56
|
+
metavar="NAME",
|
|
57
|
+
required=False,
|
|
58
|
+
help=f"Branch to use for git repo model code if defined."
|
|
59
|
+
f"\n[Default: {ConfigV1.BuildProperties.ModelUri.git_branch}]",
|
|
60
|
+
)
|
|
61
|
+
@click.option(
|
|
62
|
+
"--git-credentials-secret",
|
|
63
|
+
metavar="NAME",
|
|
64
|
+
required=False,
|
|
65
|
+
help="[REMOTE BUILD] Predefined Qwak secret secret name, that contains access credentials to private repositories"
|
|
66
|
+
+ "Secrets should be of the form USERNAME:ACCESS_TOKEN. For info regarding defining Qwak Secrets using the"
|
|
67
|
+
+ "`qwak secret` command",
|
|
68
|
+
)
|
|
69
|
+
@click.option(
|
|
70
|
+
"--cpus",
|
|
71
|
+
metavar="NAME",
|
|
72
|
+
required=False,
|
|
73
|
+
help="[REMOTE BUILD] Number of cpus to use on the remote build. [Default (If GPU not configured): 2] "
|
|
74
|
+
"(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
|
|
75
|
+
type=click.FLOAT,
|
|
76
|
+
)
|
|
77
|
+
@click.option(
|
|
78
|
+
"--memory",
|
|
79
|
+
metavar="NAME",
|
|
80
|
+
required=False,
|
|
81
|
+
help="[REMOTE BUILD] Memory to use on the remote build. [Default (If GPU not configured): 4Gi] "
|
|
82
|
+
"(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
|
|
83
|
+
)
|
|
84
|
+
@click.option(
|
|
85
|
+
"--gpu-type",
|
|
86
|
+
metavar="NAME",
|
|
87
|
+
required=False,
|
|
88
|
+
help=f"[REMOTE BUILD] Type of GPU to use on the remote build ({', '.join([x for x in QwakConstants.GPU_TYPES])})."
|
|
89
|
+
f"\n[Default: {ConfigV1.BuildEnv.RemoteConf.RemoteBuildResources.gpu_type}]"
|
|
90
|
+
"(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
|
|
91
|
+
type=click.STRING,
|
|
92
|
+
)
|
|
93
|
+
@click.option(
|
|
94
|
+
"--gpu-amount",
|
|
95
|
+
metavar="NAME",
|
|
96
|
+
required=False,
|
|
97
|
+
type=int,
|
|
98
|
+
help=f"[REMOTE BUILD] Amount of GPU to use on the remote build."
|
|
99
|
+
f"\n[Default: {ConfigV1.BuildEnv.RemoteConf.RemoteBuildResources.gpu_amount}] "
|
|
100
|
+
"(DO NOT CONFIGURE GPU AND CPU TOGETHER)",
|
|
101
|
+
)
|
|
102
|
+
@click.option(
|
|
103
|
+
"--gpu-compatible",
|
|
104
|
+
help=f"[REMOTE BUILD] Whether to build an image that is compatible to be deployd on a GPU instance."
|
|
105
|
+
f"\n[Default: {ConfigV1.BuildProperties.gpu_compatible}] ",
|
|
106
|
+
default=False,
|
|
107
|
+
is_flag=True,
|
|
108
|
+
)
|
|
109
|
+
@click.option(
|
|
110
|
+
"--iam-role-arn",
|
|
111
|
+
required=False,
|
|
112
|
+
type=str,
|
|
113
|
+
help="[REMOTE BUILD] Custom IAM Role ARN.",
|
|
114
|
+
)
|
|
115
|
+
@click.option(
|
|
116
|
+
"--push/--no-push",
|
|
117
|
+
default=None,
|
|
118
|
+
help="[LOCAL BUILD] Whether to push the model to the registry."
|
|
119
|
+
"\n[Default: Push enabled",
|
|
120
|
+
)
|
|
121
|
+
@click.option(
|
|
122
|
+
"--cache/--no-cache",
|
|
123
|
+
default=None,
|
|
124
|
+
help="Disable docker build cache. [Default: Cache enabled]",
|
|
125
|
+
)
|
|
126
|
+
@click.option(
|
|
127
|
+
"--aws-profile",
|
|
128
|
+
required=False,
|
|
129
|
+
help="[LOCAL BUILD] AWS Profile to use for s3 operations."
|
|
130
|
+
f"\n[Default: {ConfigV1.BuildEnv.LocalConf.aws_profile}]",
|
|
131
|
+
)
|
|
132
|
+
@click.option(
|
|
133
|
+
"-v",
|
|
134
|
+
"--verbose",
|
|
135
|
+
count=True,
|
|
136
|
+
default=None,
|
|
137
|
+
help="Log verbosity level - v: INFO, vv: DEBUG [default: WARNING], Default ERROR",
|
|
138
|
+
)
|
|
139
|
+
@click.option(
|
|
140
|
+
"--base-image",
|
|
141
|
+
help="Used for customizing the docker container image built for train, build and deploy."
|
|
142
|
+
"Docker images should be based on qwak images, The entrypoint or cmd of the docker "
|
|
143
|
+
"image should not be changed."
|
|
144
|
+
f"\n[Default: {ConfigV1.BuildEnv.DockerConf.base_image}]",
|
|
145
|
+
required=False,
|
|
146
|
+
)
|
|
147
|
+
@click.option(
|
|
148
|
+
"--qwak-sdk-extra-index-url",
|
|
149
|
+
required=False,
|
|
150
|
+
help="Extra index url to install from the Qwak-SDK on remote (enables running dev versions on remote build"
|
|
151
|
+
", it's required to upload the dev version to the index url of course)",
|
|
152
|
+
)
|
|
153
|
+
@click.option(
|
|
154
|
+
"-f",
|
|
155
|
+
"--from-file",
|
|
156
|
+
help="Build by run_config file, Command arguments will overwrite any run_config.",
|
|
157
|
+
required=False,
|
|
158
|
+
type=click.Path(exists=True, resolve_path=True, dir_okay=False),
|
|
159
|
+
)
|
|
160
|
+
@click.option(
|
|
161
|
+
"--out-conf",
|
|
162
|
+
help="Extract models build conf from command arguments, the command will not run it wil only output valid yaml "
|
|
163
|
+
"structure",
|
|
164
|
+
default=False,
|
|
165
|
+
is_flag=True,
|
|
166
|
+
)
|
|
167
|
+
@click.option(
|
|
168
|
+
"--json-logs",
|
|
169
|
+
help="Output logs as json for easier parsing",
|
|
170
|
+
default=False,
|
|
171
|
+
is_flag=True,
|
|
172
|
+
)
|
|
173
|
+
@click.option(
|
|
174
|
+
"--programmatic",
|
|
175
|
+
help="Run the _logic without the UI and receive the build id and any exception as return values",
|
|
176
|
+
default=False,
|
|
177
|
+
is_flag=True,
|
|
178
|
+
)
|
|
179
|
+
@click.option(
|
|
180
|
+
"--validate-build-artifact/--no-validate-build-artifact",
|
|
181
|
+
help="Skip validate build artifact step",
|
|
182
|
+
default=None,
|
|
183
|
+
)
|
|
184
|
+
@click.option(
|
|
185
|
+
"--tests/--no-tests",
|
|
186
|
+
help="Skip tests step",
|
|
187
|
+
default=None,
|
|
188
|
+
)
|
|
189
|
+
@click.option(
|
|
190
|
+
"--dependency-file-path",
|
|
191
|
+
help="Custom dependency file path",
|
|
192
|
+
default=None,
|
|
193
|
+
)
|
|
194
|
+
@click.option(
|
|
195
|
+
"--validate-build-artifact-timeout",
|
|
196
|
+
help="Timeout in seconds for the validation step",
|
|
197
|
+
default=120,
|
|
198
|
+
)
|
|
199
|
+
@click.option(
|
|
200
|
+
"--dependency-required-folders",
|
|
201
|
+
help="Comma separated list of folders to be copied into the build",
|
|
202
|
+
default=None,
|
|
203
|
+
required=False,
|
|
204
|
+
multiple=True,
|
|
205
|
+
)
|
|
206
|
+
@click.option(
|
|
207
|
+
"--deploy",
|
|
208
|
+
help="Whether you want to deploy the build if it finishes successfully. "
|
|
209
|
+
"Choosing this will follow the build process in the terminal and will trigger a deployment when the "
|
|
210
|
+
"build finishes.",
|
|
211
|
+
default=False,
|
|
212
|
+
is_flag=True,
|
|
213
|
+
)
|
|
214
|
+
@click.argument("uri", required=False)
|
|
215
|
+
def models_build(**kwargs):
|
|
216
|
+
return build(**kwargs)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def build(
|
|
220
|
+
from_file: str,
|
|
221
|
+
out_conf: bool,
|
|
222
|
+
json_logs: bool,
|
|
223
|
+
programmatic: bool,
|
|
224
|
+
**kwargs,
|
|
225
|
+
):
|
|
226
|
+
# If QWAK_DEBUG=true is set then the artifacts will not be deleted, all intermediate files located in ~/.qwak/builds
|
|
227
|
+
# Including all intermediate images
|
|
228
|
+
config: ConfigV1 = config_handler(
|
|
229
|
+
config=ConfigV1,
|
|
230
|
+
from_file=from_file,
|
|
231
|
+
out_conf=out_conf,
|
|
232
|
+
**kwargs,
|
|
233
|
+
)
|
|
234
|
+
if out_conf:
|
|
235
|
+
return
|
|
236
|
+
else:
|
|
237
|
+
return execute_build_pipeline(
|
|
238
|
+
config=config,
|
|
239
|
+
json_logs=json_logs,
|
|
240
|
+
programmatic=programmatic,
|
|
241
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.builds.cancel.ui import cancel_build
|
|
4
|
+
from qwak_sdk.commands.models.builds.logs.ui import build_logs
|
|
5
|
+
from qwak_sdk.commands.models.builds.status.ui import get_build_status
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@click.group(name="builds", help="Ongoing builds")
|
|
9
|
+
def builds_commands_group():
|
|
10
|
+
# Click commands group injection
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
builds_commands_group.add_command(cancel_build)
|
|
15
|
+
builds_commands_group.add_command(get_build_status)
|
|
16
|
+
builds_commands_group.add_command(build_logs)
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.builds.cancel._logic import execute_cancel_build
|
|
4
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
5
|
+
from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
|
|
6
|
+
|
|
7
|
+
logger = get_qwak_logger()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@click.command("cancel", cls=QwakCommand)
|
|
11
|
+
@click.argument("build_id")
|
|
12
|
+
def cancel_build(build_id, **kwargs):
|
|
13
|
+
logger.info(f"Attempting to cancel remote build with build id [{build_id}]")
|
|
14
|
+
execute_cancel_build(build_id=build_id)
|
|
15
|
+
logger.info("Successfully canceled remote build")
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
4
|
+
from qwak_sdk.tools.log_handling import QwakLogHandling
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@click.command("logs", cls=QwakCommand)
|
|
8
|
+
@click.option("-f", "--follow", is_flag=True, default=False, help="Follow log tail")
|
|
9
|
+
@click.option(
|
|
10
|
+
"-b", "--build-id", required=True, help="Runtime model Build ID to show logs of"
|
|
11
|
+
)
|
|
12
|
+
@click.option(
|
|
13
|
+
"-s",
|
|
14
|
+
"--since",
|
|
15
|
+
required=False,
|
|
16
|
+
metavar="X [TYPE] ago",
|
|
17
|
+
help=f"Get logs from X1 [type] X2 [type]... Xn [type] ago. "
|
|
18
|
+
f"(x = INT; type = {QwakLogHandling.TIME_UNITS}) i.e. [1 day 2 hours ago]",
|
|
19
|
+
)
|
|
20
|
+
@click.option(
|
|
21
|
+
"-n",
|
|
22
|
+
"--number-of-results",
|
|
23
|
+
required=False,
|
|
24
|
+
type=int,
|
|
25
|
+
help="Maximum number of results per query",
|
|
26
|
+
)
|
|
27
|
+
@click.option(
|
|
28
|
+
"-g", "--grep", required=False, help="Filter by log content contains [expression]"
|
|
29
|
+
)
|
|
30
|
+
def build_logs(
|
|
31
|
+
follow=True, build_id=None, since=None, number_of_results=None, grep=None, **kwargs
|
|
32
|
+
):
|
|
33
|
+
QwakLogHandling().get_logs(
|
|
34
|
+
follow, since, number_of_results, grep, {"build_id": build_id}, "build"
|
|
35
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
from _qwak_proto.qwak.builds.builds_pb2 import BuildStatus
|
|
5
|
+
|
|
6
|
+
from qwak_sdk.commands.models.builds.status._logic import execute_get_build_status
|
|
7
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
8
|
+
from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
|
|
9
|
+
|
|
10
|
+
logger = get_qwak_logger()
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@click.command("status", cls=QwakCommand)
|
|
14
|
+
@click.argument("build_id")
|
|
15
|
+
def get_build_status(build_id, **kwargs):
|
|
16
|
+
if kwargs["format"] == "text":
|
|
17
|
+
logger.info(f"Getting build status for build id [{build_id}]")
|
|
18
|
+
build_status = execute_get_build_status(build_id)
|
|
19
|
+
if kwargs["format"] == "text":
|
|
20
|
+
logger.info(f"Build status: {BuildStatus.Name(build_status)}")
|
|
21
|
+
elif kwargs["format"] == "json":
|
|
22
|
+
print(
|
|
23
|
+
json.dumps(
|
|
24
|
+
{
|
|
25
|
+
"build_id": build_id,
|
|
26
|
+
"build_status": BuildStatus.Name(build_status),
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
return BuildStatus.Name(build_status)
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from _qwak_proto.qwak.projects.projects_pb2 import (
|
|
2
|
+
CreateProjectResponse,
|
|
3
|
+
GetProjectResponse,
|
|
4
|
+
)
|
|
5
|
+
from qwak.clients.model_management import ModelsManagementClient
|
|
6
|
+
from qwak.clients.project.client import ProjectsManagementClient
|
|
7
|
+
from qwak.exceptions import QwakException
|
|
8
|
+
|
|
9
|
+
from qwak_sdk.exceptions import QwakCommandException
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def execute_model_create(model_name, model_description, project, project_id):
|
|
13
|
+
if not (project or project_id):
|
|
14
|
+
raise QwakCommandException("You nust supply either project or project_id")
|
|
15
|
+
|
|
16
|
+
if project_id:
|
|
17
|
+
resolved_project_id = project_id
|
|
18
|
+
else:
|
|
19
|
+
try:
|
|
20
|
+
project: GetProjectResponse = ProjectsManagementClient().get_project(
|
|
21
|
+
project_id="", project_name=project
|
|
22
|
+
)
|
|
23
|
+
resolved_project_id = project.project.spec.project_id
|
|
24
|
+
except QwakException:
|
|
25
|
+
print(f"Project with name {project} doesn't exist. Creating it.")
|
|
26
|
+
project_creation: CreateProjectResponse = (
|
|
27
|
+
ProjectsManagementClient().create_project(
|
|
28
|
+
project_name=project, project_description=""
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
resolved_project_id = project_creation.project.project_id
|
|
32
|
+
|
|
33
|
+
return ModelsManagementClient().create_model(
|
|
34
|
+
resolved_project_id, model_name, model_description
|
|
35
|
+
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.create._logic import execute_model_create
|
|
4
|
+
from qwak_sdk.commands.ui_tools import output_as_json
|
|
5
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
6
|
+
from qwak_sdk.tools.colors import Color
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@click.command("create", cls=QwakCommand)
|
|
10
|
+
@click.argument("name", metavar="name", required=True)
|
|
11
|
+
@click.option("--project", metavar="NAME", required=False, help="Project name")
|
|
12
|
+
@click.option("--project-id", metavar="ID", required=False, help="Project id")
|
|
13
|
+
@click.option(
|
|
14
|
+
"--description",
|
|
15
|
+
metavar="DESCRIPTION",
|
|
16
|
+
required=False,
|
|
17
|
+
help="Model description",
|
|
18
|
+
)
|
|
19
|
+
def model_create(name, description, project, project_id, **kwargs):
|
|
20
|
+
try:
|
|
21
|
+
response = execute_model_create(name, description, project, project_id)
|
|
22
|
+
if kwargs["format"] == "json":
|
|
23
|
+
output_as_json(response)
|
|
24
|
+
else:
|
|
25
|
+
print(f"Model created\nmodel id : {response.model_id}")
|
|
26
|
+
except Exception as e:
|
|
27
|
+
print(f"{Color.RED}Error creating model: {e}{Color.RED}")
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.delete._logic import execute_model_delete
|
|
4
|
+
from qwak_sdk.commands.ui_tools import output_as_json
|
|
5
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@click.command("delete", cls=QwakCommand)
|
|
9
|
+
@click.option("--project-id", metavar="NAME", required=True, help="Project id")
|
|
10
|
+
@click.option("--model-id", metavar="NAME", required=True, help="Model name")
|
|
11
|
+
def model_delete(project_id, model_id, **kwargs):
|
|
12
|
+
response = execute_model_delete(project_id, model_id)
|
|
13
|
+
if kwargs["format"] == "json":
|
|
14
|
+
output_as_json(response)
|
|
15
|
+
else:
|
|
16
|
+
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 _qwak_proto.qwak.deployment.deployment_pb2 import (
|
|
4
|
+
AdvancedDeploymentOptions,
|
|
5
|
+
KubeDeploymentType,
|
|
6
|
+
)
|
|
7
|
+
from qwak.exceptions import QwakException
|
|
8
|
+
|
|
9
|
+
from qwak_sdk.commands.models.deployments.deploy.batch._logic.advanced_deployment_mapper import (
|
|
10
|
+
batch_advanced_deployment_options_from_deploy_config,
|
|
11
|
+
)
|
|
12
|
+
from qwak_sdk.commands.models.deployments.deploy.realtime._logic.advanced_deployment_mapper import (
|
|
13
|
+
realtime_advanced_deployment_options_from_deploy_config,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
ADVANCED_DEPLOYMENT_UNRECOGNIZED_TYPE_ERROR = (
|
|
17
|
+
"The deployments type doesn't have an advanced deployments options configured"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_advanced_deployment_options_from_deploy_config(
|
|
22
|
+
deploy_config, kube_deployment_type
|
|
23
|
+
) -> AdvancedDeploymentOptions:
|
|
24
|
+
if kube_deployment_type == KubeDeploymentType.ONLINE:
|
|
25
|
+
return realtime_advanced_deployment_options_from_deploy_config(deploy_config)
|
|
26
|
+
elif kube_deployment_type == KubeDeploymentType.BATCH:
|
|
27
|
+
return batch_advanced_deployment_options_from_deploy_config(deploy_config)
|
|
28
|
+
elif kube_deployment_type == KubeDeploymentType.STREAM:
|
|
29
|
+
return AdvancedDeploymentOptions()
|
|
30
|
+
else:
|
|
31
|
+
raise QwakException(ADVANCED_DEPLOYMENT_UNRECOGNIZED_TYPE_ERROR)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from time import sleep
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import ModelDeploymentStatus
|
|
6
|
+
from _qwak_proto.qwak.deployment.deployment_service_pb2 import DeployModelResponse
|
|
7
|
+
from qwak.clients.administration.eco_system.client import EcosystemClient
|
|
8
|
+
from qwak.clients.deployment.client import DeploymentManagementClient
|
|
9
|
+
from qwak.inner.di_configuration import UserAccountConfiguration
|
|
10
|
+
|
|
11
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
12
|
+
DeployConfig,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
FAILED_STATUS = [
|
|
16
|
+
"FAILED_DEPLOYMENT",
|
|
17
|
+
"FAILED_INITIATING_DEPLOYMENT",
|
|
18
|
+
]
|
|
19
|
+
SUCCESSFUL_STATUS = ["SUCCESSFUL_DEPLOYMENT"]
|
|
20
|
+
END_STATUSES = SUCCESSFUL_STATUS + FAILED_STATUS
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BaseDeployExecutor(ABC):
|
|
24
|
+
def __init__(self, config: DeployConfig):
|
|
25
|
+
self.config = config
|
|
26
|
+
self.deploy_client = DeploymentManagementClient()
|
|
27
|
+
self.ecosystem_client = EcosystemClient()
|
|
28
|
+
self.user_config = UserAccountConfiguration().get_user_config()
|
|
29
|
+
|
|
30
|
+
def poll_until_complete(self, deployment_id: str, poll_period: int):
|
|
31
|
+
def deployment_status():
|
|
32
|
+
status_response = self.deploy_client.get_deployment_status(
|
|
33
|
+
deployment_named_id=deployment_id
|
|
34
|
+
)
|
|
35
|
+
if ModelDeploymentStatus.Name(status_response.status) in END_STATUSES:
|
|
36
|
+
return ModelDeploymentStatus.Name(status_response.status)
|
|
37
|
+
|
|
38
|
+
status = deployment_status()
|
|
39
|
+
while status not in END_STATUSES:
|
|
40
|
+
sleep(poll_period)
|
|
41
|
+
status = deployment_status()
|
|
42
|
+
return status
|
|
43
|
+
|
|
44
|
+
def poll_until_complete_multiple(self, deployment_ids: List[str], poll_period: int):
|
|
45
|
+
def deployment_status(deployment_id: str):
|
|
46
|
+
status_response = self.deploy_client.get_deployment_status(
|
|
47
|
+
deployment_named_id=deployment_id
|
|
48
|
+
)
|
|
49
|
+
if ModelDeploymentStatus.Name(status_response.status) in END_STATUSES:
|
|
50
|
+
return ModelDeploymentStatus.Name(status_response.status)
|
|
51
|
+
|
|
52
|
+
statuses = [
|
|
53
|
+
deployment_status(deployment_id) for deployment_id in deployment_ids
|
|
54
|
+
]
|
|
55
|
+
while all(status not in END_STATUSES for status in statuses):
|
|
56
|
+
sleep(poll_period)
|
|
57
|
+
statuses = [
|
|
58
|
+
deployment_status(deployment_id) for deployment_id in deployment_ids
|
|
59
|
+
]
|
|
60
|
+
return dict(zip(deployment_ids, statuses))
|
|
61
|
+
|
|
62
|
+
@abstractmethod
|
|
63
|
+
def deploy(self) -> DeployModelResponse:
|
|
64
|
+
pass
|