2022-11-11 05:11:06 +08:00
|
|
|
ARG BASE_IMG=ubuntu:22.04
|
2022-08-18 03:46:17 +08:00
|
|
|
FROM ${BASE_IMG} as dev-base
|
|
|
|
|
|
|
|
# Install basic packages
|
2022-11-11 05:11:06 +08:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
wget \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
python3-pip \
|
|
|
|
python3.10 \
|
|
|
|
python3.10-dev \
|
2022-08-18 03:46:17 +08:00
|
|
|
unzip
|
|
|
|
|
2022-11-11 05:11:06 +08:00
|
|
|
# Install clang
|
|
|
|
ARG REPO_NAME="deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
|
|
|
|
RUN echo $REPO_NAME >> /etc/apt/sources.list.d/llvm.list && \
|
|
|
|
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
clang
|
2022-08-18 03:46:17 +08:00
|
|
|
|
|
|
|
# Install bazel
|
2022-11-11 05:11:06 +08:00
|
|
|
ARG ARCH="x86_64"
|
|
|
|
ARG BAZEL_VERSION=5.2.0
|
2022-08-18 03:46:17 +08:00
|
|
|
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
|
|
|
|
|
2022-11-11 05:11:06 +08:00
|
|
|
# Install torch-mlir requirements
|
2022-08-18 03:46:17 +08:00
|
|
|
COPY requirements.txt /opt/app/requirements.txt
|
2023-01-07 10:41:43 +08:00
|
|
|
COPY build-requirements.txt /opt/app/build-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
|
2022-11-11 05:11:06 +08:00
|
|
|
RUN python3 -m pip install --upgrade pip
|
|
|
|
RUN python3 -m pip install --upgrade --ignore-installed -r requirements.txt
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
RUN apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2022-08-18 03:46:17 +08:00
|
|
|
|
2022-11-16 00:34:43 +08:00
|
|
|
WORKDIR /opt/src/torch-mlir/utils/bazel
|