Last active
January 13, 2019 05:45
-
-
Save waichee/0b8b9f0ce01c8c0114b1e7bc7a709b22 to your computer and use it in GitHub Desktop.
Code to Build Tensorflow Serving from source within a Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /work/ | |
# Clone the source from Github | |
cd /work/ && git clone — recurse-submodules https://github.com/tensorflow/serving | |
# Pin the version of Tensorflow Serving and its submodule | |
TENSOR_SERVING_COMMIT_HASH=85db9d3 | |
TENSORFLOW_COMMIT_HASH=dbe5e17 | |
cd /work/serving && git checkout $TENSOR_SERVING_COMMIT_HASH | |
cd /work/serving/tensorflow && git checkout $TENSORFLOW_COMMIT_HASH | |
cd /work/serving/tensorflow && ./configure | |
# Tensorflow Serving uses Bazel as the build tool. The Docker image already have Bazel installed in it. | |
# Run the following command to build the source with Bazel | |
cd /work/serving && bazel build -c opt //tensorflow_serving/model_servers:tensorflow_model_server --jobs 10 --curses no --discard_analysis_cache | |
# The following bazel option flags was added: | |
# -c (compilation_mode): the compilation mode flag affects the the C++ generation. ‘opt’ compilation mode is selected to enable optimization and disable the assert calls. | |
# — discard_analysis_cache: will discard the analysis cache immediately after the analysis phase completes. This reduces memory usage by ~10%, but makes further incremental builds slower. | |
# — jobs: The default number of jobs spawned by bazel is 200. Depending on the system configuration of your host, you might like to update this parameter. We tune ours to 10. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In line 5
— recurse-submodules
is wrong, it should be--recursive
😃