truss 0.11.5rc500__py3-none-any.whl → 0.11.5rc510__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.

Potentially problematic release.


This version of truss might be problematic. Click here for more details.

@@ -57,10 +57,11 @@ def create_app(base_config: Dict):
57
57
  base_url=f"http://localhost:{app_state.inference_server_port}", limits=limits
58
58
  )
59
59
 
60
- pip_path = getattr(app_state, "pip_path", None)
60
+ # Get inference server's Python executable
61
+ inference_server_python = app_state.inference_server_process_args[0]
61
62
 
62
63
  patch_applier = ModelContainerPatchApplier(
63
- Path(app_state.inference_server_home), app_logger, pip_path
64
+ Path(app_state.inference_server_home), app_logger, inference_server_python
64
65
  )
65
66
 
66
67
  oversee_inference_server = getattr(app_state, "oversee_inference_server", True)
@@ -30,7 +30,7 @@ class ModelContainerPatchApplier:
30
30
  self,
31
31
  inference_server_home: Path,
32
32
  app_logger: logging.Logger,
33
- pip_path: Optional[str] = None, # Only meant for testing
33
+ inference_server_python: Optional[str] = None, # Python executable for inference server
34
34
  ) -> None:
35
35
  self._inference_server_home = inference_server_home
36
36
  self._model_module_dir = (
@@ -41,9 +41,8 @@ class ModelContainerPatchApplier:
41
41
  ).resolve()
42
42
  self._data_dir = self._inference_server_home / self._truss_config.data_dir
43
43
  self._app_logger = app_logger
44
+ self._inference_server_python = inference_server_python
44
45
  self._pip_path_cached = None
45
- if pip_path is not None:
46
- self._pip_path_cached = "pip"
47
46
 
48
47
  def __call__(self, patch: Patch, inf_env: dict):
49
48
  self._app_logger.debug(f"Applying patch {patch.to_dict()}")
@@ -78,10 +77,17 @@ class ModelContainerPatchApplier:
78
77
  def _truss_config(self) -> TrussConfig:
79
78
  return TrussConfig.from_yaml(self._inference_server_home / "config.yaml")
80
79
 
80
+ def _derive_pip_from_inference_server_python(self, python_path: str) -> str:
81
+ python_executable = Path(python_path)
82
+ pip_candidate = python_executable.parent / "pip"
83
+ if pip_candidate.exists():
84
+ return str(pip_candidate)
85
+ raise RuntimeError(f"Unable to find pip for Python executable: {python_path}")
86
+
81
87
  @property
82
88
  def _pip_path(self) -> str:
83
89
  if self._pip_path_cached is None:
84
- self._pip_path_cached = _identify_pip_path()
90
+ self._pip_path_cached = self._derive_pip_from_inference_server_python(self._inference_server_python)
85
91
  return self._pip_path_cached
86
92
 
