2022-08-18 03:46:17 +08:00
|
|
|
ARG BASE_IMG=ubuntu:18.04
|
|
|
|
FROM ${BASE_IMG} as dev-base
|
|
|
|
|
|
|
|
ARG ARCH="x86_64"
|
|
|
|
ARG BAZEL_VERSION=5.2.0
|
|
|
|
|
|
|
|
# Install basic packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
clang-10 \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
python3-pip \
|
|
|
|
python3.8 \
|
|
|
|
python3.8-dev \
|
|
|
|
wget \
|
|
|
|
unzip
|
|
|
|
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 10
|
|
|
|
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10
|
|
|
|
|
|
|
|
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 10
|
|
|
|
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 10
|
|
|
|
|
|
|
|
# Install bazel
|
|
|
|
RUN wget -q https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-${ARCH} -O /usr/bin/bazel \
|
|
|
|
&& chmod a+x /usr/bin/bazel
|
|
|
|
|
|
|
|
COPY requirements.txt /opt/app/requirements.txt
|
2022-09-30 07:30:31 +08:00
|
|
|
COPY pytorch-requirements.txt /opt/app/pytorch-requirements.txt
|
2022-08-18 03:46:17 +08:00
|
|
|
WORKDIR /opt/app
|
|
|
|
RUN python -m pip install --upgrade pip
|
2022-09-30 07:30:31 +08:00
|
|
|
RUN python -m pip install --upgrade --ignore-installed -r requirements.txt
|
2022-08-18 03:46:17 +08:00
|
|
|
|
|
|
|
WORKDIR /opt/src/torch-mlir
|