thestage 0.6.4__py3-none-any.whl → 0.6.6__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.
- thestage/__init__.py +1 -1
- thestage/color_scheme/color_scheme.py +1 -0
- thestage/controllers/base_controller.py +4 -3
- thestage/controllers/config_controller.py +16 -4
- thestage/controllers/container_controller.py +147 -49
- thestage/controllers/instance_controller.py +35 -9
- thestage/controllers/project_controller.py +334 -86
- thestage/entities/container.py +5 -3
- thestage/entities/project_inference_simulator.py +2 -1
- thestage/entities/project_inference_simulator_model.py +1 -1
- thestage/entities/project_task.py +2 -3
- thestage/entities/rented_instance.py +2 -2
- thestage/entities/self_hosted_instance.py +2 -2
- thestage/helpers/error_handler.py +3 -3
- thestage/services/clients/git/git_client.py +8 -12
- thestage/services/clients/thestage_api/api_client.py +144 -109
- thestage/services/clients/thestage_api/dtos/base_controller/connect_resolve_response.py +21 -0
- thestage/services/clients/thestage_api/dtos/container_param_request.py +1 -1
- thestage/services/clients/thestage_api/dtos/container_response.py +1 -21
- thestage/services/clients/thestage_api/dtos/docker_container_controller/docker_container_list_request.py +2 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_instance_request.py +7 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_instance_response.py +0 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_sagemaker_request.py +1 -0
- thestage/services/clients/thestage_api/dtos/inference_controller/get_inference_simulator_request.py +2 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/{inference_simulator_list_for_project_request.py → inference_simulator_list_request.py} +3 -2
- thestage/services/clients/thestage_api/dtos/inference_controller/{inference_simulator_list_for_project_response.py → inference_simulator_list_response.py} +1 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/inference_simulator_model_list_for_project_request.py +2 -1
- thestage/services/clients/thestage_api/dtos/instance_rented_response.py +4 -37
- thestage/services/clients/thestage_api/dtos/logging_controller/log_polling_request.py +3 -3
- thestage/services/clients/thestage_api/dtos/logging_controller/user_logs_query_request.py +3 -11
- thestage/services/clients/thestage_api/dtos/project_controller/project_get_deploy_ssh_key_request.py +1 -0
- thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_request.py +2 -1
- thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_request.py +2 -4
- thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py +5 -3
- thestage/services/clients/thestage_api/dtos/project_response.py +3 -15
- thestage/services/clients/thestage_api/dtos/selfhosted_instance_response.py +2 -20
- thestage/services/clients/thestage_api/dtos/ssh_key_controller/add_ssh_key_to_user_response.py +1 -1
- thestage/services/clients/thestage_api/dtos/ssh_key_controller/add_ssh_public_key_to_instance_request.py +4 -2
- thestage/services/clients/thestage_api/dtos/ssh_key_controller/is_user_has_public_ssh_key_response.py +1 -1
- thestage/services/clients/thestage_api/dtos/task_controller/task_list_for_project_request.py +4 -1
- thestage/services/clients/thestage_api/dtos/task_controller/task_view_response.py +0 -2
- thestage/services/config_provider/config_provider.py +2 -2
- thestage/services/connect/connect_service.py +76 -73
- thestage/services/container/container_service.py +23 -19
- thestage/services/container/mapper/container_mapper.py +2 -1
- thestage/services/instance/instance_service.py +13 -20
- thestage/services/instance/mapper/instance_mapper.py +1 -3
- thestage/services/instance/mapper/selfhosted_mapper.py +3 -4
- thestage/services/logging/logging_service.py +40 -40
- thestage/services/project/dto/inference_simulator_dto.py +1 -10
- thestage/services/project/dto/inference_simulator_model_dto.py +2 -10
- thestage/services/project/dto/project_config.py +3 -2
- thestage/services/project/mapper/project_inference_simulator_mapper.py +1 -0
- thestage/services/project/mapper/project_inference_simulator_model_mapper.py +3 -3
- thestage/services/project/mapper/project_task_mapper.py +2 -3
- thestage/services/project/project_service.py +161 -131
- thestage/services/remote_server_service.py +1 -0
- thestage/services/task/dto/task_dto.py +3 -23
- {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/METADATA +3 -2
- {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/RECORD +63 -72
- {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/WHEEL +1 -1
- thestage/services/clients/thestage_api/dtos/cloud_provider_region.py +0 -19
- thestage/services/clients/thestage_api/dtos/docker_container_assigned_device.py +0 -10
- thestage/services/clients/thestage_api/dtos/enums/currency_type.py +0 -10
- thestage/services/clients/thestage_api/dtos/enums/daemon_status.py +0 -9
- thestage/services/clients/thestage_api/dtos/enums/disk_type.py +0 -7
- thestage/services/clients/thestage_api/dtos/enums/drive_type.py +0 -7
- thestage/services/clients/thestage_api/dtos/enums/instance_type.py +0 -7
- thestage/services/clients/thestage_api/dtos/enums/location_region.py +0 -11
- thestage/services/clients/thestage_api/dtos/enums/power_status.py +0 -10
- thestage/services/clients/thestage_api/dtos/price_definition.py +0 -14
- {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/entry_points.txt +0 -0
- {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info/licenses}/LICENSE.txt +0 -0
thestage/entities/container.py
CHANGED
|
@@ -10,8 +10,10 @@ class DockerContainerEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
|
+
slug: Optional[str] = Field(None, alias='NAME')
|
|
14
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
15
|
-
|
|
16
|
+
project_slug: Optional[str] = Field(None, alias='PROJECT NAME')
|
|
16
17
|
instance_type: Optional[str] = Field(None, alias='INSTANCE TYPE')
|
|
17
|
-
instance_slug: Optional[str] = Field(None, alias='INSTANCE
|
|
18
|
+
instance_slug: Optional[str] = Field(None, alias='INSTANCE NAME')
|
|
19
|
+
docker_image: Optional[str] = Field(None, alias='DOCKER IMAGE')
|
|
@@ -10,7 +10,8 @@ class ProjectInferenceSimulatorEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
|
+
slug: Optional[str] = Field(None, alias='NAME')
|
|
14
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
15
16
|
http_endpoint: Optional[str] = Field(None, alias="HTTP")
|
|
16
17
|
grpc_endpoint: Optional[str] = Field(None, alias="GRPC")
|
|
@@ -10,7 +10,7 @@ class ProjectInferenceSimulatorModelEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
14
|
slug: Optional[str] = Field(None, alias='UNIQUE_ID')
|
|
15
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
16
16
|
commit_hash: Optional[str] = Field(None, alias='COMMIT_HASH')
|
|
@@ -10,10 +10,9 @@ class ProjectTaskEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
14
|
title: Optional[str] = Field(None, alias='TITLE')
|
|
15
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
16
|
-
|
|
17
|
-
docker_container_slug: Optional[str] = Field(None, alias='DOCKER_CONTAINER_UID')
|
|
16
|
+
docker_container_public_id: Optional[str] = Field(None, alias='CONTAINER ID')
|
|
18
17
|
started_at: Optional[str] = Field(None, alias='STARTED AT')
|
|
19
18
|
finished_at: Optional[str] = Field(None, alias='FINISHED_AT')
|
|
@@ -10,9 +10,9 @@ class RentedInstanceEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
|
+
slug: Optional[str] = Field(None, alias='NAME')
|
|
13
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
14
|
-
title: Optional[str] = Field(None, alias='TITLE')
|
|
15
|
-
slug: Optional[str] = Field(None, alias='UNIQUE ID')
|
|
16
16
|
cpu_type: Optional[str] = Field(None, alias='CPU TYPE')
|
|
17
17
|
cpu_cores: Optional[str] = Field(None, alias='CPU CORES')
|
|
18
18
|
gpu_type: Optional[str] = Field(None, alias='GPU TYPE')
|
|
@@ -9,9 +9,9 @@ class SelfHostedInstanceEntity(BaseModel):
|
|
|
9
9
|
populate_by_name=True,
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
13
|
+
slug: Optional[str] = Field(None, alias='NAME')
|
|
12
14
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
13
|
-
title: Optional[str] = Field(None, alias='TITLE')
|
|
14
|
-
slug: Optional[str] = Field(None, alias='SLUG')
|
|
15
15
|
cpu_type: Optional[str] = Field(str, alias='CPU_TYPE')
|
|
16
16
|
cpu_cores: Optional[int] = Field(None, alias='CPU_CORES')
|
|
17
17
|
gpu_type: Optional[str] = Field(str, alias='GPU_TYPE')
|
|
@@ -75,7 +75,7 @@ def error_handler() -> Callable:
|
|
|
75
75
|
app_logger.error(f'{traceback.format_exc()}')
|
|
76
76
|
raise typer.Exit(1)
|
|
77
77
|
except GitCommandError as e7:
|
|
78
|
-
typer.echo(f'Git command error encountered: {e7.stderr} (status: {e7.status})')
|
|
78
|
+
typer.echo(f'Git command error encountered: {e7.stdout} \n {e7.stderr} (status: {e7.status})')
|
|
79
79
|
app_logger.error(f'{traceback.format_exc()}')
|
|
80
80
|
raise typer.Exit(1)
|
|
81
81
|
except RemoteServerException as e8:
|
|
@@ -106,8 +106,8 @@ def error_handler() -> Callable:
|
|
|
106
106
|
raise e100
|
|
107
107
|
else:
|
|
108
108
|
typer.echo(__('Undefined error occurred'))
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
typer.echo(e100.__class__.__name__)
|
|
110
|
+
print(traceback.format_exc())
|
|
111
111
|
# TODO send all exceptions to backend?
|
|
112
112
|
app_logger.error(f'{traceback.format_exc()}')
|
|
113
113
|
raise typer.Exit(1)
|
|
@@ -71,9 +71,11 @@ class GitLocalClient:
|
|
|
71
71
|
) -> Optional[Repo]:
|
|
72
72
|
|
|
73
73
|
repo = git.Repo.init(path)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
|
|
75
|
+
# if repo:
|
|
76
|
+
# #default git name master, rename to main - sync wih github
|
|
77
|
+
# repo.git.branch("-M", self.__base_name_local)
|
|
78
|
+
|
|
77
79
|
return repo
|
|
78
80
|
|
|
79
81
|
def add_remote_to_repo(
|
|
@@ -131,15 +133,9 @@ class GitLocalClient:
|
|
|
131
133
|
origin = repo.remote(self.__base_name_remote)
|
|
132
134
|
|
|
133
135
|
if origin:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
typer.echo(f"Pulled remote changes to branch '{local_branch}'")
|
|
138
|
-
except GitCommandError as ex:
|
|
139
|
-
for line in progress.allDroppedLines():
|
|
140
|
-
# returning the whole output if failed - so that user have any idea what's going on
|
|
141
|
-
print(f'>> {line}')
|
|
142
|
-
raise ex
|
|
136
|
+
repo.git.pull('origin', local_branch)
|
|
137
|
+
typer.echo(f"Pulled remote changes to branch '{local_branch}'")
|
|
138
|
+
|
|
143
139
|
|
|
144
140
|
def find_main_branch_name(self, path: str) -> Optional[str]:
|
|
145
141
|
repo = self.__get_repo(path=path)
|