Skip to content

Commit 964d603

Browse files
committed
fix cherry pick
1 parent 6ebc93d commit 964d603

2 files changed

Lines changed: 66 additions & 17 deletions

File tree

opt/build/onnxruntime/Dockerfile.x64

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,36 @@ ARG OS=debian:buster
55
#----------------------------------------------------------------------------------------------
66
FROM ${OS}
77

8-
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
9-
ARG ONNXRUNTIME_VER=1.0.0
8+
ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime
9+
ARG ONNXRUNTIME_VER=1.6.0
10+
ARG ARCH=x64
1011

1112
RUN apt-get -qq update
12-
RUN apt-get -qq install -y curl wget tar git
13-
RUN apt-get -qq install -y build-essential cmake
14-
RUN apt-get -qq install -y libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev
15-
16-
RUN apt-get -qq install -y python3 python3-pip python3-dev
13+
RUN apt-get -qq install -y curl wget tar git \
14+
build-essential cmake \
15+
libcurl4-openssl-dev libssl-dev libatlas-base-dev zlib1g-dev \
16+
python3 python3-pip python3-dev python3-numpy
1717
RUN pip3 install --upgrade pip setuptools wheel
18-
# RUN pip3 install numpy
19-
RUN apt-get -q install -y python3-numpy
18+
19+
ENV LANG=en_US.UTF-8
20+
RUN apt-get install -y locales && \
21+
sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \
22+
dpkg-reconfigure --frontend=noninteractive locales && \
23+
update-locale LANG=$LANG
2024

2125
WORKDIR /build
2226

23-
ADD ./pack.sh /build/
24-
ARG BUILDTYPE=MinSizeRel
27+
ARG BUILDTYPE=RelWithDebInfo
28+
2529
ARG BUILDARGS="--config ${BUILDTYPE} --parallel"
2630

27-
RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} --recursive ${ONNXRUNTIME_REPO} onnxruntime
28-
29-
RUN cd onnxruntime ;\
30-
./build.sh ${BUILDARGS} --update --build ;\
31-
./build.sh ${BUILDARGS} --build_shared_lib
31+
RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} ${ONNXRUNTIME_REPO} onnxruntime
32+
WORKDIR /build/onnxruntime
33+
RUN git fetch --recurse-submodules -j4
34+
RUN ./build.sh ${BUILDARGS} --update --build
35+
RUN ./build.sh ${BUILDARGS} --build_shared_lib
3236
# RUN ./build.sh ${BUILDARGS} --enable_pybind --build_wheel
3337

34-
RUN ./pack.sh ${ONNXRUNTIME_VER}
38+
ADD ./pack.sh /build
39+
WORKDIR /build
40+
RUN ./pack.sh ${ONNXRUNTIME_VER} ${ARCH}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ARG OS=ubuntu18.04
2+
ARG CUDA_VER=11.0-cudnn8
3+
4+
FROM nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04
5+
6+
ARG ONNXRUNTIME_REPO=https://github.com/RedisAI/onnxruntime
7+
ARG ONNXRUNTIME_VER=1.6.0
8+
ARG ARCH=x64-gpu
9+
10+
RUN apt-get -qq update
11+
RUN apt-get -qq install -y curl \
12+
wget tar git build-essential \
13+
libcurl4-openssl-dev libssl-dev \
14+
libatlas-base-dev zlib1g-dev python3 python3-pip \
15+
python3-dev python3-numpy rsync
16+
17+
RUN pip3 install --upgrade pip setuptools wheel
18+
19+
RUN wget -q https://github.com/Kitware/CMake/releases/download/v3.19.5/cmake-3.19.5-Linux-x86_64.tar.gz -O /tmp/cmake.tgz
20+
WORKDIR /tmp
21+
RUN tar -xpf cmake.tgz
22+
RUN rsync -aqH cmake*/* /usr
23+
24+
25+
ENV LANG=en_US.UTF-8
26+
RUN apt-get install -y locales && \
27+
sed -i -e "s/# $LANG.*/$LANG UTF-8/" /etc/locale.gen && \
28+
dpkg-reconfigure --frontend=noninteractive locales && \
29+
update-locale LANG=$LANG
30+
31+
WORKDIR /build
32+
33+
ARG BUILDTYPE=MinSizeRel
34+
ARG BUILDARGS="--config ${BUILDTYPE} --parallel"
35+
36+
RUN git clone --single-branch --branch rel-${ONNXRUNTIME_VER} ${ONNXRUNTIME_REPO} onnxruntime
37+
WORKDIR /build/onnxruntime
38+
RUN git fetch --recurse-submodules -j4
39+
RUN ./build.sh ${BUILDARGS} --update --build --use_cuda --cudnn_home /usr/local/cuda --cuda_home /usr/local/cuda --build_shared_lib --parallel
40+
41+
ADD ./pack.sh /build/
42+
WORKDIR /build
43+
RUN /pack.sh ${ONNXRUNTIME_VER} ${ARCH}

0 commit comments

Comments
 (0)