From 868d16e045071d7eff3bcf594a83dc3d5ab77bff Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Tue, 12 Jan 2021 14:09:19 -0800 Subject: [PATCH] Add bash script install_ubuntu_16_python_pip_deps to incrementally replace install_ubuntu_16_pip_deps. PiperOrigin-RevId: 351446270 Change-Id: I6a2191e572ee22830e9eb462bf0e572692050f0e --- tensorflow/tools/ci_build/release/common.sh | 56 ++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/tensorflow/tools/ci_build/release/common.sh b/tensorflow/tools/ci_build/release/common.sh index b51e776f5cb..b9a4b13dea1 100644 --- a/tensorflow/tools/ci_build/release/common.sh +++ b/tensorflow/tools/ci_build/release/common.sh @@ -116,7 +116,7 @@ function install_ubuntu_16_pip_deps { shift done - # LINT.IfChange(linux_pip_installations) + # LINT.IfChange(linux_pip_installations_orig) # To have reproducible builds, these dependencies should be pinned always. # Prefer pinning to the same version as in setup.py # First, upgrade pypi wheels @@ -151,6 +151,59 @@ function install_ubuntu_16_pip_deps { "${PIP_CMD}" install --user 'PyYAML ~= 5.3.1' } +# Gradually replace function install_ubuntu_16_pip_deps. +# TODO(lpak): delete install_ubuntu_16_pip_deps when completely replaced. +function install_ubuntu_16_python_pip_deps { + PIP_CMD="pip" + + while true; do + if [[ -z "${1}" ]]; then + break + fi + if [[ "$1" == "pip"* ]]; then + PIP_CMD="$1" + fi + if [[ "$1" == "python"* ]]; then + PIP_CMD="${1} -m pip" + fi + shift + done + + # LINT.IfChange(linux_pip_installations) + # To have reproducible builds, these dependencies should be pinned always. + # Prefer pinning to the same version as in setup.py + # First, upgrade pypi wheels + ${PIP_CMD} install --user --upgrade setuptools pip wheel + # Now, install the deps, as listed in setup.py + ${PIP_CMD} install --user 'absl-py ~= 0.10' + ${PIP_CMD} install --user 'astunparse ~= 1.6.3' + ${PIP_CMD} install --user 'flatbuffers ~= 1.12.0' + ${PIP_CMD} install --user 'google_pasta ~= 0.2' + ${PIP_CMD} install --user 'h5py ~= 3.1.0' + ${PIP_CMD} install --user 'keras_preprocessing ~= 1.1.2' + ${PIP_CMD} install --user 'numpy ~= 1.19.2' + ${PIP_CMD} install --user 'opt_einsum ~= 3.3.0' + ${PIP_CMD} install --user 'protobuf >= 3.9.2' + ${PIP_CMD} install --user 'six ~= 1.15.0' + ${PIP_CMD} install --user 'termcolor ~= 1.1.0' + ${PIP_CMD} install --user 'typing_extensions ~= 3.7.4' + ${PIP_CMD} install --user 'wheel ~= 0.35' + ${PIP_CMD} install --user 'wrapt ~= 1.12.1' + # We need to pin gast dependency exactly + ${PIP_CMD} install --user 'gast == 0.4.0' + # Finally, install tensorboard and estimator + # Note that here we want the latest version that matches (b/156523241) + ${PIP_CMD} install --user --upgrade --force-reinstall 'tb-nightly ~= 2.4.0.a' + ${PIP_CMD} install --user --upgrade --force-reinstall 'tensorflow_estimator ~= 2.3.0' + # Test dependencies + ${PIP_CMD} install --user 'grpcio ~= 1.34.0' + ${PIP_CMD} install --user 'portpicker ~= 1.3.1' + ${PIP_CMD} install --user 'scipy ~= 1.5.2' + # LINT.ThenChange(:mac_pip_installations) + # Need to be addressed later. Unblocking 2.4 branchcut + ${PIP_CMD} install --user 'PyYAML ~= 5.3.1' +} + function install_macos_pip_deps { # TODO(mihaimaruseac): Remove need for sudo, then this can be merged with # above (probably needs to convert to venv too). @@ -209,6 +262,7 @@ function install_macos_pip_deps { ${PIP_CMD} install $USER_FLAG 'portpicker ~= 1.3.1' ${PIP_CMD} install $USER_FLAG 'scipy ~= 1.5.2' + # LINT.ThenChange(:linux_pip_installations_orig) # LINT.ThenChange(:linux_pip_installations) }