Skip to content

Commit 7d30a01

Browse files
Ivan Bogatyycalberti
Ivan Bogatyy
authored andcommitted
Release DRAGNN (tensorflow#1177)
* Release DRAGNN * Update CoNLL evaluation table & evaluator.py
1 parent c774cc9 commit 7d30a01

File tree

298 files changed

+515667
-779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+515667
-779
lines changed

syntaxnet/.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
bazel/
3+
Dockerfile*
4+
tensorflow/.git

syntaxnet/Dockerfile

+79-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,91 @@
1+
# Java baseimage, for Bazel.
12
FROM java:8
23

34
ENV SYNTAXNETDIR=/opt/tensorflow PATH=$PATH:/root/bin
45

6+
# Install system packages. This doesn't include everything the TensorFlow
7+
# dockerfile specifies, so if anything goes awry, maybe install more packages
8+
# from there. Also, running apt-get clean before further commands will make the
9+
# Docker images smaller.
510
RUN mkdir -p $SYNTAXNETDIR \
611
&& cd $SYNTAXNETDIR \
712
&& apt-get update \
8-
&& apt-get install git zlib1g-dev file swig python2.7 python-dev python-pip python-mock -y \
9-
&& pip install --upgrade pip \
10-
&& pip install -U protobuf==3.0.0b2 \
11-
&& pip install asciitree \
12-
&& pip install numpy \
13-
&& wget https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh \
13+
&& apt-get install -y \
14+
file \
15+
git \
16+
graphviz \
17+
libcurl3-dev \
18+
libfreetype6-dev \
19+
libgraphviz-dev \
20+
liblapack-dev \
21+
libopenblas-dev \
22+
libpng12-dev \
23+
libxft-dev \
24+
python-dev \
25+
python-mock \
26+
python-pip \
27+
python2.7 \
28+
swig \
29+
vim \
30+
zlib1g-dev \
31+
&& apt-get clean \
32+
&& (rm -f /var/cache/apt/archives/*.deb \
33+
/var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true)
34+
35+
# Install common Python dependencies. Similar to above, remove caches
36+
# afterwards to help keep Docker images smaller.
37+
RUN pip install --ignore-installed pip \
38+
&& python -m pip install numpy \
39+
&& rm -rf /root/.cache/pip /tmp/pip*
40+
RUN python -m pip install \
41+
asciitree \
42+
ipykernel \
43+
jupyter \
44+
matplotlib \
45+
pandas \
46+
protobuf \
47+
scipy \
48+
sklearn \
49+
&& python -m ipykernel.kernelspec \
50+
&& python -m pip install pygraphviz \
51+
--install-option="--include-path=/usr/include/graphviz" \
52+
--install-option="--library-path=/usr/lib/graphviz/" \
53+
&& rm -rf /root/.cache/pip /tmp/pip*
54+
55+
# Installs the latest version of Bazel.
56+
RUN wget --quiet https://github.com/bazelbuild/bazel/releases/download/0.4.3/bazel-0.4.3-installer-linux-x86_64.sh \
1457
&& chmod +x bazel-0.4.3-installer-linux-x86_64.sh \
15-
&& ./bazel-0.4.3-installer-linux-x86_64.sh --user \
16-
&& git clone --recursive https://github.com/tensorflow/models.git \
17-
&& cd $SYNTAXNETDIR/models/syntaxnet/tensorflow \
18-
&& echo -e "\n\n\n\n\n\n\n\n\n" | ./configure \
19-
&& apt-get autoremove -y \
20-
&& apt-get clean
58+
&& ./bazel-0.4.3-installer-linux-x86_64.sh \
59+
&& rm ./bazel-0.4.3-installer-linux-x86_64.sh
60+
61+
COPY WORKSPACE $SYNTAXNETDIR/syntaxnet/WORKSPACE
62+
COPY tools/bazel.rc $SYNTAXNETDIR/syntaxnet/tools/bazel.rc
63+
COPY tensorflow $SYNTAXNETDIR/syntaxnet/tensorflow
64+
65+
# Compile common TensorFlow targets, which don't depend on DRAGNN / SyntaxNet
66+
# source. This makes it more convenient to re-compile DRAGNN / SyntaxNet for
67+
# development (though not as convenient as the docker-devel scripts).
68+
RUN cd $SYNTAXNETDIR/syntaxnet/tensorflow \
69+
&& tensorflow/tools/ci_build/builds/configured CPU \
70+
&& cd $SYNTAXNETDIR/syntaxnet \
71+
&& bazel build -c opt @org_tensorflow//tensorflow:tensorflow_py
2172

22-
RUN cd $SYNTAXNETDIR/models/syntaxnet \
23-
&& bazel test --genrule_strategy=standalone syntaxnet/... util/utf8/...
73+
# Build the codez.
74+
WORKDIR $SYNTAXNETDIR/syntaxnet
75+
COPY dragnn $SYNTAXNETDIR/syntaxnet/dragnn
76+
COPY syntaxnet $SYNTAXNETDIR/syntaxnet/syntaxnet
77+
COPY third_party $SYNTAXNETDIR/syntaxnet/third_party
78+
COPY util/utf8 $SYNTAXNETDIR/syntaxnet/util/utf8
79+
RUN bazel build -c opt //dragnn/python:all //dragnn/tools:all
2480

25-
WORKDIR $SYNTAXNETDIR/models/syntaxnet
81+
# This makes the IP exposed actually "*"; we'll do host restrictions by passing
82+
# a hostname to the `docker run` command.
83+
COPY tensorflow/tensorflow/tools/docker/jupyter_notebook_config.py /root/.jupyter/
84+
EXPOSE 8888
2685

27-
CMD [ "sh", "-c", "echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh" ]
86+
# This does not need to be compiled, only copied.
87+
COPY examples $SYNTAXNETDIR/syntaxnet/examples
88+
# Todo: Move this earlier in the file (don't want to invalidate caches for now).
89+
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
2890

29-
# COMMANDS to build and run
30-
# ===============================
31-
# mkdir build && cp Dockerfile build/ && cd build
32-
# docker build -t syntaxnet .
33-
# docker run syntaxnet
91+
CMD /bin/bash -c "bazel-bin/dragnn/tools/oss_notebook_launcher notebook --debug --notebook-dir=/opt/tensorflow/syntaxnet/examples"

0 commit comments

Comments
 (0)