summaryrefslogtreecommitdiff
path: root/patchnet-preprocessing
blob: d77360b68f61cfafd903e06400f43a56df27eebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
ENV PATH="/home/linaro/tooling:${PATH}"
RUN chmod 755 /home/linaro/tooling/*

RUN apt-get install -y parallel

# 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/