feat: Minor improvements to build.py #8362
Open
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.
What does the PR do?
This PR adds three new flags and updates one flag in
build.py
. These changes all go toward increasing build flexibility.--no-container-cache
, which propagates todocker --no-cache
.--default-repo-tag <tag>
to override the calculated default value, which is not always appropriate. For example, when trying to build a dev version (currently 25.08), the upstream container version is set to the previous version (25.07), which takes precedence in the calculated default value, but using the corresponding dev versions of component and backend repositories may be intended. Rather than having to override it for each repo, it is useful to be able to override it globally.--use-buildbase
to use the temporary "buildbase" image as the "base" image for backends that need it (e.g. onnxruntime).--backend
syntax to<backend-name>[:<repo-tag>][:<org>]
to allow specifying a different organization/repository, in addition to a different tag/branch. This is useful for external contributors developing in forks.Checklist
Agreement
<commit_type>: <Title>
pre-commit install, pre-commit run --all
)Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
N/A
Where should the reviewer start?
Changes only affect build.py and associated documentation.
Test plan:
These changes only affect the build script, so there is no impact on server functionality.
An example of using some of these options:
in branch
r25.08
(without these changes):output:
Building Triton Inference Server
platform linux
machine x86_64
version 2.60.0dev
build dir /storage/local/data2/pedrok/sonic/server/build
install dir None
cmake dir None
default repo-tag: r25.07
container version 25.08dev
upstream container version 25.07
endpoint "http"
endpoint "grpc"
endpoint "sagemaker"
endpoint "vertex-ai"
filesystem "gcs"
filesystem "s3"
filesystem "azure_storage"
backend "ensemble" at tag/branch "r25.07"
backend "identity" at tag/branch "r25.07"
backend "square" at tag/branch "r25.07"
backend "repeat" at tag/branch "r25.07"
backend "onnxruntime" at tag/branch "r25.07"
backend "python" at tag/branch "r25.07"
backend "dali" at tag/branch "r25.07"
backend "pytorch" at tag/branch "r25.07"
backend "openvino" at tag/branch "r25.07"
backend "fil" at tag/branch "r25.07"
backend "tensorrt" at tag/branch "r25.07"
repoagent "checksum" at tag/branch "r25.07"
cache "local" at tag/branch "r25.07"
cache "redis" at tag/branch "r25.07"
component "common" at tag/branch "r25.07"
component "core" at tag/branch "r25.07"
component "backend" at tag/branch "r25.07"
component "thirdparty" at tag/branch "r25.07"
After merging this branch into
r25.08
, the following is possible:output:
Building Triton Inference Server
platform linux
machine x86_64
version 2.60.0dev
build dir /storage/local/data2/pedrok/sonic/server/build
install dir None
cmake dir None
default repo-tag: r25.08
container version 25.08dev
upstream container version 25.07
endpoint "http"
endpoint "grpc"
endpoint "sagemaker"
endpoint "vertex-ai"
filesystem "gcs"
filesystem "s3"
filesystem "azure_storage"
backend "onnxruntime" at tag/branch "r25.08_kjp" from org "https://github.com/kpedro88"
backend "ensemble" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "identity" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "square" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "repeat" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "python" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "dali" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "pytorch" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "openvino" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "fil" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
backend "tensorrt" at tag/branch "r25.08" from org "https://github.com/triton-inference-server"
repoagent "checksum" at tag/branch "r25.08"
cache "local" at tag/branch "r25.08"
cache "redis" at tag/branch "r25.08"
component "common" at tag/branch "r25.08"
component "core" at tag/branch "r25.08"
component "backend" at tag/branch "r25.08"
component "thirdparty" at tag/branch "r25.08"
Caveats:
The syntax for changing the backend org could be more elegant, and the feature is not extended to other components besides backends. I am planning a more thorough improvement to
build.py
that will address this in a followup PR, but it will be a more involved change and is still in progress.Background
These changes were useful in building a
25.08dev
server to incorporate #8335, which includes an important bug fix and is not yet in a released version.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
N/A