Skip to content

Commit 6352ea0

Browse files
committed
allow changing github org for individual backends
1 parent 2390b92 commit 6352ea0

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

build.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import os.path
3333
import pathlib
3434
import platform
35+
import re
3536
import stat
3637
import subprocess
3738
import sys
@@ -2045,14 +2046,14 @@ def tensorrtllm_postbuild(cmake_script, repo_install_dir, tensorrtllm_be_dir):
20452046
def backend_build(
20462047
be,
20472048
cmake_script,
2048-
tag,
2049+
tag_org,
20492050
build_dir,
20502051
install_dir,
2051-
github_organization,
20522052
images,
20532053
components,
20542054
library_paths,
20552055
):
2056+
tag, github_organization = tag_org
20562057
repo_build_dir = os.path.join(build_dir, be, "build")
20572058
repo_install_dir = os.path.join(build_dir, be, "install")
20582059

@@ -2110,11 +2111,11 @@ def backend_build(
21102111
def backend_clone(
21112112
be,
21122113
clone_script,
2113-
tag,
2114+
tag_org,
21142115
build_dir,
21152116
install_dir,
2116-
github_organization,
21172117
):
2118+
tag, github_organization = tag_org
21182119
clone_script.commentln(8)
21192120
clone_script.comment(f"'{be}' backend")
21202121
clone_script.comment("Delete this section to remove backend from build")
@@ -2654,7 +2655,7 @@ def enable_all():
26542655
"--backend",
26552656
action="append",
26562657
required=False,
2657-
help='Include specified backend in build as <backend-name>[:<repo-tag>]. If <repo-tag> starts with "pull/" then it refers to a pull-request reference, otherwise <repo-tag> indicates the git tag/branch to use for the build. If the version is non-development then the default <repo-tag> is the release branch matching the container version (e.g. version YY.MM -> branch rYY.MM); otherwise the default <repo-tag> is "main" (e.g. version YY.MMdev -> branch main).',
2658+
help='Include specified backend in build as <backend-name>[:<repo-tag>][:<org>]. If <repo-tag> starts with "pull/" then it refers to a pull-request reference, otherwise <repo-tag> indicates the git tag/branch to use for the build. If the version is non-development then the default <repo-tag> is the release branch matching the container version (e.g. version YY.MM -> branch rYY.MM); otherwise the default <repo-tag> is "main" (e.g. version YY.MMdev -> branch main). <org> allows using a forked repository instead of the default --github-organization value.',
26582659
)
26592660
parser.add_argument(
26602661
"--repo-tag",
@@ -2890,11 +2891,14 @@ def enable_all():
28902891
# Initialize map of backends to build and repo-tag for each.
28912892
backends = {}
28922893
for be in FLAGS.backend:
2893-
parts = be.split(":")
2894+
pattern = r"(https?:\/\/[^\s:]+)|:"
2895+
parts = list(filter(None,re.split(pattern, be)))
28942896
if len(parts) == 1:
28952897
parts.append(default_repo_tag)
2896-
log('backend "{}" at tag/branch "{}"'.format(parts[0], parts[1]))
2897-
backends[parts[0]] = parts[1]
2898+
if len(parts) == 2:
2899+
parts.append(FLAGS.github_organization)
2900+
log('backend "{}" at tag/branch "{}" from org "{}"'.format(parts[0], parts[1], parts[2]))
2901+
backends[parts[0]] = parts[1:]
28982902

28992903
if "vllm" in backends:
29002904
if "python" not in backends:
@@ -3105,7 +3109,6 @@ def enable_all():
31053109
backends[be],
31063110
script_build_dir,
31073111
script_install_dir,
3108-
github_organization,
31093112
)
31103113
else:
31113114
backend_build(
@@ -3114,7 +3117,6 @@ def enable_all():
31143117
backends[be],
31153118
script_build_dir,
31163119
script_install_dir,
3117-
github_organization,
31183120
images,
31193121
components,
31203122
library_paths,

0 commit comments

Comments
 (0)