Skip to content

Commit d145aea

Browse files
committed
Set rt_base image as local variable for create_dockerfile_* function
1 parent 571a6d7 commit d145aea

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

build.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,8 +1220,13 @@ def create_dockerfile_cibase(ddir, dockerfile_name, argmap):
12201220

12211221

12221222
def create_dockerfile_linux(
1223-
ddir, dockerfile_name, argmap, backends, repoagents, caches, endpoints
1223+
ddir, dockerfile_name, argmap, backends, repoagents, caches, endpoints, rt_base_image=None
12241224
):
1225+
base_image = argmap["BASE_IMAGE"]
1226+
#If runtime base image is provided, use it as the base image
1227+
if rt_base_image:
1228+
base_image = rt_base_image
1229+
12251230
df = """
12261231
ARG TRITON_VERSION={}
12271232
ARG TRITON_CONTAINER_VERSION={}
@@ -1230,7 +1235,7 @@ def create_dockerfile_linux(
12301235
""".format(
12311236
argmap["TRITON_VERSION"],
12321237
argmap["TRITON_CONTAINER_VERSION"],
1233-
argmap["BASE_IMAGE"],
1238+
base_image,
12341239
)
12351240

12361241
# PyTorch and TensorFlow backends need extra CUDA and other
@@ -1642,8 +1647,13 @@ def change_default_python_version_rhel(version):
16421647

16431648

16441649
def create_dockerfile_windows(
1645-
ddir, dockerfile_name, argmap, backends, repoagents, caches
1650+
ddir, dockerfile_name, argmap, backends, repoagents, caches, rt_base_image=None
16461651
):
1652+
base_image = argmap["BASE_IMAGE"]
1653+
#If runtime base image is provided, use it as the base image
1654+
if rt_base_image:
1655+
base_image = rt_base_image
1656+
16471657
df = """
16481658
ARG TRITON_VERSION={}
16491659
ARG TRITON_CONTAINER_VERSION={}
@@ -1666,7 +1676,7 @@ def create_dockerfile_windows(
16661676
""".format(
16671677
argmap["TRITON_VERSION"],
16681678
argmap["TRITON_CONTAINER_VERSION"],
1669-
argmap["BASE_IMAGE"],
1679+
base_image,
16701680
)
16711681
df += """
16721682
WORKDIR /opt
@@ -1744,9 +1754,6 @@ def create_build_dockerfiles(
17441754
FLAGS.build_dir, "Dockerfile.buildbase", dockerfileargmap
17451755
)
17461756

1747-
#Update dockerfileargmap if rt_base image is provided
1748-
if "rt_base" in images:
1749-
dockerfileargmap["BASE_IMAGE"] = images["rt_base"]
17501757

17511758

17521759
if target_platform() == "windows":
@@ -1757,6 +1764,7 @@ def create_build_dockerfiles(
17571764
backends,
17581765
repoagents,
17591766
caches,
1767+
images.get("rt_base"),
17601768
)
17611769
else:
17621770
create_dockerfile_linux(
@@ -1767,6 +1775,7 @@ def create_build_dockerfiles(
17671775
repoagents,
17681776
caches,
17691777
endpoints,
1778+
images.get("rt_base")
17701779
)
17711780

17721781
# Dockerfile used for the creating the CI base image.

0 commit comments

Comments
 (0)