@@ -62,15 +62,15 @@ RUN apt-get install -y gnupg zip openjdk-8-jdk && \
62
62
dpkg -i bazel_*.deb && \
63
63
rm bazel_*.deb
64
64
65
- # Fetch tensorflow & install dependencies.
65
+ # Fetch TensorFlow & install dependencies.
66
66
RUN cd /usr/local/src && \
67
67
git clone https://github.com/tensorflow/tensorflow && \
68
68
cd tensorflow && \
69
69
git checkout tags/v2.2.0 && \
70
70
pip install keras_applications --no-deps && \
71
71
pip install keras_preprocessing --no-deps
72
72
73
- # Create a tensorflow wheel for CPU
73
+ # Create a TensorFlow wheel for CPU
74
74
RUN cd /usr/local/src/tensorflow && \
75
75
cat /dev/null | ./configure && \
76
76
bazel build --config=opt \
@@ -80,6 +80,26 @@ RUN cd /usr/local/src/tensorflow && \
80
80
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_cpu && \
81
81
bazel clean
82
82
83
+ # Install TensorFlow CPU wheel which is required to build the GCS & addons libraries.
84
+ RUN pip install /tmp/tensorflow_cpu/tensorflow*.whl
85
+
86
+ # Build TensorFlow addons library against TensorFlow CPU.
87
+ RUN cd /usr/local/src/ && \
88
+ git clone https://github.com/tensorflow/addons && \
89
+ cd addons && \
90
+ git checkout tags/v0.10.0 && \
91
+ python ./configure.py && \
92
+ bazel build --enable_runfiles build_pip_pkg && \
93
+ bazel-bin/build_pip_pkg /tmp/tfa_cpu && \
94
+ bazel clean
95
+
96
+ # Build tensorflow_gcs_config library against TensorFlow CPU.
97
+ ADD tensorflow-gcs-config /usr/local/src/tensorflow_gcs_config/
98
+ RUN cd /usr/local/src/tensorflow_gcs_config && \
99
+ apt-get install -y libcurl4-openssl-dev && \
100
+ python setup.py bdist_wheel -d /tmp/tensorflow_gcs_config && \
101
+ bazel clean
102
+
83
103
# Create a tensorflow wheel for GPU/cuda
84
104
ENV TF_NEED_CUDA=1
85
105
ENV TF_CUDA_VERSION=$CUDA_MAJOR_VERSION.$CUDA_MINOR_VERSION
@@ -103,13 +123,16 @@ RUN cd /usr/local/src/tensorflow && \
103
123
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_gpu && \
104
124
bazel clean
105
125
106
- ADD tensorflow-gcs-config /usr/local/src/tensorflow_gcs_config/
126
+ # Install TensorFlow GPU wheel which to build addons against.
127
+ RUN pip install /tmp/tensorflow_gpu/tensorflow*.whl
107
128
108
- # Build tensorflow_gcs_config library against the tensorflow_cpu build
109
- RUN cd /usr/local/src/tensorflow_gcs_config && \
110
- apt-get install -y libcurl4-openssl-dev && \
111
- pip install /tmp/tensorflow_cpu/tensorflow*.whl && \
112
- python setup.py bdist_wheel -d /tmp/tensorflow_gcs_config && \
129
+ # Build TensorFlow addons library against TensorFlow GPU.
130
+ ENV CUDA_TOOLKIT_PATH=/usr/local/cuda
131
+ ENV CUDNN_INSTALL_PATH=/usr/lib/x86_64-linux-gnu
132
+ RUN cd /usr/local/src/addons && \
133
+ python ./configure.py && \
134
+ bazel build --enable_runfiles build_pip_pkg && \
135
+ bazel-bin/build_pip_pkg /tmp/tfa_gpu && \
113
136
bazel clean
114
137
115
138
# Print out the built .whl files
0 commit comments