summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2021-02-08 14:07:41 -0700
committerMathieu Poirier <mathieu.poirier@linaro.org>2021-02-08 14:07:41 -0700
commit717cf0971f62911a49127d9ae8074cb6a7cfd0e4 (patch)
tree7d536a9d6466713f04ca356f2c7ade180b9aee35
parent722d2adad8a50846e1e0151f2c52795b778821a0 (diff)
Initial image to support preprocessing and deeplearning
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--patchnet82
1 files changed, 82 insertions, 0 deletions
diff --git a/patchnet b/patchnet
new file mode 100644
index 0000000..32ff4c4
--- /dev/null
+++ b/patchnet
@@ -0,0 +1,82 @@
+FROM tensorflow/tensorflow:latest-gpu
+
+RUN apt-get update
+
+RUN mkdir -p /home/linaro
+WORKDIR /home/linaro
+
+# Install git
+RUN apt-get install -y git
+
+# Install python 3.8
+RUN add-apt-repository -y ppa:deadsnakes/ppa
+RUN apt-get install -y python3.8
+RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 0
+RUN update-alternatives --set python3 /usr/bin/python3.8
+
+# Upgrade pip
+RUN python -m pip install --user --upgrade pip
+
+# Install python compatibility library
+RUN pip install six
+
+#
+# Preprocessing dependencies
+#
+RUN pip install nltk
+RUN apt-get install -y python3-enchant
+
+# Install opam
+RUN apt-get install -y opam
+RUN opam init -y
+
+# Install autogen
+RUN apt-get install -y automake
+
+# Install coccinelle 1.0.8
+RUN git clone --branch 1.0.8 https://github.com/coccinelle/coccinelle.git
+WORKDIR /home/linaro/coccinelle
+RUN ./autogen
+RUN ./configure
+RUN make
+RUN make install
+
+WORKDIR /home/linaro/
+
+# Download stopwords from natural language toolkit
+RUN python -c "import nltk; nltk.download('stopwords')"
+
+# Install parmap
+RUN apt-get install -y libparmap-ocaml-dev
+
+# Install tools to build training sets
+RUN git clone https://git.linaro.org/people/mathieu.poirier/tooling.git
+RUN export PATH=$PATH:/home/linaro/tooling
+RUN chmod 755 /home/linaro/tooling/*
+
+RUN apt-get install -y parallel
+
+#
+# Deeplearning dependencies
+#
+
+# Install tqdm
+RUN pip install tqdm
+
+# Install skikit-learn
+RUN pip install scikit-learn
+
+# Install torch
+#
+# Use the grid on this site to costumise this line: https://pytorch.org/get-started/locally/
+RUN pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
+
+#
+# Install the PatchNet model
+#
+RUN git clone https://github.com/Xin-Zhou-smu/PatchNet.git
+WORKDIR /home/linaro/PatchNet/preprocessing
+RUN make
+WORKDIR /home/linaro/
+
+