From 70600d79d7e38563ebd50e11894e83610610431c Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Tue, 28 Apr 2020 22:15:57 -0400 Subject: [PATCH] Revert "Fix Jenkins virtualenv issue that masked stale dependency" (#23828) * Revert "Use pip-sync to make sure that dep cache tarball can go safely stale" This reverts commit d435f4cd3e974b79c85ebff2a9f54d15e7af0a6f. * Revert "Extract worker setup into own shell script, as much as possible" This reverts commit 0a079e757c9bbdf261018b8f23fcdb29beedebe0. --- Makefile | 3 +-- scripts/jenkins-common.sh | 6 ------ scripts/xdist/prepare_xdist_nodes.sh | 13 ++++++++----- scripts/xdist/setup_worker.sh | 27 --------------------------- 4 files changed, 9 insertions(+), 40 deletions(-) delete mode 100755 scripts/xdist/setup_worker.sh diff --git a/Makefile b/Makefile index 887e609508..586ab8d884 100644 --- a/Makefile +++ b/Makefile @@ -61,8 +61,7 @@ pull: ## update the Docker image used by "make shell" docker pull edxops/edxapp:latest requirements: ## install development environment requirements - pip install -qr requirements/edx/pip-tools.txt - pip-sync -q requirements/edx/development.txt requirements/edx/private.* + pip install -qr requirements/edx/development.txt --exists-action w shell: ## launch a bash shell in a Docker container with all edx-platform dependencies installed docker run -it -e "NO_PYTHON_UNINSTALL=1" -e "PIP_INDEX_URL=https://pypi.python.org/simple" -e TERM \ diff --git a/scripts/jenkins-common.sh b/scripts/jenkins-common.sh index d4048817d9..b1a56b1f39 100644 --- a/scripts/jenkins-common.sh +++ b/scripts/jenkins-common.sh @@ -45,12 +45,6 @@ fi # Activate the Python virtualenv source $VENV_PATH/edx-venv/bin/activate -# Hack to fix up egg-link files given that the virtualenv is not relocatable -sed -i "s|^/home/jenkins/shallow-clone|`pwd`|" -- \ - $VENV_PATH/edx-venv/lib/python*/site-packages/*.egg-link -pip install -qr requirements/edx/pip-tools.txt -pip-sync -q requirements/edx/testing.txt requirements/edx/django.txt - # add the node packages dir to PATH PATH=$PATH:node_modules/.bin diff --git a/scripts/xdist/prepare_xdist_nodes.sh b/scripts/xdist/prepare_xdist_nodes.sh index 3d029c6f03..8a4d964bc1 100644 --- a/scripts/xdist/prepare_xdist_nodes.sh +++ b/scripts/xdist/prepare_xdist_nodes.sh @@ -12,13 +12,13 @@ python scripts/xdist/pytest_worker_manager.py -a up -n ${XDIST_NUM_WORKERS} \ # Install the correct version of Django depending on which tox environment (if any) is in use if [[ -z ${TOXENV+x} ]] || [[ ${TOXENV} == 'null' ]]; then - DJANGO_REQUIREMENT="requirements/edx/django.txt" + DJANGO_REQUIREMENT="-r requirements/edx/django.txt" elif [[ ${TOXENV} == *'django20'* ]]; then - DJANGO_REQUIREMENT="requirements/edx/django20.txt" + DJANGO_REQUIREMENT="-r requirements/edx/django20.txt" elif [[ ${TOXENV} == *'django21'* ]]; then - DJANGO_REQUIREMENT="requirements/edx/django21.txt" + DJANGO_REQUIREMENT="-r requirements/edx/django21.txt" elif [[ ${TOXENV} == *'django22'* ]]; then - DJANGO_REQUIREMENT="requirements/edx/django.txt" + DJANGO_REQUIREMENT="-r requirements/edx/django.txt" fi ip_list=$(&2 "Usage: $0 -p python-version -d django-reqs-file" - exit 1 - ;; - esac -done - -venv_parent=/home/jenkins/edx-venv-${PYTHON_VERSION} -venv=$venv_parent/edx-venv -rm -rf $venv -tar -C $venv_parent -xf /home/jenkins/edx-venv_clean-${PYTHON_VERSION}.tar.gz -source $venv/bin/activate - -# Hack to fix up egg-link files given that the virtualenv is not relocatable -sed -i "s|\(^/home/jenkins\)/shallow-clone|\1/edx-platform|" -- \ - $venv/lib/python*/site-packages/*.egg-link -pip install -qr requirements/edx/pip-tools.txt -pip-sync -q requirements/edx/testing.txt "${DJANGO_REQUIREMENT}" - -mkdir reports