Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrini15 committed Oct 29, 2024
1 parent f0b04db commit 2e8d033
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"2024.0.0", # Standalone OpenVINO
"3.2.6", # DCGM version
"0.5.3.post1", # vLLM version
"3.12.1", # RHEL Python version
"3.12.3", # RHEL Python version
)
}

Expand Down Expand Up @@ -1541,32 +1541,31 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine):


def change_default_python_version_rhel(version):
# Example version 3.12.1 --> 3.12
major_minor_version = ".".join(version.split(".")[:2])
df = """
# The python library version available for install via 'yum install python3.X-devel' does not
# match the version of python inside the RHEL base container. This means that python packages
# installed within the container will not be picked up by the python backend stub process pybind
# bindings. It must instead must be installed via pyenv.
ENV PYENV_ROOT=/tmp/pyenv_build
RUN curl https://pyenv.run | bash
ENV PATH="${{PYENV_ROOT}}/bin:$PATH"
RUN eval "$(pyenv init -)"
RUN CONFIGURE_OPTS=\"--with-openssl=/usr/lib64\" && pyenv install {} \\
&& cp ${{PYENV_ROOT}}/versions/{}/lib/libpython3* /usr/lib64/""".format(
version, version
)
df += """
# RHEL image has several python versions. It's important
# to set the correct version, otherwise, packages that are
# pip installed will not be found during testing.
ENV PYVER {}
ENV PYTHONPATH /opt/python/v
RUN ln -sf /opt/python/cp${{PYVER/./}}* ${{PYTHONPATH}}
RUN ln -sf ${{PYENV_ROOT}}/versions/${{PYVER}}* ${{PYTHONPATH}}
ENV PYBIN ${{PYTHONPATH}}/bin
ENV PYTHON_BIN_PATH ${{PYBIN}}/python${{PYVER}}
ENV PATH ${{PYBIN}}:${{PATH}}
""".format(
major_minor_version
)
df += """
# The python library version available for install via 'yum install python3.X-devel' does not
# match the version of python inside the RHEL base container. This means that python packages
# installed within the container will not be picked up by the python backend stub process pybind
# bindings. It must instead must be installed via pyenv.
RUN curl https://pyenv.run | bash
ENV PATH="/root/.pyenv/bin:$PATH"
RUN eval "$(pyenv init -)"
RUN CONFIGURE_OPTS=\"--with-openssl=/usr/lib64\" && pyenv install {} \\
&& cp /root/.pyenv/versions/{}/lib/libpython3* /usr/lib64/""".format(
version, version
version
)
return df

Expand Down

0 comments on commit 2e8d033

Please sign in to comment.