Skip to content

Commit a7f1429

Browse files
Merge pull request #2005 from basetenlabs/bump-version-0.11.14
Release 0.11.14
2 parents d907920 + 425bf5a commit a7f1429

File tree

6 files changed

+30
-7
lines changed

6 files changed

+30
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "truss"
3-
version = "0.11.13"
3+
version = "0.11.14"
44
description = "A seamless bridge from model development to model delivery"
55
authors = [
66
{ name = "Pankaj Gupta", email = "[email protected]" },

truss/base/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
}
5050

5151
SERVER_DOCKERFILE_TEMPLATE_NAME = "server.Dockerfile.jinja"
52+
NO_BUILD_DOCKERFILE_TEMPLATE_NAME = "no_build.Dockerfile.jinja"
5253
MODEL_DOCKERFILE_NAME = "Dockerfile"
5354
MODEL_CACHE_PATH = pathlib.Path("/app/model_cache")
5455
README_TEMPLATE_NAME = "README.md.jinja"

truss/base/truss_config.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,11 +541,19 @@ def _validate_path(cls, v: str) -> str:
541541

542542

543543
class DockerServer(custom_types.ConfigModel):
544-
start_command: str
544+
start_command: Optional[str] = None
545545
server_port: int
546546
predict_endpoint: str
547547
readiness_endpoint: str
548548
liveness_endpoint: str
549+
run_as_user_id: Optional[int] = None
550+
no_build: Optional[bool] = None
551+
552+
@pydantic.model_validator(mode="after")
553+
def _validate_start_command(self) -> "DockerServer":
554+
if not self.no_build and self.start_command is None:
555+
raise ValueError("start_command is required when no_build is not true")
556+
return self
549557

550558

551559
class TrainingArtifactReference(custom_types.ConfigModel):

truss/contexts/image_builder/serving_image_builder.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
FILENAME_CONSTANTS_MAP,
3333
MODEL_CACHE_PATH,
3434
MODEL_DOCKERFILE_NAME,
35+
NO_BUILD_DOCKERFILE_TEMPLATE_NAME,
3536
REQUIREMENTS_TXT_FILENAME,
3637
SERVER_CODE_DIR,
3738
SERVER_DOCKERFILE_TEMPLATE_NAME,
@@ -577,7 +578,10 @@ def prepare_image_build_dir(
577578
else:
578579
self.prepare_trtllm_decoder_build_dir(build_dir=build_dir)
579580

580-
if config.docker_server is not None:
581+
if (
582+
config.docker_server is not None
583+
and config.docker_server.no_build is not True
584+
):
581585
self._copy_into_build_dir(
582586
TEMPLATES_DIR / "docker_server_requirements.txt",
583587
build_dir,
@@ -750,12 +754,21 @@ def _render_dockerfile(
750754
build_commands: List[str],
751755
):
752756
config = self._spec.config
757+
753758
data_dir = build_dir / config.data_dir
754759
model_dir = build_dir / config.model_module_dir
755760
bundled_packages_dir = build_dir / config.bundled_packages_dir
756-
dockerfile_template = read_template_from_fs(
757-
TEMPLATES_DIR, SERVER_DOCKERFILE_TEMPLATE_NAME
758-
)
761+
762+
# Note: no-build deployment template doesn't use most of the template variables,
763+
# because it tries to run the base image as-is to the extent possible.
764+
if config.docker_server and config.docker_server.no_build:
765+
dockerfile_template = read_template_from_fs(
766+
TEMPLATES_DIR, NO_BUILD_DOCKERFILE_TEMPLATE_NAME
767+
)
768+
else:
769+
dockerfile_template = read_template_from_fs(
770+
TEMPLATES_DIR, SERVER_DOCKERFILE_TEMPLATE_NAME
771+
)
759772
python_version = truss_config.to_dotted_python_version(config.python_version)
760773
if config.base_image:
761774
base_image_name_and_tag = config.base_image.image
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM {{ config.base_image.image }}

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)