truss 0.11.5rc3__py3-none-any.whl → 0.11.5rc500__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.
- truss/templates/base.Dockerfile.jinja +5 -0
- truss/tests/test_data/server.Dockerfile +1 -1
- truss/tests/test_model_inference.py +2 -2
- {truss-0.11.5rc3.dist-info → truss-0.11.5rc500.dist-info}/METADATA +1 -1
- {truss-0.11.5rc3.dist-info → truss-0.11.5rc500.dist-info}/RECORD +10 -10
- truss_train/definitions.py +6 -10
- truss_train/restore_from_checkpoint.py +1 -3
- {truss-0.11.5rc3.dist-info → truss-0.11.5rc500.dist-info}/WHEEL +0 -0
- {truss-0.11.5rc3.dist-info → truss-0.11.5rc500.dist-info}/entry_points.txt +0 -0
- {truss-0.11.5rc3.dist-info → truss-0.11.5rc500.dist-info}/licenses/LICENSE +0 -0
|
@@ -13,9 +13,14 @@ ENV PYTHON_EXECUTABLE="{{ python_executable }}"
|
|
|
13
13
|
{%- set app_user_uid = 60000 %}
|
|
14
14
|
{%- set control_server_dir = "/control" %}
|
|
15
15
|
{%- set default_owner = "root:root" %}
|
|
16
|
+
{%- if non_root_user %}
|
|
16
17
|
{# The non-root user's home directory. #}
|
|
17
18
|
{# uv will use $HOME to install packages. #}
|
|
18
19
|
ENV HOME=/home/{{ app_username }}
|
|
20
|
+
{%- else %}
|
|
21
|
+
{# This is the default, but we use this variable later so ... setting it here too.#}
|
|
22
|
+
ENV HOME=/root
|
|
23
|
+
{%- endif %} {#- endif non_root_user #}
|
|
19
24
|
{# Directory containing inference server code. #}
|
|
20
25
|
ENV APP_HOME=/{{ app_username }}
|
|
21
26
|
RUN mkdir -p ${APP_HOME} {{ control_server_dir }}
|
|
@@ -990,8 +990,8 @@ def test_is_healthy_returns_503_on_load_failure():
|
|
|
990
990
|
# when the model goes down, this will throw an exception
|
|
991
991
|
break
|
|
992
992
|
diff = container.diff()
|
|
993
|
-
# the crash file is written to the
|
|
994
|
-
crash_file_path = "/
|
|
993
|
+
# the crash file is written to the user's home directory
|
|
994
|
+
crash_file_path = "/root/inference_server_crashed.txt"
|
|
995
995
|
assert crash_file_path in diff
|
|
996
996
|
assert diff[crash_file_path] == "A"
|
|
997
997
|
|
|
@@ -66,7 +66,7 @@ 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=
|
|
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
|
|
@@ -134,7 +134,7 @@ truss/tests/test_context_builder_image.py,sha256=fVZNJSzZNiWa7Dr1X_VhhMJtyJ5HzsL
|
|
|
134
134
|
truss/tests/test_control_truss_patching.py,sha256=qQOUfyF1MorZ_obOvPJK9utI4HUAzgT6YBS-fo90TEw,14497
|
|
135
135
|
truss/tests/test_custom_server.py,sha256=GP2qMgnqxJMPRtfEciqbhBcG0_JUK7gNL7nrXPGrSLg,1305
|
|
136
136
|
truss/tests/test_docker.py,sha256=3RI6jEC9CVQsKj83s_gOBl3EkdOaov-KEX4IihfMJW4,523
|
|
137
|
-
truss/tests/test_model_inference.py,sha256=
|
|
137
|
+
truss/tests/test_model_inference.py,sha256=Q8mgNDNbwAUi7AQTgmyK-QrYuksuARDczYndTh56fKk,76205
|
|
138
138
|
truss/tests/test_model_schema.py,sha256=Bw28CZ4D0JQOkYdBQJZvgryeW0TRn7Axketp5kvZ_t4,14219
|
|
139
139
|
truss/tests/test_testing_utilities_for_other_tests.py,sha256=YqIKflnd_BUMYaDBSkX76RWiWGWM_UlC2IoT4NngMqE,3048
|
|
140
140
|
truss/tests/test_truss_gatherer.py,sha256=bn288OEkC49YY0mhly4cAl410ktZPfElNdWwZy82WfA,1261
|
|
@@ -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=
|
|
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
|
|
@@ -363,13 +363,13 @@ truss_chains/remote_chainlet/model_skeleton.py,sha256=8ZReLOO2MLcdg7bNZ61C-6j-e6
|
|
|
363
363
|
truss_chains/remote_chainlet/stub.py,sha256=Y2gDUzMY9WRaQNHIz-o4dfLUfFyYV9dUhIRQcfgrY8g,17209
|
|
364
364
|
truss_chains/remote_chainlet/utils.py,sha256=Zn3GZRvK8f65WUa-qa-8uPFZ2pD7ukRFxbLOvT-BL0Q,24063
|
|
365
365
|
truss_train/__init__.py,sha256=A3MzRPMInZfmzLvPpZI7gdKgshAVCw6bwhU-6JYU2zs,939
|
|
366
|
-
truss_train/definitions.py,sha256=
|
|
366
|
+
truss_train/definitions.py,sha256=TGoeG86aG76wt3h3giufg1rfm9K0W8y9bDJSITe76Aw,8209
|
|
367
367
|
truss_train/deployment.py,sha256=lWWANSuzBWu2M4oK4qD7n-oVR1JKdmw2Pn5BJQHg-Ck,3074
|
|
368
368
|
truss_train/loader.py,sha256=0o66EjBaHc2YY4syxxHVR4ordJWs13lNXnKjKq2wq0U,1630
|
|
369
369
|
truss_train/public_api.py,sha256=9N_NstiUlmBuLUwH_fNG_1x7OhGCytZLNvqKXBlStrM,1220
|
|
370
|
-
truss_train/restore_from_checkpoint.py,sha256=
|
|
371
|
-
truss-0.11.
|
|
372
|
-
truss-0.11.
|
|
373
|
-
truss-0.11.
|
|
374
|
-
truss-0.11.
|
|
375
|
-
truss-0.11.
|
|
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,,
|
truss_train/definitions.py
CHANGED
|
@@ -3,7 +3,7 @@ from abc import ABC
|
|
|
3
3
|
from typing import Dict, List, Literal, Optional, Union
|
|
4
4
|
|
|
5
5
|
import pydantic
|
|
6
|
-
from pydantic import field_validator, model_validator
|
|
6
|
+
from pydantic import ValidationError, field_validator, model_validator
|
|
7
7
|
|
|
8
8
|
from truss.base import constants, custom_types, truss_config
|
|
9
9
|
|
|
@@ -68,8 +68,7 @@ class _BasetenLatestCheckpoint(_CheckpointBase):
|
|
|
68
68
|
|
|
69
69
|
class _BasetenNamedCheckpoint(_CheckpointBase):
|
|
70
70
|
checkpoint_name: str
|
|
71
|
-
job_id:
|
|
72
|
-
project_name: Optional[str]
|
|
71
|
+
job_id: str
|
|
73
72
|
typ: Literal["baseten_named_checkpoint"] = "baseten_named_checkpoint"
|
|
74
73
|
|
|
75
74
|
|
|
@@ -78,18 +77,15 @@ class BasetenCheckpoint:
|
|
|
78
77
|
def from_latest_checkpoint(
|
|
79
78
|
project_name: Optional[str] = None, job_id: Optional[str] = None
|
|
80
79
|
) -> _BasetenLatestCheckpoint:
|
|
80
|
+
if not job_id and not project_name:
|
|
81
|
+
raise ValidationError("job_id or project_name is required")
|
|
81
82
|
return _BasetenLatestCheckpoint(project_name=project_name, job_id=job_id)
|
|
82
83
|
|
|
83
84
|
@classmethod
|
|
84
85
|
def from_named_checkpoint(
|
|
85
|
-
cls,
|
|
86
|
-
checkpoint_name: str,
|
|
87
|
-
project_name: Optional[str] = None,
|
|
88
|
-
job_id: Optional[str] = None,
|
|
86
|
+
cls, checkpoint_name: str, job_id: str
|
|
89
87
|
) -> _BasetenNamedCheckpoint:
|
|
90
|
-
return _BasetenNamedCheckpoint(
|
|
91
|
-
checkpoint_name=checkpoint_name, project_name=project_name, job_id=job_id
|
|
92
|
-
)
|
|
88
|
+
return _BasetenNamedCheckpoint(checkpoint_name=checkpoint_name, job_id=job_id)
|
|
93
89
|
|
|
94
90
|
|
|
95
91
|
class LoadCheckpointConfig(custom_types.SafeModelNoExtra):
|
|
@@ -18,9 +18,7 @@ load_most_recent_checkpoint = BasetenCheckpoint.from_latest_checkpoint(
|
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
load_from_named_checkpoint = BasetenCheckpoint.from_named_checkpoint(
|
|
21
|
-
checkpoint_name="checkpoint-24",
|
|
22
|
-
project_name="first-project", # Optional
|
|
23
|
-
job_id="lqz4pw4", # Optional
|
|
21
|
+
checkpoint_name="checkpoint-24", job_id="lqz4pw4"
|
|
24
22
|
)
|
|
25
23
|
|
|
26
24
|
load_checkpoint_config = LoadCheckpointConfig(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|