From 129735b3b42874ae1de0d0708e28cde16b615e9e Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Mon, 12 Jun 2017 22:34:30 -0400 Subject: [PATCH] Install virtualenvs into /tmp/v The kernel has a limit on how long a shebang can be and causes build issues when we store virtualenvs in $WORKSPACE for jobs that have very long names. Move virtualenv installs into /tmp/v will solve this issue for good. Also no need for workarounds like `$PYTHON -m pip` anymore. Change-Id: I72be5f42c2196e88f22262688e3425f6a83e807c Jira: RELENG-156 Signed-off-by: Thanh Ha --- shell/jjb-install.sh | 6 +++--- shell/lftools-install.sh | 15 +++++++-------- shell/tox-install.sh | 15 +++++++-------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/shell/jjb-install.sh b/shell/jjb-install.sh index 8baed832..30890aa7 100644 --- a/shell/jjb-install.sh +++ b/shell/jjb-install.sh @@ -14,9 +14,9 @@ echo "---> jjb-install.sh" # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail -virtualenv "$WORKSPACE/.virtualenvs/jjb" -# shellcheck source=./.virtualenvs/jjb/bin/activate disable=SC1091 -source "$WORKSPACE/.virtualenvs/jjb/bin/activate" +virtualenv "/tmp/v/jjb" +# shellcheck source=/tmp/v/jjb/bin/activate disable=SC1091 +source "/tmp/v/jjb/bin/activate" pip install --quiet --upgrade pip pip install --quiet --upgrade pipdeptree pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" diff --git a/shell/lftools-install.sh b/shell/lftools-install.sh index 8b1c8f1b..4f28b7ad 100644 --- a/shell/lftools-install.sh +++ b/shell/lftools-install.sh @@ -14,15 +14,14 @@ echo "---> lftools-install.sh" # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail -virtualenv --quiet "$WORKSPACE/.virtualenvs/lftools" -# shellcheck source=./.virtualenvs/lftools/bin/activate disable=SC1091 -source "$WORKSPACE/.virtualenvs/lftools/bin/activate" -PYTHON="$WORKSPACE/.virtualenvs/lftools/bin/python" -$PYTHON -m pip install --quiet --upgrade pip -$PYTHON -m pip install --quiet --upgrade "lftools<1.0.0" +virtualenv --quiet "/tmp/v/lftools" +# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 +source "/tmp/v/lftools/bin/activate" +pip install --quiet --upgrade pip +pip install --quiet --upgrade "lftools<1.0.0" # pipdeptree prints out a lot of information because lftools pulls in many # dependencies. Let's only print it if we want to debug. # echo "----> Pip Dependency Tree" -# $PYTHON -m pip install --quiet --upgrade pipdeptree -# $PYTHON -m pipdeptree +# pip install --quiet --upgrade pipdeptree +# pipdeptree diff --git a/shell/tox-install.sh b/shell/tox-install.sh index a6e26bc2..2cffbd50 100644 --- a/shell/tox-install.sh +++ b/shell/tox-install.sh @@ -5,13 +5,12 @@ echo "---> tox-install.sh" # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail -virtualenv --quiet "$WORKSPACE/.virtualenvs/tox" -# shellcheck source=./.virtualenvs/tox/bin/activate disable=SC1091 -source "$WORKSPACE/.virtualenvs/tox/bin/activate" -PYTHON="$WORKSPACE/.virtualenvs/tox/bin/python" -$PYTHON -m pip install --quiet --upgrade pip -$PYTHON -m pip install --quiet --upgrade pipdeptree -$PYTHON -m pip install --quiet --upgrade tox argparse +virtualenv --quiet "/tmp/v/tox" +# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091 +source "/tmp/v/tox/bin/activate" +pip install --quiet --upgrade pip +pip install --quiet --upgrade pipdeptree +pip install --quiet --upgrade tox argparse echo "----> Pip Dependency Tree" -$PYTHON -m pipdeptree +pipdeptree -- 2.16.6