Skip to content

Commit

Permalink
Tensor Bridge v 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitali.zhelezniak committed Aug 16, 2017
1 parent 62fc9e0 commit 5fe1eee
Show file tree
Hide file tree
Showing 24 changed files with 1,922 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
.gitignore
client
README.md
152 changes: 152 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject


### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties


### macOS template
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
94 changes: 94 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
libfreetype6-dev \
libpng12-dev \
libzmq3-dev \
mlocate \
pkg-config \
python-dev \
python-numpy \
python-pip \
software-properties-common \
swig \
zip \
zlib1g-dev \
libcurl3-dev \
openjdk-8-jdk\
openjdk-8-jre-headless \
wget \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set up grpc

RUN pip install mock grpcio

# Set up Bazel.

ENV BAZELRC /root/.bazelrc
# Install the most recent bazel release.
ENV BAZEL_VERSION 0.5.1
WORKDIR /
RUN mkdir /bazel && \
cd /bazel && \
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
curl -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
chmod +x bazel-*.sh && \
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
cd / && \
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh


# get tensorflow_serving source
ENV TF_SERVING_VERSION 1.0.0
RUN cd /opt && \
git clone -b $TF_SERVING_VERSION --recurse-submodules https://github.com/tensorflow/serving

# set environment for tensorflow configure script
ENV PYTHON_BIN_PATH=/usr/bin/python

ENV USE_DEFAULT_PYTHON_LIB_PATH=1

# don't use Intel MKL
ENV TF_NEED_MKL=0
# use native CPU optimizations
ENV CC_OPT_FLAGS=-march=native
# use jemalloc
ENV TF_NEED_JEMALLOC=1
# don't use Google Cloud Platform
ENV TF_NEED_GCP=0
# don't use Hadoop HDFS
ENV TF_NEED_HDFS=0
# don't use XLA JIT
ENV TF_ENABLE_XLA=0
# don't use VERBS-RDMA
ENV TF_NEED_VERBS=0
# don't use OpenCL
ENV TF_NEED_OPENCL=0
# don't use CUDA
ENV TF_NEED_CUDA=0


# configure tensorflow and compile tensorflow-serving
RUN cd /opt/serving/tensorflow && \
./configure && \
cd /opt/serving && \
bazel build //tensorflow_serving/model_servers:tensorflow_model_server && \
cp bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin && \
rm -rf /opt/serving && rm -rf $HOME/.cache

COPY requirements.txt /opt/tensor-bridge/
RUN pip install -U pip setuptools
RUN pip install -r /opt/tensor-bridge/requirements.txt
ADD . /opt/tensor-bridge

WORKDIR /opt/tensor-bridge/

EXPOSE 9000 9001

CMD ["bash", "bridge.sh"]
Loading

0 comments on commit 5fe1eee

Please sign in to comment.