Skip to content

Conversation

kpedro88
Copy link
Contributor

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.

  1. Add flag --no-container-cache, which propagates to docker --no-cache.
  2. Add flag --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.
  3. Add flag --use-buildbase to use the temporary "buildbase" image as the "base" image for backends that need it (e.g. onnxruntime).
  4. Extend --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

  • I have read the Contribution guidelines and signed the Contributor License
    Agreement
  • PR title reflects the change and is of format <commit_type>: <Title>
  • Changes are described in the pull request.
  • Related issues are referenced.
  • Populated github labels field
  • Added test plan and verified test passes.
  • Verified that the PR passes existing CI.
  • I ran pre-commit locally (pre-commit install, pre-commit run --all)
  • Verified copyright is correct on all changed files.
  • Added succinct git squash message before merging ref.
  • All template sections are filled out.
  • Optional: Additional screenshots for behavior/output changes with before/after.

Commit Type:

Check the conventional commit type
box here and add the label to the github PR.

  • build
  • ci
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

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):

./build.py --target-platform linux -j 24 -v --enable-all --dryrun
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:

./build.py --target-platform linux -j 24 -v --enable-all --backend onnxruntime:r25.08_kjp:https://github.com/kpedro88 --default-repo-tag r25.08 --use-buildbase --dryrun
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant