Repository navigation
fix(serve): resolve Triton model.py and pack_conda_env.sh from model_server/triton - #6413
Open
AkshayShah03 wants to merge 1 commit into
Open
AkshayShah03 wants to merge 1 commit into
AkshayShah03 wants to merge 1 commit into
Conversation
…server/triton When this code moved from model_server/triton/triton_builder.py into model_builder_utils.py, the Path(__file__).parent lookups for the Triton python-backend model.py and pack_conda_env.sh were not updated. They now resolve to sagemaker/serve/model.py and sagemaker/serve/pack_conda_env.sh, which do not exist, so building a Triton model with an inference_spec failed with FileNotFoundError when copying model.py (and the conda env pack script would not be found either). Point both lookups at model_server/triton, and add the .sh script to the package data: it is currently not included in the published sagemaker-serve wheel (1.24.0), so the path fix alone would not help installed users.
AkshayShah03
had a problem deploying
to
manual-approval
October 9, 2026 23:59 — with
GitHub Actions
Failure
AkshayShah03
had a problem deploying
to
manual-approval
October 9, 2026 23:59 — with
GitHub Actions
Failure
AkshayShah03
had a problem deploying
to
manual-approval
October 9, 2026 23:59 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available: N/A
Description of changes:
When the Triton build code moved from
model_server/triton/triton_builder.pyintomodel_builder_utils.py, twoPath(__file__).parentlookups weren't updated:Neither file exists in
sagemaker/serve/; both live insagemaker/serve/model_server/triton/. SoModelBuilder(model_server=ModelServer.TRITON, inference_spec=...)fails withFileNotFoundErrorwhen it copiesmodel.py, and the conda-env pack script isn't found either.Fixing the paths alone isn't enough.
pack_conda_env.shisn't in the publishedsagemaker-servewheel: 1.24.0 ships onlyschema/task.jsonas package data. This change also addsmodel_server/triton/*.shto[tool.setuptools.package-data].Testing:
test_prepare_for_triton_inference_spec_copies_triton_model_pyandtest_pack_conda_env_runs_triton_pack_scriptcheck that the resolved files exist. The existing tests mockshutil.copy2and_pack_conda_env, which hid this. Both new tests fail before this change.tests/unit/test_model_builder_utils_triton.py: 29 passed.uv build --wheel sagemaker-servenow containssagemaker/serve/model_server/triton/pack_conda_env.sh.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.