Skip to content

Commit 7975912

Browse files
committed
Use build dir for building TensorFlow pip package
build_pip_package (executed after Bazel finishes) uses a temporary folder which gets large (2 GB for TF 2.9). It prefers to use `$XDG_CACHE_HOME` which we set to the temporary folder created by Easybuild in PythonPackage but that might have only enough space for logs etc. As this folder is part of the build put it inside the build directory.
1 parent 0a1a5ce commit 7975912

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

easybuild/easyblocks/t/tensorflow.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,10 @@ def build_step(self):
943943
run_cmd(' '.join(cmd), log_all=True, simple=True, log_ok=True)
944944

945945
# run generated 'build_pip_package' script to build the .whl
946-
cmd = "bazel-bin/tensorflow/tools/pip_package/build_pip_package %s" % self.builddir
946+
# TF uses the temporary folder, with $XDG_CACHE_HOME taking precedence,
947+
# This becomes quite large (~2 GB) so use the build folder explicitely.
948+
cmd = "XDG_CACHE_HOME='%s' " % os.path.join(self.builddir, 'cache-dir')
949+
cmd += "bazel-bin/tensorflow/tools/pip_package/build_pip_package %s" % self.builddir
947950
run_cmd(cmd, log_all=True, simple=True, log_ok=True)
948951

949952
def test_step(self):

0 commit comments

Comments
 (0)