Skip to content

Commit

Permalink
Merge pull request #4284 from caisq/r0.10-fixes
Browse files Browse the repository at this point in the history
Cherry-picking r0.10 fixes
  • Loading branch information
martinwicke committed Sep 8, 2016
2 parents 23da860 + f5a9638 commit c715c31
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
16 changes: 15 additions & 1 deletion tensorflow/tools/docker/parameterized_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,21 @@ fi

# Apply the final image name and tag
FINAL_IMG="${FINAL_IMAGE_NAME}:${FINAL_TAG}"
docker tag -f "${IMG}" "${FINAL_IMG}" || \

DOCKER_VER=$(docker version | grep Version | head -1 | awk '{print $NF}')
if [[ -z "${DOCKER_VER}" ]]; then
die "ERROR: Failed to determine docker version"
fi
DOCKER_MAJOR_VER=$(echo "${DOCKER_VER}" | cut -d. -f 1)
DOCKER_MINOR_VER=$(echo "${DOCKER_VER}" | cut -d. -f 2)

FORCE_TAG=""
if [[ "${DOCKER_MAJOR_VER}" -le 1 ]] && \
[[ "${DOCKER_MINOR_VER}" -le 9 ]]; then
FORCE_TAG="--force"
fi

docker tag ${FORCE_TAG} "${IMG}" "${FINAL_IMG}" || \
die "Failed to tag intermediate docker image ${IMG} as ${FINAL_IMG}"

echo ""
Expand Down
22 changes: 19 additions & 3 deletions tensorflow/tools/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

set -e

function cp_external() {
local src_dir=$1
local dest_dir=$2
for f in `find "$src_dir" -maxdepth 1 -mindepth 1 ! -name '*local_config_cuda*'`; do
cp -R "$f" "$dest_dir"
done
}

function main() {
if [ $# -lt 1 ] ; then
echo "No destination dir provided"
Expand All @@ -36,23 +44,31 @@ function main() {
if [ ! -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow ]; then
# Really old (0.2.1-) runfiles, without workspace name.
cp -R \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/{tensorflow,external} \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/tensorflow \
"${TMPDIR}"
mkdir "${TMPDIR}/external"
cp_external \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/external \
"${TMPDIR}/external"
RUNFILES=bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles
else
if [ -d bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external ]; then
# Old-style runfiles structure (--legacy_external_runfiles).
cp -R \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/{tensorflow,external} \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
"${TMPDIR}"
mkdir "${TMPDIR}/external"
cp_external \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
"${TMPDIR}/external"
else
# New-style runfiles structure (--nolegacy_external_runfiles).
cp -R \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
"${TMPDIR}"
mkdir "${TMPDIR}/external"
# Note: this makes an extra copy of org_tensorflow.
cp -R \
cp_external \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
"${TMPDIR}/external"
fi
Expand Down

0 comments on commit c715c31

Please sign in to comment.