87
93
  def _apply_python_requirement_patch(
@@ -158,11 +164,3 @@ class ModelContainerPatchApplier:
158
164
  raise ValueError(f"Unknown patch action {action}")
159
165
 
160
166
 
161
- def _identify_pip_path() -> str:
162
- if Path("/usr/local/bin/pip3").exists():
163
- return "/usr/local/bin/pip3"
164
-
165
- if Path("/usr/local/bin/pip").exists():
166
- return "/usr/local/bin/pip"
167
-
168
- raise RuntimeError("Unable to find pip, make sure it's installed.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truss
3
- Version: 0.11.5rc500
3
+ Version: 0.11.5rc510
4
4
  Summary: A seamless bridge from model development to model delivery
5
5
  Project-URL: Repository, https://github.com/basetenlabs/truss
6
6
  Project-URL: Homepage, https://truss.baseten.co
@@ -73,7 +73,7 @@ truss/templates/copy_cache_files.Dockerfile.jinja,sha256=Os5zFdYLZ_AfCRGq4RcpVTO
73
73
  truss/templates/docker_server_requirements.txt,sha256=PyhOPKAmKW1N2vLvTfLMwsEtuGpoRrbWuNo7tT6v2Mc,18
74
74
  truss/templates/server.Dockerfile.jinja,sha256=CUYnF_hgxPGq2re7__0UPWlwzOHMoFkxp6NVKi3U16s,7071
75
75
  truss/templates/control/requirements.txt,sha256=nqqNmlTwFeV8sV4fqwItwzzd_egADBP_e-cEopXBJ4k,358
76
- truss/templates/control/control/application.py,sha256=jYeta6hWe1SkfLL3W4IDmdYjg3ZuKqI_UagWYs5RB_E,3793
76
+ truss/templates/control/control/application.py,sha256=bR4dd6PLokveyFBd2DVvyn_GEi65xz4K3Bl9gBq4m0E,3876
77
77
  truss/templates/control/control/endpoints.py,sha256=VQ1lvZjFvR091yRkiFdvXw1Q7PiNGXT9rJwY7_sX6yg,11828
78
78
  truss/templates/control/control/server.py,sha256=R4Y219i1dcz0kkksN8obLoX-YXWGo9iW1igindyG50c,3128
79
79
  truss/templates/control/control/helpers/context_managers.py,sha256=W6dyFgLBhPa5meqrOb3w_phMtKfaJI-GhwUfpiycDc8,413
@@ -84,7 +84,7 @@ truss/templates/control/control/helpers/inference_server_process_controller.py,s
84
84
  truss/templates/control/control/helpers/inference_server_starter.py,sha256=Fz2Puijro6Cc5cvTsAqOveNJbBQR_ARYJXl4lvETJ8Y,2633
85
85
  truss/templates/control/control/helpers/truss_patch/__init__.py,sha256=CXZdUV_ylqLTJrKuFpvSnUT6PUFrZrMF2y6jiHbdaKU,998
86
86
  truss/templates/control/control/helpers/truss_patch/model_code_patch_applier.py,sha256=LTIIADLz0wRn7V49j64dU1U7Hbta9YLde3pb5YZWvzQ,2001
87
- truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=uiZvKhLa_rpr_N67NpApgA-XVrBFLXraZlikSOFDDOw,6445
87
+ truss/templates/control/control/helpers/truss_patch/model_container_patch_applier.py,sha256=BkZ98XqIGqmnmbBq3RJiccfBWPu7azwawLeKK66G8xs,6605
88
88
  truss/templates/control/control/helpers/truss_patch/requirement_name_identifier.py,sha256=CL3KEAj4B3ApMQShd7TI5umXVbazLZY5StrNlwHwWtc,1995
89
89
  truss/templates/control/control/helpers/truss_patch/system_packages.py,sha256=IYh1CVU_kooAvtSGXKQDDWnNdOhlv7ENWagsL1wvhgw,208
90
90
  truss/templates/custom/examples.yaml,sha256=2UcCtEdavImWmiCtj31ckBlAKVOwNMC5AwMIIznKDag,48
@@ -368,8 +368,8 @@ truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,307
368
368
  truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
369
369
  truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
370
370
  truss_train/restore_from_checkpoint.py,sha256=8hdPm-WSgkt74HDPjvCjZMBpvA9MwtoYsxVjOoa7BaM,1176
371
- truss-0.11.5rc500.dist-info/METADATA,sha256=I4vLatyrJc70Gqt_GEaXXsos9gdNOG9ugQg4momlGAI,6682
372
- truss-0.11.5rc500.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
- truss-0.11.5rc500.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
- truss-0.11.5rc500.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
- truss-0.11.5rc500.dist-info/RECORD,,
371
+ truss-0.11.5rc510.dist-info/METADATA,sha256=frL66XxBktCNbkVKO6fQQQAVhwJ62iRoUaKo5nvKwq8,6682
372
+ truss-0.11.5rc510.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
+ truss-0.11.5rc510.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
+ truss-0.11.5rc510.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
+ truss-0.11.5rc510.dist-info/RECORD,,