thestage 0.6.7__tar.gz → 0.7.0__tar.gz
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.
- {thestage-0.6.7 → thestage-0.7.0}/PKG-INFO +1 -1
- {thestage-0.6.7 → thestage-0.7.0}/pyproject.toml +1 -1
- {thestage-0.6.7 → thestage-0.7.0}/thestage/__init__.py +1 -1
- {thestage-0.6.7 → thestage-0.7.0}/thestage/cli_command.py +3 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/cli_command_helper.py +2 -2
- {thestage-0.6.7 → thestage-0.7.0}/thestage/config/__init__.py +1 -1
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/config/business}/app_config_service.py +3 -4
- {thestage-0.6.7/thestage/services/config_provider → thestage-0.7.0/thestage/config/business}/config_provider.py +6 -5
- {thestage-0.6.7/thestage/config → thestage-0.7.0/thestage/config/business}/config_storage.py +1 -1
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/config/business}/validation_service.py +9 -10
- thestage-0.6.7/thestage/controllers/config_controller.py → thestage-0.7.0/thestage/config/communication/config_command.py +7 -7
- {thestage-0.6.7/thestage/services/connect → thestage-0.7.0/thestage/connect/business}/connect_service.py +22 -19
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/connect/business}/remote_server_service.py +4 -5
- thestage-0.7.0/thestage/connect/communication/connect_api_client.py +84 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/add_ssh_key_to_user_response.py +0 -1
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/add_ssh_public_key_to_instance_response.py +1 -4
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/base_controller → thestage-0.7.0/thestage/connect/dto}/connect_resolve_response.py +0 -1
- {thestage-0.6.7 → thestage-0.7.0}/thestage/controllers/base_controller.py +2 -2
- thestage-0.7.0/thestage/debug_main.dist.py +30 -0
- {thestage-0.6.7/thestage/services/container → thestage-0.7.0/thestage/docker_container/business}/container_service.py +147 -22
- {thestage-0.6.7/thestage/services/container → thestage-0.7.0/thestage/docker_container/business}/mapper/container_mapper.py +3 -3
- thestage-0.7.0/thestage/docker_container/business/mapper/image_mapper.py +16 -0
- thestage-0.6.7/thestage/controllers/container_controller.py → thestage-0.7.0/thestage/docker_container/communication/docker_command.py +192 -29
- thestage-0.7.0/thestage/docker_container/communication/docker_container_api_client.py +139 -0
- thestage-0.7.0/thestage/docker_container/communication/image_command.py +40 -0
- thestage-0.7.0/thestage/docker_container/dto/container_action_request.py +11 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/docker_container/dto}/container_response.py +11 -4
- thestage-0.7.0/thestage/docker_container/dto/docker_container_create_request.py +28 -0
- thestage-0.7.0/thestage/docker_container/dto/docker_container_create_response.py +11 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/docker_container_controller → thestage-0.7.0/thestage/docker_container/dto}/docker_container_list_response.py +3 -5
- thestage-0.7.0/thestage/docker_container/dto/docker_image_list_request.py +11 -0
- thestage-0.7.0/thestage/docker_container/dto/docker_image_list_response.py +13 -0
- thestage-0.7.0/thestage/docker_container/dto/image_entity.py +14 -0
- {thestage-0.6.7/thestage/services/clients/git → thestage-0.7.0/thestage/git/communication}/git_client.py +4 -4
- thestage-0.7.0/thestage/global_dto/__init__.py +0 -0
- thestage-0.7.0/thestage/global_dto/enums/__init__.py +0 -0
- thestage-0.7.0/thestage/helpers/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/helpers/error_handler.py +4 -4
- thestage-0.7.0/thestage/helpers/logger/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/helpers/logger/app_logger.py +1 -3
- {thestage-0.6.7 → thestage-0.7.0}/thestage/i18n/en_GB/messages.po +14 -14
- thestage-0.7.0/thestage/inference_model/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_model/business/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_model/business/inference_model_service.py +281 -0
- thestage-0.7.0/thestage/inference_model/business/mapper/__init__.py +0 -0
- thestage-0.6.7/thestage/services/project/mapper/project_inference_simulator_model_mapper.py → thestage-0.7.0/thestage/inference_model/business/mapper/inference_model_mapper.py +5 -5
- thestage-0.7.0/thestage/inference_model/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_model/communication/inference_model_api_client.py +139 -0
- thestage-0.7.0/thestage/inference_model/communication/inference_model_command.py +246 -0
- thestage-0.7.0/thestage/inference_model/dto/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/deploy_inference_model_to_instance_response.py +0 -1
- thestage-0.7.0/thestage/inference_model/dto/enum/__init__.py +0 -0
- thestage-0.6.7/thestage/services/project/dto/inference_simulator_model_dto.py → thestage-0.7.0/thestage/inference_model/dto/inference_model.py +1 -1
- thestage-0.6.7/thestage/entities/project_inference_simulator_model.py → thestage-0.7.0/thestage/inference_model/dto/inference_model_entity.py +1 -1
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/inference_simulator_model_list_for_project_response.py +2 -3
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_request.py → thestage-0.7.0/thestage/inference_model/dto/push_inference_simulator_model_request.py +1 -1
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_response.py → thestage-0.7.0/thestage/inference_model/dto/push_inference_simulator_model_response.py +1 -1
- thestage-0.7.0/thestage/inference_simulator/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_simulator/business/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_simulator/business/inference_simulator_service.py +338 -0
- thestage-0.7.0/thestage/inference_simulator/business/mapper/__init__.py +0 -0
- thestage-0.6.7/thestage/services/project/mapper/project_inference_simulator_mapper.py → thestage-0.7.0/thestage/inference_simulator/business/mapper/inference_simulator_mapper.py +5 -5
- thestage-0.7.0/thestage/inference_simulator/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_simulator/communication/inference_simulator_api_client.py +114 -0
- thestage-0.7.0/thestage/inference_simulator/communication/inference_simulator_command.py +347 -0
- thestage-0.7.0/thestage/inference_simulator/dto/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_simulator/dto/enum/__init__.py +0 -0
- thestage-0.7.0/thestage/inference_simulator/dto/get_inference_simulator_response.py +12 -0
- thestage-0.6.7/thestage/services/project/dto/inference_simulator_dto.py → thestage-0.7.0/thestage/inference_simulator/dto/inference_simulator.py +1 -1
- thestage-0.6.7/thestage/entities/project_inference_simulator.py → thestage-0.7.0/thestage/inference_simulator/dto/inference_simulator_entity.py +1 -1
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_simulator/dto}/inference_simulator_list_response.py +2 -2
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py → thestage-0.7.0/thestage/inference_simulator/dto/start_inference_simulator_request.py +1 -1
- thestage-0.7.0/thestage/inference_simulator/dto/start_inference_simulator_response.py +10 -0
- thestage-0.7.0/thestage/instance/__init__.py +0 -0
- thestage-0.7.0/thestage/instance/business/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/instance → thestage-0.7.0/thestage/instance/business}/instance_service.py +26 -27
- thestage-0.7.0/thestage/instance/business/mapper/__init__.py +0 -0
- thestage-0.6.7/thestage/services/instance/mapper/instance_mapper.py → thestage-0.7.0/thestage/instance/business/mapper/rented_instance_mapper.py +3 -3
- thestage-0.6.7/thestage/services/instance/mapper/selfhosted_mapper.py → thestage-0.7.0/thestage/instance/business/mapper/selfhosted_instance_mapper.py +5 -7
- thestage-0.7.0/thestage/instance/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/instance/communication/instance_api_client.py +150 -0
- thestage-0.6.7/thestage/controllers/instance_controller.py → thestage-0.7.0/thestage/instance/communication/instance_command.py +5 -5
- thestage-0.7.0/thestage/instance/dto/__init__.py +0 -0
- thestage-0.7.0/thestage/instance/dto/enum/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/instance/dto}/instance_detected_gpus.py +1 -2
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/instance/dto}/instance_rented_response.py +2 -2
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/instance/dto}/selfhosted_instance_response.py +2 -3
- thestage-0.7.0/thestage/logging/__init__.py +0 -0
- thestage-0.7.0/thestage/logging/business/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/logging → thestage-0.7.0/thestage/logging/business}/logging_service.py +40 -28
- thestage-0.7.0/thestage/logging/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/logging/communication/logging_api_client.py +63 -0
- thestage-0.7.0/thestage/logging/dto/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/log_polling_response.py +2 -2
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/user_logs_query_response.py +2 -2
- thestage-0.7.0/thestage/main.py +82 -0
- thestage-0.7.0/thestage/project/__init__.py +0 -0
- thestage-0.7.0/thestage/project/business/__init__.py +0 -0
- thestage-0.7.0/thestage/project/business/project_service.py +480 -0
- thestage-0.7.0/thestage/project/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/project/communication/project_api_client.py +46 -0
- thestage-0.7.0/thestage/project/communication/project_command.py +284 -0
- thestage-0.7.0/thestage/project/dto/__init__.py +0 -0
- thestage-0.7.0/thestage/services/__init__.py +0 -0
- thestage-0.7.0/thestage/services/clients/__init__.py +0 -0
- thestage-0.7.0/thestage/services/clients/thestage_api/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/core/api_client_core.py +1 -1
- thestage-0.7.0/thestage/services/clients/thestage_api/dtos/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/entity_filter_request.py +1 -1
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/sftp_path_helper.py +1 -1
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/filesystem_service.py +2 -2
- thestage-0.7.0/thestage/services/service_factory.py +184 -0
- thestage-0.7.0/thestage/task/__init__.py +0 -0
- thestage-0.7.0/thestage/task/business/__init__.py +0 -0
- thestage-0.7.0/thestage/task/business/mapper/__init__.py +0 -0
- thestage-0.6.7/thestage/services/project/mapper/project_task_mapper.py → thestage-0.7.0/thestage/task/business/mapper/task_mapper.py +5 -5
- thestage-0.7.0/thestage/task/business/task_service.py +307 -0
- thestage-0.7.0/thestage/task/communication/__init__.py +0 -0
- thestage-0.7.0/thestage/task/communication/task_api_client.py +122 -0
- thestage-0.7.0/thestage/task/communication/task_command.py +212 -0
- thestage-0.7.0/thestage/task/dto/__init__.py +0 -0
- thestage-0.7.0/thestage/task/dto/enum/__init__.py +0 -0
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/task_controller/task_list_for_project_response.py → thestage-0.7.0/thestage/task/dto/list_for_project_response.py +2 -2
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_request.py → thestage-0.7.0/thestage/task/dto/run_task_request.py +1 -1
- thestage-0.7.0/thestage/task/dto/run_task_response.py +13 -0
- thestage-0.6.7/thestage/services/task/dto/task_dto.py → thestage-0.7.0/thestage/task/dto/task.py +1 -4
- thestage-0.6.7/thestage/entities/project_task.py → thestage-0.7.0/thestage/task/dto/task_entity.py +1 -1
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/task_controller/task_view_response.py → thestage-0.7.0/thestage/task/dto/view_response.py +2 -2
- thestage-0.6.7/thestage/controllers/project_controller.py +0 -1056
- thestage-0.6.7/thestage/debug_main.dist.py +0 -28
- thestage-0.6.7/thestage/main.py +0 -36
- thestage-0.6.7/thestage/services/clients/thestage_api/api_client.py +0 -751
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/container_param_request.py +0 -11
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller/get_inference_simulator_response.py +0 -13
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_response.py +0 -13
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_response.py +0 -10
- thestage-0.6.7/thestage/services/clients/thestage_api/dtos/user_controller/user_profile.py +0 -12
- thestage-0.6.7/thestage/services/project/project_service.py +0 -1287
- thestage-0.6.7/thestage/services/service_factory.py +0 -97
- {thestage-0.6.7 → thestage-0.7.0}/LICENSE.txt +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/README.md +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/.env +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/__main__.py +0 -0
- {thestage-0.6.7/thestage/controllers → thestage-0.7.0/thestage/color_scheme}/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/color_scheme/color_scheme.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/config/business}/__init__.py +0 -0
- {thestage-0.6.7/thestage/entities/enums → thestage-0.7.0/thestage/config/communication}/__init__.py +0 -0
- {thestage-0.6.7/thestage/exceptions → thestage-0.7.0/thestage/config/dto}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/core_files → thestage-0.7.0/thestage/config/dto}/config_entity.py +0 -0
- {thestage-0.6.7/thestage/services/connect → thestage-0.7.0/thestage/config}/dto/remote_server_config.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/config/env_base.py +0 -0
- {thestage-0.6.7/thestage/helpers → thestage-0.7.0/thestage/connect}/__init__.py +0 -0
- {thestage-0.6.7/thestage/helpers/logger → thestage-0.7.0/thestage/connect/business}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/connect/communication}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients → thestage-0.7.0/thestage/connect/dto}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/add_ssh_key_to_user_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/add_ssh_public_key_to_instance_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/is_user_has_public_ssh_key_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/ssh_key_controller → thestage-0.7.0/thestage/connect/dto}/is_user_has_public_ssh_key_response.py +0 -0
- {thestage-0.6.7/thestage/services/clients/git → thestage-0.7.0/thestage/controllers}/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/controllers/utils_controller.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api → thestage-0.7.0/thestage/docker_container}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/docker_container/business}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/docker_container/business/mapper}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/config_provider → thestage-0.7.0/thestage/docker_container/communication}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/container → thestage-0.7.0/thestage/docker_container/dto}/__init__.py +0 -0
- /thestage-0.6.7/thestage/entities/container.py → /thestage-0.7.0/thestage/docker_container/dto/container_entity.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/docker_container_controller → thestage-0.7.0/thestage/docker_container/dto}/docker_container_list_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/docker_container/dto}/docker_container_mapping.py +0 -0
- {thestage-0.6.7/thestage/services/container/mapper → thestage-0.7.0/thestage/docker_container/dto/enum}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/docker_container/dto/enum}/container_pending_action.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/docker_container/dto/enum}/container_status.py +0 -0
- {thestage-0.6.7/thestage/services/instance → thestage-0.7.0/thestage/exceptions}/__init__.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/auth_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/base_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/business_logic_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/config_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/file_system_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/git_access_exception.py +0 -0
- {thestage-0.6.7/thestage/services/logging/exception → thestage-0.7.0/thestage/exceptions}/log_polling_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/exceptions/remote_server_exception.py +0 -0
- {thestage-0.6.7/thestage/services/instance/mapper → thestage-0.7.0/thestage/git}/__init__.py +0 -0
- {thestage-0.6.7/thestage/git → thestage-0.7.0/thestage/git/business}/ProgressPrinter.py +0 -0
- {thestage-0.6.7/thestage/services/project → thestage-0.7.0/thestage/git/business}/__init__.py +0 -0
- {thestage-0.6.7/thestage/services/project/mapper → thestage-0.7.0/thestage/git/communication}/__init__.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/global_dto}/enums/order_direction_type.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/global_dto}/enums/shell_type.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/global_dto}/enums/tail_output_type.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/global_dto}/enums/yes_no_response.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/global_dto}/file_item.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/helpers/exception_hook.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/helpers/ssh_util.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/i18n/translation.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/deploy_inference_model_to_instance_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/deploy_inference_model_to_sagemaker_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/deploy_inference_model_to_sagemaker_response.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/inference_model/dto/enum}/inference_model_status.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_model/dto}/inference_simulator_model_list_for_project_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/inference_model/dto}/inference_simulator_model_response.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/inference_simulator/dto/enum}/inference_simulator_status.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_simulator/dto}/get_inference_simulator_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/inference_controller → thestage-0.7.0/thestage/inference_simulator/dto}/inference_simulator_list_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/inference_simulator/dto}/inference_simulator_response.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/instance/dto/enum}/cpu_type.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/instance/dto/enum}/gpu_name.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/instance/dto/enum}/instance_rented_status.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/instance/dto/enum}/provider_name.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/instance/dto/enum}/selfhosted_status.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/instance/dto}/rented_instance.py +0 -0
- {thestage-0.6.7/thestage/entities → thestage-0.7.0/thestage/instance/dto}/self_hosted_instance.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage}/logging/byte_print_style.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/docker_container_log_stream_request.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage}/logging/dto/log_message.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/log_polling_request.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage}/logging/dto/log_type.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/task_log_stream_request.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/logging_controller → thestage-0.7.0/thestage/logging/dto}/user_logs_query_request.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage}/logging/logging_constants.py +0 -0
- /thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_get_deploy_ssh_key_request.py → /thestage-0.7.0/thestage/project/dto/get_deploy_ssh_key_request.py +0 -0
- /thestage-0.6.7/thestage/services/clients/thestage_api/dtos/project_controller/project_get_deploy_ssh_key_response.py → /thestage-0.7.0/thestage/project/dto/get_deploy_ssh_key_response.py +0 -0
- {thestage-0.6.7/thestage/services → thestage-0.7.0/thestage}/project/dto/project_config.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos → thestage-0.7.0/thestage/project/dto}/project_response.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/.env +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/abstract_mapper.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/abstract_service.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/core/http_client_exception.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/base_response.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/frontend_status.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/installed_service.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/paginated_entity_list.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/pagination_data.py +0 -0
- {thestage-0.6.7 → thestage-0.7.0}/thestage/services/clients/thestage_api/dtos/validate_token_response.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/task/dto/enum}/task_execution_status.py +0 -0
- {thestage-0.6.7/thestage/services/clients/thestage_api/dtos/enums → thestage-0.7.0/thestage/task/dto/enum}/task_status.py +0 -0
- /thestage-0.6.7/thestage/services/clients/thestage_api/dtos/task_controller/task_list_for_project_request.py → /thestage-0.7.0/thestage/task/dto/list_for_project_request.py +0 -0
- /thestage-0.6.7/thestage/services/clients/thestage_api/dtos/task_controller/task_status_localized_map_response.py → /thestage-0.7.0/thestage/task/dto/status_localized_map_response.py +0 -0
|
@@ -27,10 +27,13 @@ class CliCommand(str, Enum):
|
|
|
27
27
|
CONTAINER_CONNECT = "CONTAINER_CONNECT"
|
|
28
28
|
CONTAINER_UPLOAD = "CONTAINER_UPLOAD"
|
|
29
29
|
CONTAINER_DOWNLOAD = "CONTAINER_DOWNLOAD"
|
|
30
|
+
CONTAINER_CREATE = "CONTAINER_CREATE"
|
|
30
31
|
CONTAINER_START = "CONTAINER_START"
|
|
31
32
|
CONTAINER_STOP = "CONTAINER_STOP"
|
|
33
|
+
CONTAINER_DELETE = "CONTAINER_DELETE"
|
|
32
34
|
CONTAINER_RESTART = "CONTAINER_RESTART"
|
|
33
35
|
CONTAINER_LOGS = "CONTAINER_LOGS"
|
|
36
|
+
CONTAINER_IMAGE_LS = "CONTAINER_IMAGE_LS"
|
|
34
37
|
INSTANCE_RENTED_LS = "INSTANCE_RENTED_LS"
|
|
35
38
|
INSTANCE_RENTED_CONNECT = "INSTANCE_RENTED_CONNECT"
|
|
36
39
|
INSTANCE_SELF_HOSTED_LS = "INSTANCE_SELF_HOSTED_LS"
|
|
@@ -4,7 +4,7 @@ import typer
|
|
|
4
4
|
|
|
5
5
|
from thestage.cli_command import CliCommand, CliCommandAvailability
|
|
6
6
|
from thestage.color_scheme.color_scheme import ColorScheme
|
|
7
|
-
from thestage.config import config_storage
|
|
7
|
+
from thestage.config.business import config_storage
|
|
8
8
|
from rich import print
|
|
9
9
|
|
|
10
10
|
|
|
@@ -43,7 +43,7 @@ def is_command_deprecated(command: CliCommand) -> bool:
|
|
|
43
43
|
|
|
44
44
|
def check_command_permission(executed_command: CliCommand):
|
|
45
45
|
if config_storage.APP_CONFIG.runtime.is_token_valid == False and executed_command != CliCommand.CONFIG_SET:
|
|
46
|
-
print(f"[{ColorScheme.WARNING.value}]Your
|
|
46
|
+
print(f"[{ColorScheme.WARNING.value}]Your access Token is not valid. You can update access token using 'thestage config set' command[{ColorScheme.WARNING.value}]")
|
|
47
47
|
|
|
48
48
|
is_allowed = config_storage.APP_CONFIG.runtime.allowed_commands.get(executed_command) == CliCommandAvailability.ALLOWED
|
|
49
49
|
if not is_allowed:
|
{thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/config/business}/app_config_service.py
RENAMED
|
@@ -3,11 +3,10 @@ import os
|
|
|
3
3
|
import click
|
|
4
4
|
import typer
|
|
5
5
|
|
|
6
|
-
from thestage.
|
|
7
|
-
from thestage.
|
|
6
|
+
from thestage.config.business.config_provider import ConfigProvider
|
|
7
|
+
from thestage.global_dto.enums.yes_no_response import YesOrNoResponse
|
|
8
8
|
from thestage.i18n.translation import __
|
|
9
|
-
from thestage.
|
|
10
|
-
from thestage.services.validation_service import ValidationService
|
|
9
|
+
from thestage.config.business.validation_service import ValidationService
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
class AppConfigService:
|
|
@@ -5,15 +5,16 @@ import os
|
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
from typing import Optional, Dict, Any
|
|
7
7
|
|
|
8
|
+
from thestage.config.env_base import THESTAGE_AUTH_TOKEN, THESTAGE_API_URL, THESTAGE_CONFIG_DIR, \
|
|
9
|
+
THESTAGE_CONFIG_FILE
|
|
8
10
|
from thestage.cli_command import CliCommand, CliCommandAvailability, ALWAYS_AVAILABLE_COMMANDS
|
|
9
11
|
from thestage.services.clients.thestage_api.dtos.validate_token_response import ValidateTokenResponse
|
|
10
|
-
from thestage.
|
|
12
|
+
from thestage.config.dto.config_entity import ConfigEntity
|
|
11
13
|
from thestage.helpers.ssh_util import parse_private_key
|
|
12
|
-
from thestage.
|
|
14
|
+
from thestage.config.dto.remote_server_config import RemoteServerConfig
|
|
13
15
|
from thestage.services.filesystem_service import FileSystemService
|
|
14
|
-
from thestage.
|
|
15
|
-
from thestage.config import
|
|
16
|
-
config_storage
|
|
16
|
+
from thestage.project.dto.project_config import ProjectConfig
|
|
17
|
+
from thestage.config.business import config_storage
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class ConfigProvider:
|
{thestage-0.6.7/thestage/services → thestage-0.7.0/thestage/config/business}/validation_service.py
RENAMED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import typer
|
|
2
2
|
|
|
3
|
+
from thestage.config.business.config_provider import ConfigProvider
|
|
4
|
+
from thestage.config.dto.config_entity import ConfigEntity
|
|
3
5
|
from thestage.i18n.translation import __
|
|
4
|
-
|
|
5
|
-
from thestage.services.clients.thestage_api.api_client import TheStageApiClient
|
|
6
|
-
from thestage.services.config_provider.config_provider import ConfigProvider
|
|
7
|
-
from thestage.services.core_files.config_entity import ConfigEntity
|
|
6
|
+
from thestage.services.clients.thestage_api.core.api_client_core import TheStageApiClientCore
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class ValidationService:
|
|
11
|
-
|
|
10
|
+
_core_client: TheStageApiClientCore = None
|
|
12
11
|
_config_provider: ConfigProvider = None
|
|
13
12
|
|
|
14
13
|
def __init__(
|
|
15
14
|
self,
|
|
16
|
-
|
|
15
|
+
core_client: TheStageApiClientCore,
|
|
17
16
|
config_provider: ConfigProvider,
|
|
18
17
|
):
|
|
19
|
-
self.
|
|
18
|
+
self._core_client = core_client
|
|
20
19
|
self._config_provider = config_provider
|
|
21
20
|
|
|
22
21
|
|
|
@@ -25,7 +24,7 @@ class ValidationService:
|
|
|
25
24
|
token = config.main.thestage_auth_token
|
|
26
25
|
if not token:
|
|
27
26
|
token: str = typer.prompt(
|
|
28
|
-
text=f'Authenticate using valid TheStage AI
|
|
27
|
+
text=f'Authenticate using valid TheStage AI access token ({config.main.thestage_api_url})',
|
|
29
28
|
show_choices=False,
|
|
30
29
|
type=str,
|
|
31
30
|
show_default=False,
|
|
@@ -35,11 +34,11 @@ class ValidationService:
|
|
|
35
34
|
if not token:
|
|
36
35
|
return
|
|
37
36
|
|
|
38
|
-
token_validate_response = self.
|
|
37
|
+
token_validate_response = self._core_client.validate_token(token=token)
|
|
39
38
|
is_valid = token_validate_response.is_success if token_validate_response else False
|
|
40
39
|
if not is_valid:
|
|
41
40
|
typer.echo(__(
|
|
42
|
-
'
|
|
41
|
+
'Access token is invalid: generate access token using TheStage AI WebApp'
|
|
43
42
|
))
|
|
44
43
|
raise typer.Exit(1)
|
|
45
44
|
|
|
@@ -4,12 +4,12 @@ import click
|
|
|
4
4
|
|
|
5
5
|
from thestage.cli_command import CliCommand
|
|
6
6
|
from thestage.cli_command_helper import get_command_metadata, check_command_permission
|
|
7
|
-
from thestage.
|
|
7
|
+
from thestage.config.dto.config_entity import ConfigEntity
|
|
8
|
+
from thestage.global_dto.enums.yes_no_response import YesOrNoResponse
|
|
8
9
|
|
|
9
|
-
from thestage.entities.enums.yes_no_response import YesOrNoResponse
|
|
10
10
|
from thestage.i18n.translation import __
|
|
11
11
|
from thestage.helpers.logger.app_logger import app_logger, get_log_path_from_os
|
|
12
|
-
from thestage.
|
|
12
|
+
from thestage.connect.business.connect_service import ConnectService
|
|
13
13
|
from thestage.services.service_factory import ServiceFactory
|
|
14
14
|
from thestage.controllers.utils_controller import get_current_directory
|
|
15
15
|
|
|
@@ -48,9 +48,9 @@ def config_get():
|
|
|
48
48
|
def config_set(
|
|
49
49
|
token: str = typer.Option(
|
|
50
50
|
None,
|
|
51
|
-
"--
|
|
51
|
+
"--access-token",
|
|
52
52
|
"-t",
|
|
53
|
-
help=__("Set or update
|
|
53
|
+
help=__("Set or update access token"),
|
|
54
54
|
is_eager=False,
|
|
55
55
|
),
|
|
56
56
|
):
|
|
@@ -107,7 +107,7 @@ def upload_ssh_key(
|
|
|
107
107
|
check_command_permission(command_name)
|
|
108
108
|
|
|
109
109
|
if sum(v is not None for v in [instance_rented_public_id, instance_rented_slug]) > 1:
|
|
110
|
-
typer.echo("
|
|
110
|
+
typer.echo("Provide a single identifier for rented instance - ID or name.")
|
|
111
111
|
raise typer.Exit(1)
|
|
112
112
|
|
|
113
113
|
service_factory = ServiceFactory()
|
|
@@ -137,7 +137,7 @@ def upload_ssh_key(
|
|
|
137
137
|
raise typer.Exit(0)
|
|
138
138
|
ssh_key_contents = ssh_key_path.open("r").read()
|
|
139
139
|
if 'private key-----' in ssh_key_contents.lower():
|
|
140
|
-
typer.echo(f"{ssh_key_path} is identified as a private key.
|
|
140
|
+
typer.echo(f"{ssh_key_path} is identified as a private key. Provide a public SSH key.")
|
|
141
141
|
raise typer.Exit(1)
|
|
142
142
|
|
|
143
143
|
connect_service.upload_ssh_key(
|
|
@@ -4,35 +4,39 @@ import typer
|
|
|
4
4
|
from thestage.cli_command import CliCommand
|
|
5
5
|
from thestage.cli_command_helper import check_command_permission
|
|
6
6
|
from thestage.color_scheme.color_scheme import ColorScheme
|
|
7
|
+
from thestage.connect.communication.connect_api_client import ConnectApiClient
|
|
7
8
|
from thestage.i18n.translation import __
|
|
9
|
+
from thestage.instance.communication.instance_api_client import InstanceApiClient
|
|
8
10
|
from thestage.services.clients.thestage_api.core.http_client_exception import HttpClientException
|
|
9
|
-
from thestage.
|
|
11
|
+
from thestage.instance.dto.enum.instance_rented_status import InstanceRentedBusinessStatus
|
|
10
12
|
from thestage.services.abstract_service import AbstractService
|
|
11
13
|
from thestage.helpers.error_handler import error_handler
|
|
12
|
-
from thestage.
|
|
13
|
-
from thestage.
|
|
14
|
-
from thestage.
|
|
15
|
-
from thestage.
|
|
16
|
-
from thestage.services.logging.logging_service import LoggingService
|
|
14
|
+
from thestage.instance.dto.instance_rented_response import InstanceRentedDto
|
|
15
|
+
from thestage.docker_container.business.container_service import ContainerService
|
|
16
|
+
from thestage.instance.business.instance_service import InstanceService
|
|
17
|
+
from thestage.logging.business.logging_service import LoggingService
|
|
17
18
|
from rich import print
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class ConnectService(AbstractService):
|
|
21
|
-
|
|
22
|
+
__connect_api_client: ConnectApiClient = None
|
|
23
|
+
__instance_api_client: InstanceApiClient = None
|
|
22
24
|
__instance_service: InstanceService = None
|
|
23
25
|
__container_service: ContainerService = None
|
|
24
26
|
__logging_service: LoggingService = None
|
|
25
27
|
|
|
26
28
|
def __init__(
|
|
27
29
|
self,
|
|
28
|
-
|
|
30
|
+
instance_api_client: InstanceApiClient,
|
|
31
|
+
connect_api_client: ConnectApiClient,
|
|
29
32
|
instance_service: InstanceService,
|
|
30
33
|
container_service: ContainerService,
|
|
31
34
|
logging_service: LoggingService,
|
|
32
35
|
):
|
|
33
36
|
super(ConnectService, self).__init__(
|
|
34
37
|
)
|
|
35
|
-
self.
|
|
38
|
+
self.__instance_api_client = instance_api_client
|
|
39
|
+
self.__connect_api_client = connect_api_client
|
|
36
40
|
self.__instance_service = instance_service
|
|
37
41
|
self.__container_service = container_service
|
|
38
42
|
self.__logging_service = logging_service
|
|
@@ -45,7 +49,7 @@ class ConnectService(AbstractService):
|
|
|
45
49
|
username: Optional[str],
|
|
46
50
|
private_key_path: Optional[str],
|
|
47
51
|
):
|
|
48
|
-
resolved_options = self.
|
|
52
|
+
resolved_options = self.__connect_api_client.resolve_user_input(entity_identifier=input_entity_identifier)
|
|
49
53
|
entities_available_for_connect_count = 0
|
|
50
54
|
task_presence = False
|
|
51
55
|
container_presence = False
|
|
@@ -55,8 +59,8 @@ class ConnectService(AbstractService):
|
|
|
55
59
|
|
|
56
60
|
if resolved_options.taskMatchData:
|
|
57
61
|
for task_item in resolved_options.taskMatchData:
|
|
58
|
-
message = f"Found a task with
|
|
59
|
-
line_color = ColorScheme.SUCCESS
|
|
62
|
+
message = f"Found a task with matching {task_item.matchedField} in status: '{task_item.frontendStatus.status_translation}' (ID: {task_item.publicId})"
|
|
63
|
+
line_color = ColorScheme.SUCCESS if task_item.canConnect else 'default'
|
|
60
64
|
print(f"[{line_color}]{message}[{line_color}]")
|
|
61
65
|
if task_item.canConnect:
|
|
62
66
|
task_presence = True
|
|
@@ -144,21 +148,20 @@ class ConnectService(AbstractService):
|
|
|
144
148
|
instance_rented: Optional[InstanceRentedDto] = None
|
|
145
149
|
if instance_slug or instance_public_id:
|
|
146
150
|
try:
|
|
147
|
-
instance_rented = self.
|
|
151
|
+
instance_rented = self.__instance_api_client.get_rented_instance(
|
|
148
152
|
instance_public_id=instance_public_id,
|
|
149
153
|
instance_slug=instance_slug
|
|
150
154
|
)
|
|
151
155
|
except HttpClientException as e:
|
|
152
156
|
instance_rented = None
|
|
153
157
|
|
|
154
|
-
# if no instances found - exit 1
|
|
155
158
|
if instance_rented is None:
|
|
156
159
|
typer.echo(f"No rented instance found with matching identifier")
|
|
157
160
|
raise typer.Exit(1)
|
|
158
161
|
|
|
159
162
|
note_to_send: Optional[str] = None
|
|
160
163
|
|
|
161
|
-
is_user_already_has_key_response = self.
|
|
164
|
+
is_user_already_has_key_response = self.__connect_api_client.is_user_has_ssh_public_key(
|
|
162
165
|
public_key=public_key_contents
|
|
163
166
|
)
|
|
164
167
|
|
|
@@ -167,17 +170,17 @@ class ConnectService(AbstractService):
|
|
|
167
170
|
|
|
168
171
|
if is_adding_key_to_user and not note_to_send:
|
|
169
172
|
note_to_send: str = typer.prompt(
|
|
170
|
-
text=__('SSH key will be added to your profile.
|
|
173
|
+
text=__('SSH key will be added to your profile. Provide a name for this key'),
|
|
171
174
|
show_choices=False,
|
|
172
175
|
type=str,
|
|
173
176
|
show_default=False,
|
|
174
177
|
)
|
|
175
178
|
|
|
176
179
|
if not is_adding_key_to_user and not instance_rented:
|
|
177
|
-
typer.echo("Key already exists
|
|
180
|
+
typer.echo("Key already exists in your profile")
|
|
178
181
|
|
|
179
182
|
if is_adding_key_to_user:
|
|
180
|
-
add_ssh_key_to_user_response = self.
|
|
183
|
+
add_ssh_key_to_user_response = self.__connect_api_client.add_public_ssh_key_to_user(
|
|
181
184
|
public_key=public_key_contents,
|
|
182
185
|
note=note_to_send
|
|
183
186
|
)
|
|
@@ -185,7 +188,7 @@ class ConnectService(AbstractService):
|
|
|
185
188
|
ssh_key_pair_public_id = add_ssh_key_to_user_response.sshKeyPairPublicId
|
|
186
189
|
|
|
187
190
|
if instance_rented:
|
|
188
|
-
self.
|
|
191
|
+
self.__connect_api_client.add_public_ssh_key_to_instance_rented(
|
|
189
192
|
instance_rented_public_id=instance_rented.public_id,
|
|
190
193
|
ssh_key_pair_public_id=ssh_key_pair_public_id
|
|
191
194
|
)
|
|
@@ -12,15 +12,14 @@ from paramiko.client import SSHClient
|
|
|
12
12
|
from paramiko.pkey import PKey
|
|
13
13
|
from paramiko.sftp_client import SFTPClient
|
|
14
14
|
|
|
15
|
-
from thestage.
|
|
16
|
-
from thestage.
|
|
15
|
+
from thestage.config.business.config_provider import ConfigProvider
|
|
16
|
+
from thestage.global_dto.file_item import FileItemEntity
|
|
17
17
|
from thestage.exceptions.remote_server_exception import RemoteServerException
|
|
18
18
|
from thestage.helpers.logger.app_logger import app_logger
|
|
19
|
-
from thestage.
|
|
19
|
+
from thestage.global_dto.enums.shell_type import ShellType
|
|
20
20
|
from thestage.helpers.ssh_util import parse_private_key
|
|
21
21
|
from thestage.i18n.translation import __
|
|
22
22
|
from thestage.services.clients.thestage_api.dtos.sftp_path_helper import SftpFileItemEntity
|
|
23
|
-
from thestage.services.config_provider.config_provider import ConfigProvider
|
|
24
23
|
from thestage.services.filesystem_service import FileSystemService
|
|
25
24
|
|
|
26
25
|
old_value: int = 0
|
|
@@ -361,7 +360,7 @@ class RemoteServerService:
|
|
|
361
360
|
|
|
362
361
|
return client, sftp
|
|
363
362
|
|
|
364
|
-
# TODO what
|
|
363
|
+
# TODO what does this method do?
|
|
365
364
|
@staticmethod
|
|
366
365
|
def _check_if_file_name_in_path(path: str, file_template: Optional[str] = None) -> bool:
|
|
367
366
|
# strange logic
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from thestage.config.business.config_provider import ConfigProvider
|
|
4
|
+
from thestage.services.clients.thestage_api.core.api_client_core import TheStageApiClientCore
|
|
5
|
+
from thestage.connect.dto.add_ssh_key_to_user_request import AddSshKeyToUserRequest
|
|
6
|
+
from thestage.connect.dto.add_ssh_key_to_user_response import AddSshKeyToUserResponse
|
|
7
|
+
from thestage.connect.dto.is_user_has_public_ssh_key_request import IsUserHasSshPublicKeyRequest
|
|
8
|
+
from thestage.connect.dto.is_user_has_public_ssh_key_response import IsUserHasSshPublicKeyResponse
|
|
9
|
+
from thestage.connect.dto.add_ssh_public_key_to_instance_request import AddSshPublicKeyToInstanceRequest
|
|
10
|
+
from thestage.connect.dto.add_ssh_public_key_to_instance_response import AddSshPublicKeyToInstanceResponse
|
|
11
|
+
from thestage.connect.dto.connect_resolve_response import ConnectResolveOptionsResponse
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ConnectApiClient(TheStageApiClientCore):
|
|
15
|
+
def __init__(self, config_provider: ConfigProvider):
|
|
16
|
+
super().__init__(url=config_provider.get_config().main.thestage_api_url)
|
|
17
|
+
self.__config_provider = config_provider
|
|
18
|
+
|
|
19
|
+
def add_public_ssh_key_to_user(self, public_key: str, note: str) -> AddSshKeyToUserResponse:
|
|
20
|
+
request = AddSshKeyToUserRequest(
|
|
21
|
+
sshKey=public_key,
|
|
22
|
+
note=note
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
response = self._request(
|
|
26
|
+
method='POST',
|
|
27
|
+
url='/user-api/v2/ssh-key/add-public-key-to-user',
|
|
28
|
+
data=request.model_dump(),
|
|
29
|
+
token=self.__config_provider.get_config().main.thestage_auth_token,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
result = AddSshKeyToUserResponse.model_validate(response) if response else None
|
|
33
|
+
return result
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def is_user_has_ssh_public_key(self, public_key: str) -> IsUserHasSshPublicKeyResponse:
|
|
37
|
+
request = IsUserHasSshPublicKeyRequest(
|
|
38
|
+
sshKey=public_key,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
response = self._request(
|
|
42
|
+
method='POST',
|
|
43
|
+
url='/user-api/v2/ssh-key/is-user-has-public-ssh-key',
|
|
44
|
+
data=request.model_dump(),
|
|
45
|
+
token=self.__config_provider.get_config().main.thestage_auth_token,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
result = IsUserHasSshPublicKeyResponse.model_validate(response) if response else None
|
|
49
|
+
return result
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def add_public_ssh_key_to_instance_rented(self, instance_rented_public_id: str,
|
|
53
|
+
ssh_key_pair_public_id: str) -> AddSshPublicKeyToInstanceResponse:
|
|
54
|
+
request = AddSshPublicKeyToInstanceRequest(
|
|
55
|
+
instanceRentedPublicId=instance_rented_public_id,
|
|
56
|
+
sshPublicKeyPublicId=ssh_key_pair_public_id,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
response = self._request(
|
|
60
|
+
method='POST',
|
|
61
|
+
url='/user-api/v2/ssh-key/add-public-ssh-key-to-instance-rented',
|
|
62
|
+
data=request.model_dump(),
|
|
63
|
+
token=self.__config_provider.get_config().main.thestage_auth_token,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
result = AddSshPublicKeyToInstanceResponse.model_validate(response) if response else None
|
|
67
|
+
return result
|
|
68
|
+
|
|
69
|
+
def resolve_user_input(
|
|
70
|
+
self,
|
|
71
|
+
entity_identifier: str
|
|
72
|
+
) -> Optional[ConnectResolveOptionsResponse]:
|
|
73
|
+
data = {
|
|
74
|
+
"entityIdentifier": entity_identifier,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
response = self._request(
|
|
78
|
+
method='POST',
|
|
79
|
+
url='/user-api/v1/resolve-user-input',
|
|
80
|
+
data=data,
|
|
81
|
+
token=self.__config_provider.get_config().main.thestage_auth_token,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return ConnectResolveOptionsResponse.model_validate(response) if response else None
|
|
@@ -3,7 +3,6 @@ from typing import Optional
|
|
|
3
3
|
from pydantic import Field, ConfigDict
|
|
4
4
|
|
|
5
5
|
from thestage.services.clients.thestage_api.dtos.base_response import TheStageBaseResponse
|
|
6
|
-
from thestage.services.task.dto.task_dto import TaskDto
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class AddSshKeyToUserResponse(TheStageBaseResponse):
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from pydantic import Field, ConfigDict
|
|
1
|
+
from pydantic import ConfigDict
|
|
4
2
|
|
|
5
3
|
from thestage.services.clients.thestage_api.dtos.base_response import TheStageBaseResponse
|
|
6
|
-
from thestage.services.task.dto.task_dto import TaskDto
|
|
7
4
|
|
|
8
5
|
|
|
9
6
|
class AddSshPublicKeyToInstanceResponse(TheStageBaseResponse):
|
|
@@ -4,7 +4,6 @@ from pydantic import Field, BaseModel
|
|
|
4
4
|
|
|
5
5
|
from thestage.services.clients.thestage_api.dtos.base_response import TheStageBaseResponse
|
|
6
6
|
from thestage.services.clients.thestage_api.dtos.frontend_status import FrontendStatusDto
|
|
7
|
-
from thestage.services.task.dto.task_dto import TaskDto
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class EntityMatchData(BaseModel):
|
|
@@ -10,12 +10,12 @@ from thestage import __app_name__, __version__
|
|
|
10
10
|
|
|
11
11
|
import typer
|
|
12
12
|
|
|
13
|
-
from thestage.
|
|
13
|
+
from thestage.connect.business.connect_service import ConnectService
|
|
14
14
|
|
|
15
15
|
app = typer.Typer(no_args_is_help=True,)
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
@app.command(name='version', help="
|
|
18
|
+
@app.command(name='version', help="Show application name and version", no_args_is_help=False, **get_command_metadata(CliCommand.VERSION))
|
|
19
19
|
def version():
|
|
20
20
|
command_name = CliCommand.VERSION
|
|
21
21
|
app_logger.info(f'Running {command_name} from {get_current_directory()}')
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from thestage import __app_name__
|
|
2
|
+
from thestage.controllers.base_controller import app as main_app
|
|
3
|
+
|
|
4
|
+
from thestage.docker_container.communication.docker_command import app as container_app
|
|
5
|
+
from thestage.instance.communication.instance_command import app as instance_app
|
|
6
|
+
from thestage.project.communication.project_command import app as project_app
|
|
7
|
+
from thestage.config.communication.config_command import app as config_app
|
|
8
|
+
from thestage.task.communication.task_command import app as task_app
|
|
9
|
+
|
|
10
|
+
main_app.add_typer(container_app, name="container")
|
|
11
|
+
main_app.add_typer(instance_app, name="instance")
|
|
12
|
+
main_app.add_typer(config_app, name="config")
|
|
13
|
+
main_app.add_typer(project_app, name="project")
|
|
14
|
+
main_app.add_typer(task_app, name="task")
|
|
15
|
+
|
|
16
|
+
def main():
|
|
17
|
+
project_app([
|
|
18
|
+
"run",
|
|
19
|
+
"-wd",
|
|
20
|
+
"/Users/alexey/Documents/clonetest",
|
|
21
|
+
"-cid",
|
|
22
|
+
'62-1',
|
|
23
|
+
'-t',
|
|
24
|
+
'task',
|
|
25
|
+
"echo 123",
|
|
26
|
+
"-nl"
|
|
27
|
+
], prog_name=__app_name__)
|
|
28
|
+
|
|
29
|
+
if __name__ == "__main__":
|
|
30
|
+
main()
|