qwak-sdk 0.1.0__py3-none-any.whl → 0.2.21rc0__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.21rc0.dist-info/METADATA +42 -0
- qwak_sdk-0.2.21rc0.dist-info/RECORD +302 -0
- {qwak_sdk-0.1.0.dist-info → qwak_sdk-0.2.21rc0.dist-info}/WHEEL +1 -2
- qwak_sdk-0.2.21rc0.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,98 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import (
|
|
6
|
+
BatchConfig,
|
|
7
|
+
EnvironmentDeploymentMessage,
|
|
8
|
+
HostingService,
|
|
9
|
+
KubeDeployment,
|
|
10
|
+
KubeDeploymentType,
|
|
11
|
+
ServingStrategy,
|
|
12
|
+
)
|
|
13
|
+
from qwak.clients.administration.eco_system.client import EcosystemClient
|
|
14
|
+
from qwak.clients.deployment.client import DeploymentManagementClient
|
|
15
|
+
from qwak.exceptions import QwakException
|
|
16
|
+
|
|
17
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.advance_deployment_options_handler import (
|
|
18
|
+
get_advanced_deployment_options_from_deploy_config,
|
|
19
|
+
)
|
|
20
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
21
|
+
DeployConfig,
|
|
22
|
+
)
|
|
23
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deployment_size_mapper import (
|
|
24
|
+
deployment_size_from_deploy_config,
|
|
25
|
+
)
|
|
26
|
+
from qwak_sdk.commands.models.deployments.deploy.realtime._logic.serving_strategy_mapper import (
|
|
27
|
+
create_realtime_serving_strategy_from_deploy_config,
|
|
28
|
+
)
|
|
29
|
+
from qwak_sdk.commands.models.deployments.deploy.streaming._logic.serving_strategy_mapper import (
|
|
30
|
+
create_streaming_serving_strategy_from_deploy_config,
|
|
31
|
+
)
|
|
32
|
+
from qwak_sdk.inner.tools.cli_tools import dictify_params
|
|
33
|
+
|
|
34
|
+
UNKNOWN_SERVING_STRATEGY = (
|
|
35
|
+
"The deployments type doesn't have a serving strategy configured"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def get_env_to_deployment_message(
|
|
40
|
+
deploy_config: DeployConfig,
|
|
41
|
+
kube_deployment_type: KubeDeploymentType,
|
|
42
|
+
deployment_client: DeploymentManagementClient,
|
|
43
|
+
ecosystem_client: EcosystemClient,
|
|
44
|
+
) -> Dict[str, EnvironmentDeploymentMessage]:
|
|
45
|
+
deployment_size = deployment_size_from_deploy_config(deploy_config)
|
|
46
|
+
advanced_deployment_options = get_advanced_deployment_options_from_deploy_config(
|
|
47
|
+
deploy_config, kube_deployment_type
|
|
48
|
+
)
|
|
49
|
+
environment_variables = {}
|
|
50
|
+
if kube_deployment_type == KubeDeploymentType.ONLINE:
|
|
51
|
+
model_traffic = deployment_client.get_model_traffic_config(
|
|
52
|
+
deploy_config.model_id
|
|
53
|
+
)
|
|
54
|
+
environment_name_to_config = ecosystem_client.get_environments_names_to_details(
|
|
55
|
+
deploy_config.realtime.environments
|
|
56
|
+
)
|
|
57
|
+
env_to_serving_strategy = create_realtime_serving_strategy_from_deploy_config(
|
|
58
|
+
deploy_config,
|
|
59
|
+
model_traffic,
|
|
60
|
+
environment_name_to_config,
|
|
61
|
+
)
|
|
62
|
+
environment_variables = dictify_params(deploy_config.realtime.env_vars)
|
|
63
|
+
elif kube_deployment_type == KubeDeploymentType.BATCH:
|
|
64
|
+
env_to_serving_strategy = {
|
|
65
|
+
ecosystem_client.get_account_details().default_environment_id: ServingStrategy(
|
|
66
|
+
batch_config=BatchConfig()
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
elif kube_deployment_type == KubeDeploymentType.STREAM:
|
|
70
|
+
env_to_serving_strategy = {
|
|
71
|
+
ecosystem_client.get_account_details().default_environment_id: create_streaming_serving_strategy_from_deploy_config(
|
|
72
|
+
deploy_config
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
environment_variables = dictify_params(deploy_config.stream.env_vars)
|
|
76
|
+
else:
|
|
77
|
+
raise QwakException(UNKNOWN_SERVING_STRATEGY)
|
|
78
|
+
env_to_hosting_services = {
|
|
79
|
+
env_id: HostingService(
|
|
80
|
+
kube_deployment=KubeDeployment(
|
|
81
|
+
deployment_size=deployment_size,
|
|
82
|
+
advanced_deployment_options=advanced_deployment_options,
|
|
83
|
+
serving_strategy=serving_strategy,
|
|
84
|
+
kube_deployment_type=kube_deployment_type,
|
|
85
|
+
environment_variables=environment_variables,
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
for env_id, serving_strategy in env_to_serving_strategy.items()
|
|
89
|
+
}
|
|
90
|
+
env_deployment_messages = {
|
|
91
|
+
env_id: EnvironmentDeploymentMessage(
|
|
92
|
+
model_id=deploy_config.model_id,
|
|
93
|
+
build_id=deploy_config.build_id,
|
|
94
|
+
hosting_service=hosting_service,
|
|
95
|
+
)
|
|
96
|
+
for env_id, hosting_service in env_to_hosting_services.items()
|
|
97
|
+
}
|
|
98
|
+
return env_deployment_messages
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import ModelDeploymentStatus
|
|
4
|
+
from _qwak_proto.qwak.deployment.deployment_service_pb2 import DeployModelResponse
|
|
5
|
+
from _qwak_proto.qwak.ecosystem.v0.ecosystem_pb2 import UserContextEnvironmentDetails
|
|
6
|
+
from qwak.clients.administration.eco_system.client import EcosystemClient
|
|
7
|
+
from qwak.exceptions import QwakException
|
|
8
|
+
from tabulate import tabulate
|
|
9
|
+
|
|
10
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.base_deploy_executor import (
|
|
11
|
+
FAILED_STATUS,
|
|
12
|
+
BaseDeployExecutor,
|
|
13
|
+
)
|
|
14
|
+
from qwak_sdk.inner.tools.logger.logger import get_qwak_logger
|
|
15
|
+
from qwak_sdk.tools.utils import qwak_spinner
|
|
16
|
+
|
|
17
|
+
logger = get_qwak_logger()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def __client_deployment_remote(
|
|
21
|
+
deploy: BaseDeployExecutor, sync: bool, output_multiple: bool = False
|
|
22
|
+
):
|
|
23
|
+
try:
|
|
24
|
+
deploy_response: DeployModelResponse = deploy.deploy()
|
|
25
|
+
deploy_status, deploy_id = (
|
|
26
|
+
ModelDeploymentStatus.Name(deploy_response.status),
|
|
27
|
+
deploy_response.deployment_named_id,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if deploy_response.environment_to_deployment_result:
|
|
31
|
+
account_environments = EcosystemClient().get_environments()
|
|
32
|
+
output_deployments_response(account_environments, deploy, deploy_response)
|
|
33
|
+
__check_failed_deployments(account_environments, deploy_response)
|
|
34
|
+
|
|
35
|
+
if sync:
|
|
36
|
+
deployment_id_to_env = {}
|
|
37
|
+
for (
|
|
38
|
+
env_id,
|
|
39
|
+
env_deploy_response,
|
|
40
|
+
) in deploy_response.environment_to_deployment_result.items():
|
|
41
|
+
deployment_id_to_env[
|
|
42
|
+
env_deploy_response.deployment_named_id
|
|
43
|
+
] = account_environments.get(env_id).name
|
|
44
|
+
|
|
45
|
+
__sync_deployments(deploy, deployment_id_to_env)
|
|
46
|
+
|
|
47
|
+
if output_multiple:
|
|
48
|
+
return deploy_response.environment_to_deployment_result
|
|
49
|
+
else:
|
|
50
|
+
if "FAILED" in deploy_status:
|
|
51
|
+
raise QwakException(deploy_response.info)
|
|
52
|
+
|
|
53
|
+
if sync:
|
|
54
|
+
__sync_deployment(deploy, deploy_id)
|
|
55
|
+
|
|
56
|
+
if not sync:
|
|
57
|
+
logger.info(
|
|
58
|
+
"Deployment initiated successfully, Use --sync to wait for deployments to be ready."
|
|
59
|
+
)
|
|
60
|
+
return deploy_id, deploy_status
|
|
61
|
+
except Exception as e:
|
|
62
|
+
logger.error(f"Deployment failed, Error: {e}")
|
|
63
|
+
raise e
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def __check_failed_deployments(
|
|
67
|
+
account_environments: Dict[str, UserContextEnvironmentDetails],
|
|
68
|
+
deploy_response: DeployModelResponse,
|
|
69
|
+
):
|
|
70
|
+
failed_deployments = {}
|
|
71
|
+
for (
|
|
72
|
+
env_id,
|
|
73
|
+
env_deploy_response,
|
|
74
|
+
) in deploy_response.environment_to_deployment_result.items():
|
|
75
|
+
deploy_status = ModelDeploymentStatus.Name(env_deploy_response.status)
|
|
76
|
+
if "FAILED" in deploy_status:
|
|
77
|
+
env_config = account_environments.get(env_id)
|
|
78
|
+
failed_deployments[
|
|
79
|
+
env_config.name if env_config else env_id
|
|
80
|
+
] = env_deploy_response.info
|
|
81
|
+
if failed_deployments:
|
|
82
|
+
failed_deployments_message = "\n".join(
|
|
83
|
+
[
|
|
84
|
+
f"Environment {env_name}: {reason}"
|
|
85
|
+
for env_name, reason in failed_deployments.items()
|
|
86
|
+
]
|
|
87
|
+
)
|
|
88
|
+
raise QwakException(
|
|
89
|
+
f"The following deployments failed:\n {failed_deployments_message}"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def output_deployments_response(
|
|
94
|
+
account_environments: Dict[str, UserContextEnvironmentDetails],
|
|
95
|
+
deploy: BaseDeployExecutor,
|
|
96
|
+
deploy_response: DeployModelResponse,
|
|
97
|
+
):
|
|
98
|
+
for (
|
|
99
|
+
env_id,
|
|
100
|
+
env_deploy_response,
|
|
101
|
+
) in deploy_response.environment_to_deployment_result.items():
|
|
102
|
+
env_config = account_environments.get(env_id)
|
|
103
|
+
if env_deploy_response.status == ModelDeploymentStatus.INITIATING_DEPLOYMENT:
|
|
104
|
+
logger.info(
|
|
105
|
+
tabulate(
|
|
106
|
+
tabular_data=[
|
|
107
|
+
["Environment", env_config.name],
|
|
108
|
+
["Model ID", deploy.config.model_id],
|
|
109
|
+
["Build ID", deploy.config.build_id],
|
|
110
|
+
["Deployment ID", env_deploy_response.deployment_named_id],
|
|
111
|
+
],
|
|
112
|
+
tablefmt="fancy_grid",
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def __sync_deployments(
|
|
118
|
+
deploy: BaseDeployExecutor, deployment_id_to_env: Dict[str, str]
|
|
119
|
+
):
|
|
120
|
+
with qwak_spinner(
|
|
121
|
+
begin_text=f"Deploy - model: {deploy.config.model_id}, build: {deploy.config.build_id} "
|
|
122
|
+
f"Environments: {', '.join(deploy.config.realtime.environments)}",
|
|
123
|
+
end_text="Successful deployments",
|
|
124
|
+
print_callback=print,
|
|
125
|
+
):
|
|
126
|
+
deployment_id_to_status = deploy.poll_until_complete_multiple(
|
|
127
|
+
list(deployment_id_to_env.keys()), poll_period=600
|
|
128
|
+
)
|
|
129
|
+
failed_deployments = []
|
|
130
|
+
for deployment_id, status in deployment_id_to_status.items():
|
|
131
|
+
if status in FAILED_STATUS:
|
|
132
|
+
failed_deployments.append(
|
|
133
|
+
f"Environment {deployment_id_to_env.get(deployment_id)} "
|
|
134
|
+
f"failed with status: {status}"
|
|
135
|
+
)
|
|
136
|
+
if failed_deployments:
|
|
137
|
+
raise QwakException("\n".join(failed_deployments))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def __sync_deployment(deploy: BaseDeployExecutor, deploy_name: str):
|
|
141
|
+
with qwak_spinner(
|
|
142
|
+
begin_text=f"Deploy - model: {deploy.config.model_id}, build: {deploy.config.build_id}",
|
|
143
|
+
end_text="Successful deployments",
|
|
144
|
+
print_callback=print,
|
|
145
|
+
):
|
|
146
|
+
deployment_status = deploy.poll_until_complete(deploy_name, poll_period=600)
|
|
147
|
+
if deployment_status in FAILED_STATUS:
|
|
148
|
+
raise QwakException(deployment_status)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def client_deployment(
|
|
152
|
+
deploy: BaseDeployExecutor, sync: bool, output_multiple: bool = False
|
|
153
|
+
):
|
|
154
|
+
return __client_deployment_remote(deploy, sync, output_multiple)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import DeploymentSize, MemoryUnit
|
|
4
|
+
from _qwak_proto.qwak.user_application.common.v0.resources_pb2 import GpuResources
|
|
5
|
+
|
|
6
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
7
|
+
DeployConfig,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def deployment_size_from_deploy_config(deploy_config: DeployConfig) -> DeploymentSize:
|
|
12
|
+
return DeploymentSize(
|
|
13
|
+
number_of_pods=deploy_config.resources.pods,
|
|
14
|
+
cpu=deploy_config.resources.cpus,
|
|
15
|
+
memory_amount=deploy_config.resources.memory,
|
|
16
|
+
memory_units=MemoryUnit.MIB,
|
|
17
|
+
gpu_resources=GpuResources(
|
|
18
|
+
gpu_type=deploy_config.resources.gpu_type,
|
|
19
|
+
gpu_amount=deploy_config.resources.gpu_amount,
|
|
20
|
+
),
|
|
21
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from copy import deepcopy
|
|
2
|
+
|
|
3
|
+
from _qwak_proto.qwak.builds.builds_pb2 import SUCCESSFUL
|
|
4
|
+
from qwak.clients.build_management.client import BuildsManagementClient
|
|
5
|
+
from qwak.clients.model_management.client import ModelsManagementClient
|
|
6
|
+
from qwak.exceptions import QwakException
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_latest_successful_build_from_model(model_id: str) -> str:
|
|
10
|
+
"""Get the latest successful build from model
|
|
11
|
+
|
|
12
|
+
Args:
|
|
13
|
+
model_id: Model id to search build for.
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
str: Latest build id.
|
|
17
|
+
|
|
18
|
+
Raises:
|
|
19
|
+
QwakException: if no successful build exists in model.
|
|
20
|
+
"""
|
|
21
|
+
model = ModelsManagementClient().get_model(model_id)
|
|
22
|
+
model_uuid = model.uuid
|
|
23
|
+
last_successful_build = BuildsManagementClient().list_builds(model_uuid)
|
|
24
|
+
builds = deepcopy(last_successful_build.builds)
|
|
25
|
+
builds = [build for build in builds if build.build_status == SUCCESSFUL]
|
|
26
|
+
builds.sort(key=lambda r: r.created_at.seconds)
|
|
27
|
+
|
|
28
|
+
if not builds:
|
|
29
|
+
raise QwakException(f"Unable to find successful build for model {model_id}")
|
|
30
|
+
|
|
31
|
+
return builds[-1].build_spec.build_id
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import TrafficSpec, Variation
|
|
6
|
+
from qwak.exceptions import QwakException
|
|
7
|
+
|
|
8
|
+
from qwak_sdk.commands.models._logic.variations import (
|
|
9
|
+
validate_percentages,
|
|
10
|
+
validate_shadow_variation,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def get_variations_for_deploy(
|
|
15
|
+
variation_name: str,
|
|
16
|
+
existing_variations: List[Variation],
|
|
17
|
+
requested_variations: List[Variation],
|
|
18
|
+
environment_name: str,
|
|
19
|
+
):
|
|
20
|
+
if not existing_variations:
|
|
21
|
+
existing_variations: List[Variation] = [
|
|
22
|
+
Variation(
|
|
23
|
+
name=variation_name,
|
|
24
|
+
traffic=TrafficSpec(
|
|
25
|
+
percentage=100,
|
|
26
|
+
is_shadow=False,
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
]
|
|
30
|
+
requested_variations_names = set(
|
|
31
|
+
map(lambda variation: variation.name, requested_variations)
|
|
32
|
+
)
|
|
33
|
+
existing_variations_names = set(
|
|
34
|
+
map(lambda variation: variation.name, existing_variations)
|
|
35
|
+
)
|
|
36
|
+
if requested_variations_names:
|
|
37
|
+
if variation_name not in requested_variations_names:
|
|
38
|
+
raise QwakException(
|
|
39
|
+
f"Selected deployment to variation '{variation_name}' in {environment_name}, but provided the "
|
|
40
|
+
f"following variations {list(requested_variations_names)}. "
|
|
41
|
+
f"Please modify the variation name, or adjust the requested variations definitions"
|
|
42
|
+
)
|
|
43
|
+
elif variation_name not in existing_variations_names:
|
|
44
|
+
raise QwakException(
|
|
45
|
+
f"Selected deployment to existing variation '{variation_name}' in {environment_name}, but it is not one of "
|
|
46
|
+
f"the existing variations {list(existing_variations_names)}. "
|
|
47
|
+
f"Please modify the variation name, or supply the requested variations definitions with"
|
|
48
|
+
f" the necessary changes"
|
|
49
|
+
)
|
|
50
|
+
else:
|
|
51
|
+
# We are deploying to an existing variations without any change
|
|
52
|
+
return existing_variations
|
|
53
|
+
|
|
54
|
+
ignored_variations = existing_variations_names.difference(
|
|
55
|
+
requested_variations_names
|
|
56
|
+
)
|
|
57
|
+
if ignored_variations:
|
|
58
|
+
raise QwakException(
|
|
59
|
+
f"The given variation configuration does not contain the configuration for the following "
|
|
60
|
+
f"variations {list(ignored_variations)} in {environment_name}. You must include all the existing "
|
|
61
|
+
f"variations configuration when passing the configuration"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
unexpected_variations = requested_variations_names.difference(
|
|
65
|
+
existing_variations_names
|
|
66
|
+
)
|
|
67
|
+
if variation_name in unexpected_variations:
|
|
68
|
+
unexpected_variations.remove(variation_name)
|
|
69
|
+
if unexpected_variations:
|
|
70
|
+
raise QwakException(
|
|
71
|
+
f"The given variation configuration contains the configuration for the following "
|
|
72
|
+
f"variations {list(unexpected_variations)} in {environment_name} which are not expected. When deploying, "
|
|
73
|
+
f"the variations configuration must contain all the existing variations, and an optional new variation."
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
validate_percentages(requested_variations)
|
|
77
|
+
validate_shadow_variation(requested_variations)
|
|
78
|
+
|
|
79
|
+
return requested_variations
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import AdvancedDeploymentOptions
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
4
|
+
DeployConfig,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def batch_advanced_deployment_options_from_deploy_config(
|
|
9
|
+
deploy_config: DeployConfig,
|
|
10
|
+
) -> AdvancedDeploymentOptions:
|
|
11
|
+
return AdvancedDeploymentOptions(
|
|
12
|
+
custom_iam_role_arn=deploy_config.advanced_options.iam_role_arn,
|
|
13
|
+
purchase_option=deploy_config.advanced_options.purchase_option,
|
|
14
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import KubeDeploymentType
|
|
2
|
+
from _qwak_proto.qwak.deployment.deployment_service_pb2 import DeployModelResponse
|
|
3
|
+
|
|
4
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.base_deploy_executor import (
|
|
5
|
+
BaseDeployExecutor,
|
|
6
|
+
)
|
|
7
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deployment_message_helpers import (
|
|
8
|
+
get_env_to_deployment_message,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class BatchDeployExecutor(BaseDeployExecutor):
|
|
13
|
+
def deploy(self) -> DeployModelResponse:
|
|
14
|
+
env_deployment_messages = get_env_to_deployment_message(
|
|
15
|
+
self.config,
|
|
16
|
+
KubeDeploymentType.BATCH,
|
|
17
|
+
self.deploy_client,
|
|
18
|
+
self.ecosystem_client,
|
|
19
|
+
)
|
|
20
|
+
return self.deploy_client.deploy_model(
|
|
21
|
+
model_id=self.config.model_id,
|
|
22
|
+
build_id=self.config.build_id,
|
|
23
|
+
env_deployment_messages=env_deployment_messages,
|
|
24
|
+
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import click
|
|
2
|
+
from qwak.inner.const import QwakConstants
|
|
3
|
+
|
|
4
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
5
|
+
DeployConfig,
|
|
6
|
+
PurchaseOption,
|
|
7
|
+
)
|
|
8
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deployment_response_handler import (
|
|
9
|
+
client_deployment,
|
|
10
|
+
)
|
|
11
|
+
from qwak_sdk.commands.models.deployments.deploy.batch._logic.deploy_executor import (
|
|
12
|
+
BatchDeployExecutor,
|
|
13
|
+
)
|
|
14
|
+
from qwak_sdk.inner.tools.cli_tools import QwakCommand
|
|
15
|
+
from qwak_sdk.inner.tools.config_handler import config_handler
|
|
16
|
+
from qwak_sdk.inner.tools.logger.logger import set_qwak_logger_stdout_verbosity_level
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@click.command("batch", help="Deploy batch model.", cls=QwakCommand)
|
|
20
|
+
@click.option(
|
|
21
|
+
"--build-id",
|
|
22
|
+
help="Build ID, If not specified latest successful build will deployed.",
|
|
23
|
+
type=str,
|
|
24
|
+
)
|
|
25
|
+
@click.option("--model-id", help="Model ID", type=str, required=True)
|
|
26
|
+
@click.option("--branch", help="Branch ID", type=str)
|
|
27
|
+
@click.option(
|
|
28
|
+
"--pods",
|
|
29
|
+
type=int,
|
|
30
|
+
help="Number of pods to deploy.",
|
|
31
|
+
)
|
|
32
|
+
@click.option(
|
|
33
|
+
"--cpus",
|
|
34
|
+
type=float,
|
|
35
|
+
help="Number of CPU cores, can be fraction of a core (e.g. 0.4).",
|
|
36
|
+
)
|
|
37
|
+
@click.option(
|
|
38
|
+
"--memory",
|
|
39
|
+
type=int,
|
|
40
|
+
help="Memory amount in Mib (e.g. 256).",
|
|
41
|
+
)
|
|
42
|
+
@click.option(
|
|
43
|
+
"--gpu-type",
|
|
44
|
+
metavar="NAME",
|
|
45
|
+
required=False,
|
|
46
|
+
help=f"Type of GPU to use on the deployments ({', '.join([x for x in QwakConstants.GPU_TYPES])}).",
|
|
47
|
+
type=click.STRING,
|
|
48
|
+
)
|
|
49
|
+
@click.option(
|
|
50
|
+
"--gpu-amount",
|
|
51
|
+
metavar="NAME",
|
|
52
|
+
required=False,
|
|
53
|
+
type=int,
|
|
54
|
+
help="Amount of GPU to use on the deployments.",
|
|
55
|
+
)
|
|
56
|
+
@click.option(
|
|
57
|
+
"--iam-role-arn",
|
|
58
|
+
type=str,
|
|
59
|
+
help="Custom IAM Role ARN.",
|
|
60
|
+
)
|
|
61
|
+
@click.option(
|
|
62
|
+
"--sync",
|
|
63
|
+
is_flag=True,
|
|
64
|
+
default=False,
|
|
65
|
+
help="Waiting for deployments to be ready",
|
|
66
|
+
)
|
|
67
|
+
@click.option(
|
|
68
|
+
"-v",
|
|
69
|
+
"--verbose",
|
|
70
|
+
count=True,
|
|
71
|
+
help="Log verbosity level - v: INFO, vv: DEBUG [default: WARNING]",
|
|
72
|
+
)
|
|
73
|
+
@click.option(
|
|
74
|
+
"-f",
|
|
75
|
+
"--from-file",
|
|
76
|
+
help="Deploy by run_config file, Command arguments will overwrite any run_config.",
|
|
77
|
+
required=False,
|
|
78
|
+
type=click.Path(exists=True, resolve_path=True, dir_okay=False),
|
|
79
|
+
)
|
|
80
|
+
@click.option(
|
|
81
|
+
"--out-conf",
|
|
82
|
+
help="Extract deploy conf from commands arguments, the commands will not run it wil only output valid yaml "
|
|
83
|
+
"structure",
|
|
84
|
+
default=False,
|
|
85
|
+
is_flag=True,
|
|
86
|
+
)
|
|
87
|
+
@click.option(
|
|
88
|
+
"--purchase-option",
|
|
89
|
+
required=False,
|
|
90
|
+
type=click.Choice([i.value for i in PurchaseOption], case_sensitive=False),
|
|
91
|
+
help="Indicate the instance deployments type, whether it is spot/ondemand. Default is spot",
|
|
92
|
+
)
|
|
93
|
+
def batch(verbose: bool, from_file: str, out_conf: bool, sync: bool, **kwargs):
|
|
94
|
+
set_qwak_logger_stdout_verbosity_level(verbose + 1)
|
|
95
|
+
config: DeployConfig = config_handler(
|
|
96
|
+
config=DeployConfig,
|
|
97
|
+
from_file=from_file,
|
|
98
|
+
out_conf=out_conf,
|
|
99
|
+
sections=("batch",),
|
|
100
|
+
**kwargs,
|
|
101
|
+
)
|
|
102
|
+
if not out_conf:
|
|
103
|
+
deploy_executor = BatchDeployExecutor(config)
|
|
104
|
+
client_deployment(deploy=deploy_executor, sync=sync)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from click import group
|
|
2
|
+
|
|
3
|
+
from qwak_sdk.commands.models.deployments.deploy.batch.ui import batch
|
|
4
|
+
from qwak_sdk.commands.models.deployments.deploy.realtime.ui import realtime
|
|
5
|
+
from qwak_sdk.commands.models.deployments.deploy.streaming.ui import stream
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@group(
|
|
9
|
+
name="deploy",
|
|
10
|
+
help="Model deployments",
|
|
11
|
+
)
|
|
12
|
+
def deploy_group():
|
|
13
|
+
# Click group injection
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
deploy_group.add_command(realtime, "realtime")
|
|
18
|
+
deploy_group.add_command(stream, "stream")
|
|
19
|
+
deploy_group.add_command(batch, "batch")
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import AdvancedDeploymentOptions
|
|
2
|
+
from google.protobuf.wrappers_pb2 import BoolValue
|
|
3
|
+
|
|
4
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deploy_config import (
|
|
5
|
+
DeployConfig,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def realtime_advanced_deployment_options_from_deploy_config(
|
|
10
|
+
deploy_config: DeployConfig,
|
|
11
|
+
) -> AdvancedDeploymentOptions:
|
|
12
|
+
return AdvancedDeploymentOptions(
|
|
13
|
+
number_of_http_server_workers=deploy_config.realtime.workers,
|
|
14
|
+
http_request_timeout_ms=deploy_config.realtime.timeout,
|
|
15
|
+
daemon_mode=BoolValue(value=deploy_config.realtime.daemon_mode),
|
|
16
|
+
max_batch_size=deploy_config.realtime.max_batch_size,
|
|
17
|
+
custom_iam_role_arn=deploy_config.advanced_options.iam_role_arn,
|
|
18
|
+
purchase_option=deploy_config.advanced_options.purchase_option,
|
|
19
|
+
deployment_process_timeout_limit=deploy_config.realtime.deployment_timeout,
|
|
20
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from _qwak_proto.qwak.deployment.deployment_pb2 import KubeDeploymentType
|
|
2
|
+
from _qwak_proto.qwak.deployment.deployment_service_pb2 import DeployModelResponse
|
|
3
|
+
|
|
4
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.base_deploy_executor import (
|
|
5
|
+
BaseDeployExecutor,
|
|
6
|
+
)
|
|
7
|
+
from qwak_sdk.commands.models.deployments.deploy._logic.deployment_message_helpers import (
|
|
8
|
+
get_env_to_deployment_message,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class RealtimeDeployExecutor(BaseDeployExecutor):
|
|
13
|
+
def deploy(self) -> DeployModelResponse:
|
|
14
|
+
env_deployment_messages = get_env_to_deployment_message(
|
|
15
|
+
self.config,
|
|
16
|
+
KubeDeploymentType.ONLINE,
|
|
17
|
+
self.deploy_client,
|
|
18
|
+
self.ecosystem_client,
|
|
19
|
+
)
|
|
20
|
+
return self.deploy_client.deploy_model(
|
|
21
|
+
model_id=self.config.model_id,
|
|
22
|
+
build_id=self.config.build_id,
|
|
23
|
+
env_deployment_messages=env_deployment_messages,
|
|
24
|
+
)
|