thestage 0.5.41__py3-none-any.whl → 0.5.43__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  from . import *
2
2
  __app_name__ = "thestage"
3
- __version__ = "0.5.41"
3
+ __version__ = "0.5.43"
@@ -3,3 +3,4 @@ from enum import Enum
3
3
 
4
4
  class ColorScheme(str, Enum):
5
5
  GIT_HEADLESS = "orange_red1"
6
+ WARNING = "orange_red1"
@@ -1,7 +1,9 @@
1
1
  import time
2
+ from pathlib import Path
2
3
  from typing import Optional, List
3
4
 
4
5
  import re
6
+
5
7
  import typer
6
8
  from typing_extensions import Annotated
7
9
 
@@ -425,6 +427,13 @@ def run_inference_simulator(
425
427
  help=__("Disable real-time log streaming"),
426
428
  is_eager=False,
427
429
  ),
430
+ is_skip_installation: Optional[bool] = typer.Option(
431
+ False,
432
+ "--skip-installation",
433
+ "-si",
434
+ help=__("Skip installing dependencies from requirements.txt and install.sh"),
435
+ is_eager=False,
436
+ ),
428
437
  ):
429
438
  """
430
439
  Run an inference simulator within a project
@@ -438,6 +447,35 @@ def run_inference_simulator(
438
447
  service_factory = validate_config_and_get_service_factory(working_directory=working_directory)
439
448
  config = service_factory.get_config_provider().get_full_config()
440
449
 
450
+ working_dir_path = Path(working_directory) if working_directory else Path(config.runtime.working_directory)
451
+ inference_files = list(working_dir_path.rglob("inference.py"))
452
+ if not inference_files:
453
+ typer.echo("No inference.py file found in the project directory.")
454
+ raise typer.Exit(1)
455
+ elif len(inference_files) == 1:
456
+ selected_inference = inference_files[0]
457
+ else:
458
+ choices = [str(path.relative_to(working_dir_path)) for path in inference_files]
459
+ typer.echo("Multiple inference.py files found:")
460
+ for idx, choice in enumerate(choices, start=1):
461
+ typer.echo(f"{idx}) {choice}")
462
+ choice_str = typer.prompt("Choose which inference.py to use")
463
+ try:
464
+ choice_index = int(choice_str)
465
+ except ValueError:
466
+ raise typer.BadParameter("Invalid input. Please enter a number.")
467
+ if not (1 <= choice_index <= len(choices)):
468
+ raise typer.BadParameter("Choice out of range.")
469
+ selected_inference = inference_files[choice_index - 1]
470
+
471
+ relative_inference = selected_inference.relative_to(working_dir_path)
472
+ parent_dir = relative_inference.parent
473
+ if parent_dir == Path("."):
474
+ inference_dir = "/"
475
+ else:
476
+ inference_dir = f"{parent_dir.as_posix()}/"
477
+ typer.echo(f"Selected inference file relative path: {inference_dir}")
478
+
441
479
  project_service = service_factory.get_project_service()
442
480
 
443
481
  project_service.project_run_inference_simulator(
@@ -446,6 +484,8 @@ def run_inference_simulator(
446
484
  slug=unique_id,
447
485
  rented_instance_unique_id=rented_instance_unique_id,
448
486
  self_hosted_instance_unique_id=self_hosted_instance_unique_id,
487
+ inference_dir=inference_dir,
488
+ is_skip_installation=is_skip_installation,
449
489
  )
450
490
 
451
491
  if enable_log_stream:
thestage/main.py CHANGED
@@ -1,18 +1,19 @@
1
- # temp fix to reduce annoying warnings
2
- import warnings
3
- warnings.filterwarnings(action='ignore', module='.*paramiko.*')
4
-
5
- from . import __app_name__
1
+ def main():
2
+ try:
3
+ import warnings
4
+ warnings.filterwarnings(action='ignore', module='.*paramiko.*')
6
5
 
7
- from thestage.controllers import base_controller, container_controller, instance_controller, project_controller, \
8
- config_controller
6
+ from . import __app_name__
9
7
 
10
- base_controller.app.add_typer(container_controller.app, name="container")
11
- base_controller.app.add_typer(instance_controller.app, name="instance")
12
- base_controller.app.add_typer(project_controller.app, name="project")
13
- base_controller.app.add_typer(config_controller.app, name="config")
8
+ from thestage.controllers import base_controller, container_controller, instance_controller, project_controller, \
9
+ config_controller
14
10
 
11
+ base_controller.app.add_typer(container_controller.app, name="container")
12
+ base_controller.app.add_typer(instance_controller.app, name="instance")
13
+ base_controller.app.add_typer(project_controller.app, name="project")
14
+ base_controller.app.add_typer(config_controller.app, name="config")
15
15
 
16
- def main():
17
- import thestage.config
18
- base_controller.app(prog_name=__app_name__)
16
+ import thestage.config
17
+ base_controller.app(prog_name=__app_name__)
18
+ except KeyboardInterrupt:
19
+ print('THESTAGE: Keyboard Interrupt')
@@ -603,6 +603,8 @@ class TheStageApiClient(TheStageApiClientCore):
603
603
  commit_hash: Optional[str] = None,
604
604
  rented_instance_unique_id: Optional[str] = None,
605
605
  self_hosted_instance_unique_id: Optional[str] = None,
606
+ inference_dir: Optional[str] = None,
607
+ is_skip_installation: Optional[bool] = False,
606
608
  ) -> Optional[ProjectStartInferenceSimulatorResponse]:
607
609
  request = ProjectStartInferenceSimulatorRequest(
608
610
  projectSlug=project_slug,
@@ -610,6 +612,8 @@ class TheStageApiClient(TheStageApiClientCore):
610
612
  slug=slug,
611
613
  instanceRentedUId=rented_instance_unique_id,
612
614
  selfhostedInstanceUId=self_hosted_instance_unique_id,
615
+ inferenceDir=inference_dir,
616
+ isSkipInstallation=is_skip_installation,
613
617
  )
614
618
 
615
619
  response = self._request(
@@ -10,4 +10,6 @@ class ProjectStartInferenceSimulatorRequest(BaseModel):
10
10
  instanceRentedUId: Optional[str] = Field(None, alias='instanceRentedUId')
11
11
  selfhostedInstanceUId: Optional[str] = Field(None, alias='selfhostedInstanceUId')
12
12
  commitHash: Optional[str] = Field(None, alias='commitHash')
13
- slug: Optional[str] = Field(None, alias='slug')
13
+ slug: Optional[str] = Field(None, alias='slug')
14
+ inferenceDir: Optional[str] = Field(None, alias='inferenceDir')
15
+ isSkipInstallation: Optional[bool] = Field(False, alias='isSkipInstallation')
@@ -390,7 +390,7 @@ class ProjectService(AbstractService):
390
390
  )
391
391
  if run_task_response:
392
392
  if run_task_response.message:
393
- typer.echo(run_task_response.message)
393
+ print(f"[{ColorScheme.WARNING.value}]{run_task_response.message}[{ColorScheme.WARNING.value}]")
394
394
  if run_task_response.is_success and run_task_response.task:
395
395
  typer.echo(f"Task '{run_task_response.task.title}' has been scheduled successfully. Task ID: {run_task_response.task.id}")
396
396
  return run_task_response.task
@@ -409,6 +409,8 @@ class ProjectService(AbstractService):
409
409
  commit_hash: Optional[str] = None,
410
410
  rented_instance_unique_id: Optional[str] = None,
411
411
  self_hosted_instance_unique_id: Optional[str] = None,
412
+ inference_dir: Optional[str] = None,
413
+ is_skip_installation: Optional[bool] = False,
412
414
  ) -> Optional[InferenceSimulatorDto]:
413
415
  project_config: ProjectConfig = self.__get_fixed_project_config(config=config)
414
416
  if not project_config:
@@ -543,6 +545,8 @@ class ProjectService(AbstractService):
543
545
  slug=slug,
544
546
  rented_instance_unique_id=rented_instance_unique_id,
545
547
  self_hosted_instance_unique_id=self_hosted_instance_unique_id,
548
+ inference_dir=inference_dir,
549
+ is_skip_installation=is_skip_installation,
546
550
  )
547
551
  if start_inference_simulator_response:
548
552
  if start_inference_simulator_response.message:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: thestage
3
- Version: 0.5.41
3
+ Version: 0.5.43
4
4
  Summary:
5
5
  Author: TheStage AI team
6
6
  Author-email: hello@thestage.ai
@@ -1,6 +1,6 @@
1
- thestage/__init__.py,sha256=VZwLTO9zP1X39kXdNyRFETyBnYYkrk_E4w1gxiko0qA,65
1
+ thestage/__init__.py,sha256=2AyzlmhzrqADr8xt8n54FzyseX-iUutY-ndNo6UGbLg,65
2
2
  thestage/__main__.py,sha256=4ObdWrDRaIASaR06IxtFSsoMu58eyL0MnD64habvPj8,101
3
- thestage/color_scheme/color_scheme.py,sha256=jzdRCX0hi_XStXi4kvPHVItKlTm7dsD3fHIdeRQLeKw,87
3
+ thestage/color_scheme/color_scheme.py,sha256=cL2SwCCCME2sy9n1ve6dakUFIENnFZCVQyvg6EAe3ew,115
4
4
  thestage/config/__init__.py,sha256=RNobilYVK1WAM1utcQ8ZuATKc9Zh9M9BAjCLZTnR_TA,428
5
5
  thestage/config/env_base.py,sha256=RNBQ17yk1ieu1kdUlM7Qe7mDCoxstgGUwwhe265o4dQ,367
6
6
  thestage/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -8,7 +8,7 @@ thestage/controllers/base_controller.py,sha256=lX0XsBc7ZEPD_I56cN8IBAVuWGIkOkr7J
8
8
  thestage/controllers/config_controller.py,sha256=Gzd61UeU1igFT4QUyrZ4dOo_QaNEuXuSEIroXpbBhPA,5365
9
9
  thestage/controllers/container_controller.py,sha256=C3WC-Ypeg-vpC8LyCcPZVszbiaDYf2aQzTxYC2PPG8g,15210
10
10
  thestage/controllers/instance_controller.py,sha256=pFhkO7U2Ta0_1dzskEj8hbE7Izw_7I4SDbq5O5-bfIY,9757
11
- thestage/controllers/project_controller.py,sha256=M15b-VhThEhI1eOTX7r3njFnHAWK-tcLc23etOOKTj0,32527
11
+ thestage/controllers/project_controller.py,sha256=yxYBed4fHGjw9ofQSXNg2TUPobGrFj9lb5_iHATuYfA,34274
12
12
  thestage/controllers/utils_controller.py,sha256=FV35yte7jTZRzy2DaL3OZCNzmlVrsNKxksC8P0FD7hM,1030
13
13
  thestage/debug_main.dist.py,sha256=UPIJ58yf-6FtXZj-FLAwxi7HononseuCYm9xb5KlxTs,783
14
14
  thestage/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -41,7 +41,7 @@ thestage/helpers/logger/app_logger.py,sha256=hUuxgUsj4pl9Ogjt1xJePTf71iVxKzyx46d
41
41
  thestage/helpers/ssh_util.py,sha256=JuDwddHxEGcA24Y8a-jLv339cG-jq4hEaBAl5TSVVFw,1262
42
42
  thestage/i18n/en_GB/messages.po,sha256=BuVIhd5TRQkgFkAbTGvbSRuO88lSJGpnk9TT2J9BC8E,32375
43
43
  thestage/i18n/translation.py,sha256=c62OicQ4phSMuqDe7hqGebIsk0W2-8ZJUfgfdtjjqEc,284
44
- thestage/main.py,sha256=W0Vz9qdNK44fLRQOfZoa132iHqp5spIYLdgtOE4BYqU,659
44
+ thestage/main.py,sha256=3gHKEbOmpUTT5byvD9gPgT2uoaijAJUoa7G5dSnVlbs,784
45
45
  thestage/services/.env,sha256=K2VpzFAVjD75XawAHZdR0HWmypryA_mXNY4WHNgR-wQ,184
46
46
  thestage/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  thestage/services/abstract_mapper.py,sha256=_q7YLkPNRsNW5wOCqvZIu1KfpLkc7uVaAQKrMZtsGuY,218
@@ -52,7 +52,7 @@ thestage/services/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
52
52
  thestage/services/clients/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  thestage/services/clients/git/git_client.py,sha256=-5WSoDj0Fi6PJD_Eo04ne83Z6IGQ85qa4eVmIsLnpb4,11737
54
54
  thestage/services/clients/thestage_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
- thestage/services/clients/thestage_api/api_client.py,sha256=BSxG6_FzoTCBub-24Hffwo6IsfAPhdzYqpfpediWucY,29396
55
+ thestage/services/clients/thestage_api/api_client.py,sha256=FeP9ltSZqrra5j9PTy-JBIw3S-LOWG_q9CddXsmtBV4,29596
56
56
  thestage/services/clients/thestage_api/core/api_client_abstract.py,sha256=nJ0OiT4Ecexp-3HHK332pvyzrf1JsZ1WQYdvn-aeIL8,2984
57
57
  thestage/services/clients/thestage_api/core/api_client_core.py,sha256=WwtzdTAxog-l2UU8Up40BxepgM7OTXn-XHgzlHorXT0,908
58
58
  thestage/services/clients/thestage_api/core/http_client_exception.py,sha256=JH-874Gu9T1b1_FpPBLqdyt9U0PyhpwRCe_oDc6c_jI,385
@@ -116,7 +116,7 @@ thestage/services/clients/thestage_api/dtos/project_controller/project_push_infe
116
116
  thestage/services/clients/thestage_api/dtos/project_controller/project_push_inference_simulator_model_response.py,sha256=aNaD4xVkhbwlD_rI3D0-2gp-F4L6CxxUkAOSLJZPl1I,249
117
117
  thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_request.py,sha256=ZFe2uGseJGwixBh380zpaotb_aWUidrqUSYoqe-y4jE,660
118
118
  thestage/services/clients/thestage_api/dtos/project_controller/project_run_task_response.py,sha256=iISmJTHbxSRJsXHT4qBTMP3-Co9fWCHI5s2UgB_-GV8,340
119
- thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py,sha256=YtyM678EYehdCNAiwrEbWsXNsoRDtWeW1t96V7LLAFw,525
119
+ thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_request.py,sha256=TMLXtRAy1Z66xt-XmLS-88tDwuWBA3srz6w-uAlM71U,675
120
120
  thestage/services/clients/thestage_api/dtos/project_controller/project_start_inference_simulator_response.py,sha256=Q7XlbZ4vgk9QQL2z11BeUkKDn-5p8j06eNI0GmpZNjk,430
121
121
  thestage/services/clients/thestage_api/dtos/project_response.py,sha256=PQ0L14_8akc5ADZeL_Y15Z2Hlvkt54d0YKfPROJZQHk,1691
122
122
  thestage/services/clients/thestage_api/dtos/selfhosted_instance_response.py,sha256=iDo2AFlUr2WV7vhBU40Abyp1AFoEk986UQRb5O0as4U,3049
@@ -161,13 +161,13 @@ thestage/services/project/mapper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
161
161
  thestage/services/project/mapper/project_inference_simulator_mapper.py,sha256=UdOu9IIF5rlNPoWSaaeSKU3ODe8E5uSMgm2V5ywMWKE,812
162
162
  thestage/services/project/mapper/project_inference_simulator_model_mapper.py,sha256=PWY0iWbXhvD-G0X0_aQZAFY2bqc0lvRJcQAyC8Y-88Q,869
163
163
  thestage/services/project/mapper/project_task_mapper.py,sha256=SHIEXjYwt4vm2B1X2QiI4sCPbBarum0bTOnmTWPOlto,813
164
- thestage/services/project/project_service.py,sha256=vdHb9YB4yfw5UlOIa95M-CJLb3mQZIHn5hLhevagC5A,50666
164
+ thestage/services/project/project_service.py,sha256=KWcYzYZL56QSoYiwkresglGeDKvYSlUXlQqBjTVAQBo,50927
165
165
  thestage/services/remote_server_service.py,sha256=3VPgd9ckxXOxXGGvb3JeJ0LwuZx2gd2jWn3Pf-CxqVk,23264
166
166
  thestage/services/service_factory.py,sha256=tWbFFDO6TeOz5jSYbe-OabqTmsjR9Xs1OZmd49Aj3g0,5098
167
167
  thestage/services/task/dto/task_dto.py,sha256=PJwrUsLLAoO2uA9xvzb27b9iYAoNiBcsHSxKERh2VFo,2335
168
168
  thestage/services/validation_service.py,sha256=ABb-ok-SGITE6jm8AR1hiYHYgGZL7ri02Yi0OCXbofo,2008
169
- thestage-0.5.41.dist-info/LICENSE.txt,sha256=U9QrxfdD7Ie7r8z1FleuvOGQvgCF1m0Mjd78cFvWaHE,572
170
- thestage-0.5.41.dist-info/METADATA,sha256=as8bA9PG2EvbCpYXW_0cGMWLSa0b6tWwE3qwawxP9h8,5557
171
- thestage-0.5.41.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
172
- thestage-0.5.41.dist-info/entry_points.txt,sha256=57pMhs8zaCM-jgeTffC0WVqCsh35Uq_dUDmzXR80CI4,47
173
- thestage-0.5.41.dist-info/RECORD,,
169
+ thestage-0.5.43.dist-info/LICENSE.txt,sha256=U9QrxfdD7Ie7r8z1FleuvOGQvgCF1m0Mjd78cFvWaHE,572
170
+ thestage-0.5.43.dist-info/METADATA,sha256=rDmxq80SVJmJ-ZTPqL1TabIKTDcy7ql1t9Nll3qbP8M,5557
171
+ thestage-0.5.43.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
172
+ thestage-0.5.43.dist-info/entry_points.txt,sha256=57pMhs8zaCM-jgeTffC0WVqCsh35Uq_dUDmzXR80CI4,47
173
+ thestage-0.5.43.dist-info/RECORD,,