Skip to content

Commit ec9bb86

Browse files
committed
Python3.12
1 parent 6f7605d commit ec9bb86

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

build.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"2024.0.0", # Standalone OpenVINO
7979
"3.2.6", # DCGM version
8080
"0.5.3.post1", # vLLM version
81+
"3.12", # RHEL Python version
8182
)
8283
}
8384

@@ -925,6 +926,7 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
925926
ARG TRITON_VERSION
926927
ARG TRITON_CONTAINER_VERSION
927928
"""
929+
df += change_default_python_version_rhel(TRITON_VERSION_MAP[FLAGS.version][7])
928930
df += """
929931
# Install docker docker buildx
930932
RUN yum install -y ca-certificates curl gnupg yum-utils \\
@@ -1390,14 +1392,17 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
13901392
# Add dependencies needed for python backend
13911393
if "python" in backends:
13921394
if target_platform() == "rhel":
1395+
df += change_default_python_version_rhel(
1396+
TRITON_VERSION_MAP[FLAGS.version][7]
1397+
)
13931398
df += """
13941399
# python3, python3-pip and some pip installs required for the python backend
13951400
RUN yum install -y \\
13961401
python3.12-devel \\
13971402
libarchive-devel \\
13981403
python3-pip \\
13991404
openssl-devel \\
1400-
readline-devel
1405+
readline-devel \\
14011406
&& pip3 install --upgrade pip \\
14021407
&& pip3 install --upgrade \\
14031408
wheel \\
@@ -1531,6 +1536,23 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine):
15311536
return df
15321537

15331538

1539+
def change_default_python_version_rhel(version):
1540+
df = """
1541+
# RHEL image has several python versions. It's important
1542+
# to set the correct version, otherwise, packages that are
1543+
# pip installed will not be found during testing.
1544+
ENV PYVER {}
1545+
ENV PYTHONPATH /opt/python/v
1546+
RUN ln -sf /opt/python/cp${{PYVER/./}}* ${{PYTHONPATH}}
1547+
ENV PYBIN ${{PYTHONPATH}}/bin
1548+
ENV PYTHON_BIN_PATH ${{PYBIN}}/python${{PYVER}}
1549+
ENV PATH ${{PYBIN}}:${{PATH}}
1550+
""".format(
1551+
version
1552+
)
1553+
return df
1554+
1555+
15341556
def create_dockerfile_windows(
15351557
ddir, dockerfile_name, argmap, backends, repoagents, caches
15361558
):

0 commit comments

Comments
 (0)