Skip to content

Commit

Permalink
build: RHEL8 PyTorch Backend (#266)
Browse files Browse the repository at this point in the history
* Support RHEL builds
  • Loading branch information
fpetrini15 authored Aug 27, 2024
1 parent a0cd50d commit c5c0cc8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tools/gen_ort_dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,37 @@ def dockerfile_for_linux(output_file):
# The Onnx Runtime dockerfile is the collection of steps in
# https://github.com/microsoft/onnxruntime/tree/master/dockerfiles
"""
# Consider moving rhel logic to its own function e.g., dockerfile_for_rhel
# if the changes become more substantial.
if target_platform() == "rhel":
df += """
# The manylinux container defaults to Python 3.7, but some feature installation
# requires a higher version.
ARG PYVER=3.10
ENV PYTHONPATH=/opt/python/v
RUN ln -sf /opt/python/cp${PYVER/./}* ${PYTHONPATH}
ENV PYBIN=${PYTHONPATH}/bin
ENV PYTHON_BIN_PATH=${PYBIN}/python${PYVER} \
PATH=${PYBIN}:${PATH}
RUN yum install -y \
wget \
zip \
ca-certificates \
curl \
patchelf \
python3-pip \
git \
gnupg \
gnupg1 \
openssl-devel
"""
else:
df += """
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
wget \
Expand Down

0 comments on commit c5c0cc8

Please sign in to comment.