Skip to content

Commit 9309f7f

Browse files
committed
Install py3.10
1 parent f519a12 commit 9309f7f

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

build.py

Lines changed: 31 additions & 3 deletions
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.10.13", # Python version
8182
)
8283
}
8384

@@ -908,7 +909,7 @@ def install_dcgm_libraries(dcgm_version, target_machine):
908909
)
909910

910911

911-
def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
912+
def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap, backends):
912913
df = """
913914
ARG TRITON_VERSION={}
914915
ARG TRITON_CONTAINER_VERSION={}
@@ -988,6 +989,19 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
988989
# && apt-get update -q=2 \\
989990
# && apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7*
990991
"""
992+
if "python" in backends:
993+
df += """
994+
# python3.10 is not available through yum for RHEL8. It must instead must be installed via pyenv.
995+
# Only copy out libpython3.1* so as to not overwrite the general libpython3.so lib.
996+
RUN curl https://pyenv.run | bash \\
997+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \\
998+
&& echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \\
999+
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc
1000+
RUN CONFIGURE_OPTS=\"--with-openssl=/usr/lib64\" && pyenv install {} \\
1001+
&& cp /root/.pyenv/versions/{}/lib/libpython3.1* /usr/lib64/""".format(
1002+
TRITON_VERSION_MAP[FLAGS.version][7], TRITON_VERSION_MAP[FLAGS.version][7]
1003+
)
1004+
9911005
if FLAGS.enable_gpu:
9921006
df += install_dcgm_libraries(argmap["DCGM_VERSION"], target_machine())
9931007
df += """
@@ -1390,12 +1404,26 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
13901404
# Add dependencies needed for python backend
13911405
if "python" in backends:
13921406
if target_platform() == "rhel":
1407+
df += """
1408+
# python3.10 is not available through yum for RHEL8. It must instead must be installed via pyenv.
1409+
# Only copy out libpython3.1* so as to not overwrite the general libpython3.so lib.
1410+
RUN curl https://pyenv.run | bash \\
1411+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \\
1412+
&& echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \\
1413+
&& echo 'eval "$(pyenv init -)"' >> ~/.bashrc
1414+
RUN CONFIGURE_OPTS=\"--with-openssl=/usr/lib64\" && pyenv install {} \\
1415+
&& cp /root/.pyenv/versions/{}/lib/libpython3.1* /usr/lib64/""".format(
1416+
TRITON_VERSION_MAP[FLAGS.version][7],
1417+
TRITON_VERSION_MAP[FLAGS.version][7],
1418+
)
1419+
13931420
df += """
13941421
# python3, python3-pip and some pip installs required for the python backend
13951422
RUN yum install -y \\
13961423
libarchive-devel \\
1397-
python3-devel \\
13981424
python3-pip \\
1425+
openssl-devel \\
1426+
readline-devel
13991427
&& pip3 install --upgrade pip \\
14001428
&& pip3 install --upgrade \\
14011429
wheel \\
@@ -1621,7 +1649,7 @@ def create_build_dockerfiles(
16211649

16221650
if target_platform() == "rhel":
16231651
create_dockerfile_buildbase_rhel(
1624-
FLAGS.build_dir, "Dockerfile.buildbase", dockerfileargmap
1652+
FLAGS.build_dir, "Dockerfile.buildbase", dockerfileargmap, backends
16251653
)
16261654
else:
16271655
create_dockerfile_buildbase(

0 commit comments

Comments
 (0)