From 7d99c2900e2aa2ffc25092818156c17d5ea79274 Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Tue, 20 Aug 2019 20:22:28 -0400 Subject: [PATCH 1/2] Patch manylinux2010 auditwheel repair so libtensorflow is not copied --- tools/ci_build/builds/release_linux.sh | 4 +++- tools/ci_build/builds/tf_auditwheel | 9 +++++++++ tools/ci_build/builds/wheel_verify.sh | 5 ++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100755 tools/ci_build/builds/tf_auditwheel diff --git a/tools/ci_build/builds/release_linux.sh b/tools/ci_build/builds/release_linux.sh index d03b3bc33d..a1f2836b96 100755 --- a/tools/ci_build/builds/release_linux.sh +++ b/tools/ci_build/builds/release_linux.sh @@ -20,9 +20,11 @@ ln -sf /usr/bin/python3.5 /usr/bin/python3 # Py36 has issues with add-apt curl -sSOL https://bootstrap.pypa.io/get-pip.py add-apt-repository -y ppa:deadsnakes/ppa +apt-get -y -qq update + for version in ${PYTHON_VERSIONS}; do export PYTHON_VERSION=${version} - apt-get -y -qq update && apt-get -y -qq install ${PYTHON_VERSION} + apt-get -y -qq install ${PYTHON_VERSION} ${PYTHON_VERSION} get-pip.py -q ${PYTHON_VERSION} -m pip --version diff --git a/tools/ci_build/builds/tf_auditwheel b/tools/ci_build/builds/tf_auditwheel new file mode 100755 index 0000000000..95a290f413 --- /dev/null +++ b/tools/ci_build/builds/tf_auditwheel @@ -0,0 +1,9 @@ +TF_SHARED_LIBRARY_NAME=$(grep -r TF_SHARED_LIBRARY_NAME .bazelrc | awk -F= '{print$2}') + +POLICY_JSON=$(find / -name policy.json) + +sed -i "s/libresolv.so.2\"/libresolv.so.2\", $TF_SHARED_LIBRARY_NAME/g" $POLICY_JSON + +cat $POLICY_JSON + +auditwheel $@ \ No newline at end of file diff --git a/tools/ci_build/builds/wheel_verify.sh b/tools/ci_build/builds/wheel_verify.sh index 628813dd3c..58c3ed553f 100755 --- a/tools/ci_build/builds/wheel_verify.sh +++ b/tools/ci_build/builds/wheel_verify.sh @@ -19,9 +19,8 @@ set -e if [[ $(uname) == "Darwin" ]]; then CMD="delocate-wheel -w wheelhouse" else - LD_PATH="$(cat .bazelrc | grep TF_SHARED_LIBRARY_DIR | sed 's/"//g' | awk -F'=' '{print $2}')" - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LD_PATH - CMD="auditwheel repair --plat manylinux2010_x86_64" + pip3 install auditwheel==2.0.0 + CMD="tools/ci_build/builds/tf_auditwheel repair --plat manylinux2010_x86_64" fi ls artifacts/* From a9a4dc2d5f605c16eb024c4de7d0c2d3fc4e9676 Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Wed, 21 Aug 2019 09:05:33 -0400 Subject: [PATCH 2/2] Simplify patch --- tools/ci_build/builds/tf_auditwheel | 9 --------- tools/ci_build/builds/tf_auditwheel_patch.sh | 21 ++++++++++++++++++++ tools/ci_build/builds/wheel_verify.sh | 5 +++-- 3 files changed, 24 insertions(+), 11 deletions(-) delete mode 100755 tools/ci_build/builds/tf_auditwheel create mode 100755 tools/ci_build/builds/tf_auditwheel_patch.sh diff --git a/tools/ci_build/builds/tf_auditwheel b/tools/ci_build/builds/tf_auditwheel deleted file mode 100755 index 95a290f413..0000000000 --- a/tools/ci_build/builds/tf_auditwheel +++ /dev/null @@ -1,9 +0,0 @@ -TF_SHARED_LIBRARY_NAME=$(grep -r TF_SHARED_LIBRARY_NAME .bazelrc | awk -F= '{print$2}') - -POLICY_JSON=$(find / -name policy.json) - -sed -i "s/libresolv.so.2\"/libresolv.so.2\", $TF_SHARED_LIBRARY_NAME/g" $POLICY_JSON - -cat $POLICY_JSON - -auditwheel $@ \ No newline at end of file diff --git a/tools/ci_build/builds/tf_auditwheel_patch.sh b/tools/ci_build/builds/tf_auditwheel_patch.sh new file mode 100755 index 0000000000..52f4c19500 --- /dev/null +++ b/tools/ci_build/builds/tf_auditwheel_patch.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 2019 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +set -e + +TF_SHARED_LIBRARY_NAME=$(grep -r TF_SHARED_LIBRARY_NAME .bazelrc | awk -F= '{print$2}') +POLICY_JSON="/usr/local/lib/python3.6/dist-packages/auditwheel/policy/policy.json" +sed -i "s/libresolv.so.2\"/libresolv.so.2\", $TF_SHARED_LIBRARY_NAME/g" $POLICY_JSON diff --git a/tools/ci_build/builds/wheel_verify.sh b/tools/ci_build/builds/wheel_verify.sh index 58c3ed553f..e43042e281 100755 --- a/tools/ci_build/builds/wheel_verify.sh +++ b/tools/ci_build/builds/wheel_verify.sh @@ -19,8 +19,9 @@ set -e if [[ $(uname) == "Darwin" ]]; then CMD="delocate-wheel -w wheelhouse" else - pip3 install auditwheel==2.0.0 - CMD="tools/ci_build/builds/tf_auditwheel repair --plat manylinux2010_x86_64" + pip3.6 install -U auditwheel==2.0.0 + tools/ci_build/builds/tf_auditwheel_patch.sh + CMD="auditwheel repair --plat manylinux2010_x86_64" fi ls artifacts/*