Skip to content

Explain how to download tf binaries from PyPI #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,32 @@ Dockerfile.
#. Copy your Python package to “final” Dockerfile directory that you are building.
cp dist/sagemaker_tensorflow_container-<package_version>.tar.gz docker/<tensorflow_version>/final/py2

If you want to build "final" Docker images, then use:
If you want to build "final" Docker images, for versions 1.6 and above, you will first need to download the appropriate tensorflow pip wheel, then pass in its location as a build argument. These can be obtained from pypi. For example, the files for 1.6.0 are here:

https://pypi.org/project/tensorflow/1.6.0/#files
https://pypi.org/project/tensorflow-gpu/1.6.0/#files

Note that you need to use the tensorflow-gpu wheel when building the GPU image.

Then run:

::

# All build instructions assumes you're building from the same directory as the Dockerfile.

# CPU
docker build -t <image_name>:<tag> --build-arg py_version=<py_version> --build-arg framework_installable=<path to tensorflow binary> -f Dockerfile.cpu .

# GPU
docker build -t <image_name>:<tag> --build-arg py_version=<py_version> --build-arg framework_installable=<path to tensorflow binary> -f Dockerfile.gpu .

::

# Example
docker build -t preprod-tensorflow:1.6.0-cpu-py2 --build-arg py_version=2
--build-arg framework_installable=tensorflow-1.6.0-cp27-cp27mu-manylinux1_x86_64.whl -f Dockerfile.cpu .

The dockerfiles for 1.4 and 1.5 build from source instead, so when building those, you don't need to download the wheel beforehand:

::

Expand All @@ -140,9 +165,6 @@ If you want to build "final" Docker images, then use:
# GPU
docker build -t preprod-tensorflow:1.4.1-gpu-py2 -f Dockerfile.gpu .

# For building images of TensorFlow versions 1.6 and above
docker build -t preprod-tensorflow:1.6.0-cpu-py2 --build-arg py_version=2
--build-arg framework_installable=tensorflow-1.6.0-cp27-cp27mu-manylinux1_x86_64.whl -f Dockerfile.cpu .

Running the tests
-----------------
Expand Down