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.
Files changed (73) hide show
  1. thestage/__init__.py +1 -1
  2. thestage/color_scheme/color_scheme.py +1 -0
  3. thestage/controllers/base_controller.py +4 -3
  4. thestage/controllers/config_controller.py +16 -4
  5. thestage/controllers/container_controller.py +147 -49
  6. thestage/controllers/instance_controller.py +35 -9
  7. thestage/controllers/project_controller.py +334 -86
  8. thestage/entities/container.py +5 -3
  9. thestage/entities/project_inference_simulator.py +2 -1
  10. thestage/entities/project_inference_simulator_model.py +1 -1
  11. thestage/entities/project_task.py +2 -3
  12. thestage/entities/rented_instance.py +2 -2
  13. thestage/entities/self_hosted_instance.py +2 -2
  14. thestage/helpers/error_handler.py +3 -3
  15. thestage/services/clients/git/git_client.py +8 -12
  16. thestage/services/clients/thestage_api/api_client.py +144 -109
  17. thestage/services/clients/thestage_api/dtos/base_controller/connect_resolve_response.py +21 -0
  18. thestage/services/clients/thestage_api/dtos/container_param_request.py +1 -1
  19. thestage/services/clients/thestage_api/dtos/container_response.py +1 -21
  20. thestage/services/clients/thestage_api/dtos/docker_container_controller/docker_container_list_request.py +2 -1
  21. thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_instance_request.py +7 -1
  22. thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_instance_response.py +0 -1
  23. thestage/services/clients/thestage_api/dtos/inference_controller/deploy_inference_model_to_sagemaker_request.py +1 -0
  24. thestage/services/clients/thestage_api/dtos/inference_controller/get_inference_simulator_request.py +2 -1
  25. thestage/services/clients/thestage_api/dtos/inference_controller/{inference_simulator_list_for_project_request.py → inference_simulator_list_request.py} +3 -2
  26. thestage/services/clients/thestage_api/dtos/inference_controller/{inference_simulator_list_for_project_response.py → inference_simulator_list_response.py} +1 -1
  27. thestage/services/clients/thestage_api/dtos/inference_controller/inference_simulator_model_list_for_project_request.py +2 -1
  28. thestage/services/clients/thestage_api/dtos/instance_rented_response.py +4 -37
  29. thestage/services/clients/thestage_api/dtos/logging_controller/log_polling_request.py +3 -3
  30. thestage/services/clients/thestage_api/dtos/logging_controller/user_logs_query_request.py +3 -11
  31. thestage/services/clients/thestage_api/dtos/project_controller/project_get_deploy_ssh_key_request.py +1 -0
  32. thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_request.py +2 -1
  33. thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_request.py +2 -4
  34. thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py +5 -3
  35. thestage/services/clients/thestage_api/dtos/project_response.py +3 -15
  36. thestage/services/clients/thestage_api/dtos/selfhosted_instance_response.py +2 -20
  37. thestage/services/clients/thestage_api/dtos/ssh_key_controller/add_ssh_key_to_user_response.py +1 -1
  38. thestage/services/clients/thestage_api/dtos/ssh_key_controller/add_ssh_public_key_to_instance_request.py +4 -2
  39. thestage/services/clients/thestage_api/dtos/ssh_key_controller/is_user_has_public_ssh_key_response.py +1 -1
  40. thestage/services/clients/thestage_api/dtos/task_controller/task_list_for_project_request.py +4 -1
  41. thestage/services/clients/thestage_api/dtos/task_controller/task_view_response.py +0 -2
  42. thestage/services/config_provider/config_provider.py +2 -2
  43. thestage/services/connect/connect_service.py +76 -73
  44. thestage/services/container/container_service.py +23 -19
  45. thestage/services/container/mapper/container_mapper.py +2 -1
  46. thestage/services/instance/instance_service.py +13 -20
  47. thestage/services/instance/mapper/instance_mapper.py +1 -3
  48. thestage/services/instance/mapper/selfhosted_mapper.py +3 -4
  49. thestage/services/logging/logging_service.py +40 -40
  50. thestage/services/project/dto/inference_simulator_dto.py +1 -10
  51. thestage/services/project/dto/inference_simulator_model_dto.py +2 -10
  52. thestage/services/project/dto/project_config.py +3 -2
  53. thestage/services/project/mapper/project_inference_simulator_mapper.py +1 -0
  54. thestage/services/project/mapper/project_inference_simulator_model_mapper.py +3 -3
  55. thestage/services/project/mapper/project_task_mapper.py +2 -3
  56. thestage/services/project/project_service.py +161 -131
  57. thestage/services/remote_server_service.py +1 -0
  58. thestage/services/task/dto/task_dto.py +3 -23
  59. {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/METADATA +3 -2
  60. {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/RECORD +63 -72
  61. {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/WHEEL +1 -1
  62. thestage/services/clients/thestage_api/dtos/cloud_provider_region.py +0 -19
  63. thestage/services/clients/thestage_api/dtos/docker_container_assigned_device.py +0 -10
  64. thestage/services/clients/thestage_api/dtos/enums/currency_type.py +0 -10
  65. thestage/services/clients/thestage_api/dtos/enums/daemon_status.py +0 -9
  66. thestage/services/clients/thestage_api/dtos/enums/disk_type.py +0 -7
  67. thestage/services/clients/thestage_api/dtos/enums/drive_type.py +0 -7
  68. thestage/services/clients/thestage_api/dtos/enums/instance_type.py +0 -7
  69. thestage/services/clients/thestage_api/dtos/enums/location_region.py +0 -11
  70. thestage/services/clients/thestage_api/dtos/enums/power_status.py +0 -10
  71. thestage/services/clients/thestage_api/dtos/price_definition.py +0 -14
  72. {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info}/entry_points.txt +0 -0
  73. {thestage-0.6.4.dist-info → thestage-0.6.6.dist-info/licenses}/LICENSE.txt +0 -0
@@ -10,8 +10,10 @@ class DockerContainerEntity(BaseModel):
10
10
  use_enum_values=True,
11
11
  )
12
12
 
13
- slug: Optional[str] = Field(None, alias='UNIQUE ID')
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
- title: Optional[str] = Field(None, alias='TITLE')
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 UNIQUE ID')
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
- slug: Optional[str] = Field(None, alias='UNIQUE ID')
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
- id: Optional[int] = Field(None, alias='ID')
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
- id: Optional[int] = Field(None, alias='ID')
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
- docker_container_id: Optional[int] = Field(None, alias='DOCKER_CONTAINER_ID')
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
- # typer.echo(e100.__class__.__name__)
110
- # print(traceback.format_exc())
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
- if repo:
75
- # default git name master, rename to main - sync wih github
76
- repo.git.branch("-M", self.__base_name_local)
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
- progress = ProgressPrinter()
135
- try:
136
- origin.pull(refspec=local_branch, progress=progress)
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)