truss 0.11.5rc501__py3-none-any.whl → 0.11.5rc511__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.

@@ -1,5 +1,4 @@
1
1
  ARG PYVERSION={{ config.python_version }}
2
- ARG HOME
3
2
  FROM {{ base_image_name_and_tag }} AS truss_server
4
3
 
5
4
  {%- set python_exec_path = config.base_image.python_executable_path or '$(which python3)' %}
@@ -17,10 +16,10 @@ ENV PYTHON_EXECUTABLE="{{ python_executable }}"
17
16
  {%- if non_root_user %}
18
17
  {# The non-root user's home directory. #}
19
18
  {# uv will use $HOME to install packages. #}
20
- ENV HOME=${HOME:-/home/{{ app_username }}}
19
+ ENV HOME=/home/{{ app_username }}
21
20
  {%- else %}
22
21
  {# This is the default, but we use this variable later so ... setting it here too.#}
23
- ENV HOME=${HOME:-/root}
22
+ ENV HOME=/root
24
23
  {%- endif %} {#- endif non_root_user #}
25
24
  {# Directory containing inference server code. #}
26
25
  ENV APP_HOME=/{{ app_username }}
@@ -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,19 @@ 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
+ # Resolve symlinks to get the actual executable path
83
+ python_executable = python_executable.resolve()
84
+ pip_candidate = python_executable.parent / "pip"
85
+ if pip_candidate.exists():
86
+ return str(pip_candidate)
87
+ raise RuntimeError(f"Unable to find pip for Python executable: {python_path}")
88
+
81
89
  @property
82
90
  def _pip_path(self) -> str:
83
91
  if self._pip_path_cached is None:
84
- self._pip_path_cached = _identify_pip_path()
92
+ self._pip_path_cached = self._derive_pip_from_inference_server_python(self._inference_server_python)
85
93
  return self._pip_path_cached
86
94
 
87
95
  def _apply_python_requirement_patch(
@@ -158,11 +166,3 @@ class ModelContainerPatchApplier:
158
166
  raise ValueError(f"Unknown patch action {action}")
159
167
 
160
168
 
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,7 +1,7 @@
1
1
  ARG PYVERSION=py39
2
2
  FROM baseten/truss-server-base:3.9-v0.4.3 AS truss_server
3
3
  ENV PYTHON_EXECUTABLE="/usr/local/bin/python3"
4
- ENV HOME=${HOME:-/root}
4
+ ENV HOME=/root
5
5
  ENV APP_HOME=/app
6
6
  RUN mkdir -p ${APP_HOME} /control
7
7
  RUN useradd -u 60000 -ms /bin/bash app
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: truss
3
- Version: 0.11.5rc501
3
+ Version: 0.11.5rc511
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
@@ -66,14 +66,14 @@ truss/remote/baseten/utils/time.py,sha256=Ry9GMjYnbIGYVIGwtmv4V8ljWjvdcaCf5NOQzl
66
66
  truss/remote/baseten/utils/transfer.py,sha256=d3VptuQb6M1nyS6kz0BAfeOYDLkMKUjatJXpY-mp-As,1548
67
67
  truss/templates/README.md.jinja,sha256=N7CJdyldZuJamj5jLh47le0hFBdu9irVsTBqoxhPNPQ,2476
68
68
  truss/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
- truss/templates/base.Dockerfile.jinja,sha256=GH4Pu8EAezoolWT7qhB5NlQ_N5tm-2LuC8WcZAx4dhc,5813
69
+ truss/templates/base.Dockerfile.jinja,sha256=FG-RJ1ulMOF7VXWrDsBNQHhOUgaBKOISsUv8LEjPaGQ,5786
70
70
  truss/templates/cache.Dockerfile.jinja,sha256=1qZqDo1phrcqi-Vwol-VafYJkADsBbQWU6huQ-_1x00,1146
71
71
  truss/templates/cache_requirements.txt,sha256=xoPoJ-OVnf1z6oq_RVM3vCr3ionByyqMLj7wGs61nUs,87
72
72
  truss/templates/copy_cache_files.Dockerfile.jinja,sha256=Os5zFdYLZ_AfCRGq4RcpVTObOTwL7zvmwYcvOzd_Zqo,126
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=Np3-kLXnh2rgXk1Nfwim11DWTkUjZ7gcrtA-icYQqMk,6722
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
@@ -184,7 +184,7 @@ truss/tests/test_data/pima-indians-diabetes.csv,sha256=BvW3ws17ymhv2k-S6rX2Hn_2Q
184
184
  truss/tests/test_data/readme_int_example.md,sha256=fuHvpLtdkJy1f4NAR_djotVBdzusHYNXc-Fwh588XAE,1586
185
185
  truss/tests/test_data/readme_no_example.md,sha256=T2CzFMRvICXeX3_5XbFoqhHchcHGot-xM7izx34B3aQ,1607
186
186
  truss/tests/test_data/readme_str_example.md,sha256=fP4pvMqgLdIapaOf_BgRiV0H7pw4so0RNxrlq5lbROE,1726
187
- truss/tests/test_data/server.Dockerfile,sha256=EdJKGqEztRXOzXec021BBH7C4rV4QEDGqD357s0IPZU,1976
187
+ truss/tests/test_data/server.Dockerfile,sha256=DfULN7NEyQuhJcwjUAZbEnXYgadjST3815cu4CMQ2RU,1967
188
188
  truss/tests/test_data/annotated_types_truss/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
189
189
  truss/tests/test_data/annotated_types_truss/config.yaml,sha256=B-ZyyjLLqtxGfXj2tkH68Hy7NOMB_coYvoWyWom61g0,147
190
190
  truss/tests/test_data/annotated_types_truss/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.5rc501.dist-info/METADATA,sha256=o6fjTFC_junPHCRvoSsJUFNaqEHbWMMKRpwLMyUbju8,6682
372
- truss-0.11.5rc501.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
- truss-0.11.5rc501.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
- truss-0.11.5rc501.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
- truss-0.11.5rc501.dist-info/RECORD,,
371
+ truss-0.11.5rc511.dist-info/METADATA,sha256=SHv0KiJnhaojxWyuHKA5xYIj4La8QNvNMo06taE90-c,6682
372
+ truss-0.11.5rc511.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
+ truss-0.11.5rc511.dist-info/entry_points.txt,sha256=-MwKfHHQHQ6j0HqIgvxrz3CehCmczDLTD-OsRHnjjuU,130
374
+ truss-0.11.5rc511.dist-info/licenses/LICENSE,sha256=FTqGzu85i-uw1Gi8E_o0oD60bH9yQ_XIGtZbA1QUYiw,1064
375
+ truss-0.11.5rc511.dist-info/RECORD,,