Skip to content

Commit

Permalink
fix(build): install prebuilt ROCm ORT
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 23, 2023
1 parent b62c7d3 commit 5c026c4
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions api/Containerfile.rocm.ubuntu
Expand Up @@ -14,26 +14,17 @@ ENV PATH="/onnx-web/api/onnx_env/bin:$PATH"

RUN pip3 install pip --upgrade

# build custom ORT, from https://github.com/microsoft/onnxruntime/blob/v1.13.1/dockerfiles/Dockerfile.rocm
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=main
COPY requirements.txt /onnx-web/api/requirements.txt

WORKDIR /code
RUN pip3 install -r requirements.txt --no-cache-dir

ENV PATH /opt/miniconda/bin:/code/cmake-3.24.3-linux-x86_64/bin:${PATH}
WORKDIR /ort

# Prepare onnxruntime repository & build onnxruntime
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime &&\
/bin/sh onnxruntime/dockerfiles/scripts/install_common_deps.sh &&\
cd onnxruntime &&\
/bin/sh ./build.sh --config Release --build_wheel --update --build --parallel --cmake_extra_defines\
ONNXRUNTIME_VERSION=$(cat ./VERSION_NUMBER) --use_rocm --rocm_home=/opt/rocm &&\
pip install /code/onnxruntime/build/Linux/Release/dist/*.whl &&\
cd ..
RUN wget https://download.onnxruntime.ai/onnxruntime_training-1.14.0.dev20230123001%2Brocm54-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

COPY requirements.txt /onnx-web/api/requirements.txt
RUN pip3 install /ort/*.whl --ignore-installed

RUN pip3 install -r requirements.txt --no-cache-dir
WORKDIR /onnx-web/api

COPY onnx_web/ /onnx-web/api/onnx_web/

Expand Down

0 comments on commit 5c026c4

Please sign in to comment.