thestage 0.6.5__py3-none-any.whl → 0.6.7__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 +151 -106
- thestage/controllers/instance_controller.py +35 -9
- thestage/controllers/project_controller.py +335 -89
- thestage/entities/container.py +5 -3
- thestage/entities/project_inference_simulator.py +2 -1
- thestage/entities/project_inference_simulator_model.py +2 -2
- 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 +1 -1
- thestage/main.py +1 -1
- thestage/services/clients/git/git_client.py +1 -1
- thestage/services/clients/thestage_api/api_client.py +142 -109
- thestage/services/clients/thestage_api/dtos/base_controller/connect_resolve_response.py +22 -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 +5 -1
- thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_instance_response.py +2 -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_run_task_response.py +3 -0
- 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 +77 -74
- thestage/services/container/container_service.py +120 -41
- 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 +45 -48
- 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 +2 -2
- thestage/services/project/mapper/project_inference_simulator_mapper.py +1 -0
- thestage/services/project/mapper/project_inference_simulator_model_mapper.py +2 -2
- thestage/services/project/mapper/project_task_mapper.py +2 -3
- thestage/services/project/project_service.py +174 -140
- thestage/services/remote_server_service.py +1 -0
- thestage/services/task/dto/task_dto.py +3 -23
- {thestage-0.6.5.dist-info → thestage-0.6.7.dist-info}/METADATA +4 -2
- {thestage-0.6.5.dist-info → thestage-0.6.7.dist-info}/RECORD +65 -74
- {thestage-0.6.5.dist-info → thestage-0.6.7.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.5.dist-info → thestage-0.6.7.dist-info}/entry_points.txt +0 -0
- {thestage-0.6.5.dist-info → thestage-0.6.7.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,8 +10,8 @@ class ProjectInferenceSimulatorModelEntity(BaseModel):
|
|
|
10
10
|
use_enum_values=True,
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
slug: Optional[str] = Field(None, alias='
|
|
13
|
+
public_id: Optional[str] = Field(None, alias='ID')
|
|
14
|
+
slug: Optional[str] = Field(None, alias='NAME')
|
|
15
15
|
status: Optional[str] = Field(None, alias='STATUS')
|
|
16
16
|
commit_hash: Optional[str] = Field(None, alias='COMMIT_HASH')
|
|
17
17
|
environment_metadata: Optional[Dict[str, Any]] = Field(None, alias='ENVIRONMENT_METADATA')
|
|
@@ -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:
|
thestage/main.py
CHANGED
|
@@ -19,7 +19,7 @@ def main():
|
|
|
19
19
|
config_provider.update_allowed_commands_and_is_token_valid(validate_token_response=token_info)
|
|
20
20
|
except Exception as e:
|
|
21
21
|
app_logger.error(f'{traceback.format_exc()}')
|
|
22
|
-
print('
|
|
22
|
+
print('Error connecting to TheStage servers') # TODO inquire what we want here if backend is offline
|
|
23
23
|
print(f'Application logs path: {str(get_log_path_from_os())}')
|
|
24
24
|
return
|
|
25
25
|
|
|
@@ -196,7 +196,7 @@ class GitLocalClient:
|
|
|
196
196
|
) -> Optional[str]:
|
|
197
197
|
repo = self.__get_repo(path=path)
|
|
198
198
|
if repo.head.is_detached:
|
|
199
|
-
line_color = ColorScheme.GIT_HEADLESS
|
|
199
|
+
line_color = ColorScheme.GIT_HEADLESS.value
|
|
200
200
|
print(f'[{line_color}]Committing in detached head state at {repo.head.commit.hexsha}[/{line_color}]')
|
|
201
201
|
commit_name = name if name else f"Auto commit {str(datetime.datetime.now().date())}"
|
|
202
202
|
commit = repo.git.commit('--allow-empty', '-m', commit_name, )
|