Skip to content

Commit fb54e5d

Browse files
Add development mode dockerfile and info on use (#78)
1 parent 9356ed0 commit fb54e5d

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

experimental/docker/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# MLGO Development Dockerfiles
2+
3+
This folder contains dockerfiles with all the dependencies necessary to do
4+
development work with MLGO. Note that these dockerfiles do not contain a
5+
clone of LLVM, only system dependencies, python dependencies, and the current
6+
repository. You are expected to clone LLVM and configure the build yourself.
7+
To see how to do this, the [inliner demo](../docs/demo/demo.md) should have
8+
some useful guidance.
9+
10+
### Building the image
11+
12+
To build the image, make sure that you are in the root of the ml-compiler-opt
13+
repository and then run:
14+
```bash
15+
docker build -t <your tag here> -f ./docker/development.Dockerfile .
16+
```
17+
18+
### Disclaimers
19+
20+
**WARNING**: These development dockerfiles are not guaranteed to work. We will
21+
do a best effort to make sure these dockerfiles are working, but they might stop
22+
working at any point in time and should absolutely not be used in production
23+
environments.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# TODO(boomanaiden154): Refactor to 22.04 and remove custom PPAs once we aren't
2+
# dependent upon a specific tensorflow version and thus a specific python version
3+
# (once TFLite patch lands)
4+
FROM ubuntu:20.04
5+
RUN apt-get update
6+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
7+
python3-distutils \
8+
python-is-python3 \
9+
python3 \
10+
python3-pip \
11+
tmux \
12+
g++ \
13+
ccache \
14+
binutils-gold \
15+
binutils-dev \
16+
ninja-build \
17+
pkg-config \
18+
gcc-multilib \
19+
g++-multilib \
20+
gawk \
21+
dos2unix \
22+
libxml2-dev \
23+
rsync \
24+
git \
25+
libtool \
26+
m4 \
27+
automake \
28+
libgcrypt-dev \
29+
liblzma-dev \
30+
libssl-dev \
31+
libgss-dev \
32+
python3-dev \
33+
wget \
34+
zlib1g-dev \
35+
tcl-dev \
36+
libpfm4-dev \
37+
software-properties-common
38+
RUN wget --quiet https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz && \
39+
mkdir /tmp/tensorflow && \
40+
tar xfz libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz -C /tmp/tensorflow
41+
# install latest cmake rather than the one in the 20.04 repos as that version
42+
# doesn't support some cmake options used by MLGO
43+
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
44+
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
45+
apt-get update && \
46+
apt-get install -y cmake
47+
# install latest git rather than 20.04 default due to that git version
48+
# having some issues with projects commonly used by MLGO such as chromium
49+
RUN apt-add-repository ppa:git-core/ppa && \
50+
apt-get update && \
51+
apt-get install -y git vim
52+
COPY . /ml-compiler-opt
53+
RUN python3 -m pip install -r /ml-compiler-opt/requirements-dev.txt

0 commit comments

Comments
 (0)