Files
edx-platform/scripts/xdist/setup_worker.sh
Tim McCormack d435f4cd3e Use pip-sync to make sure that dep cache tarball can go safely stale
This "fixes" egg-links in a really hacky way to compensate for the lack
of a real relocatable virtualenv.
2020-04-28 12:56:31 -04:00

28 lines
785 B
Bash
Executable File

#!/usr/bin/env bash
# Set up worker node.
while getopts 'p:d:' opt; do
case "$opt" in
p) PYTHON_VERSION="$OPTARG";;
d) DJANGO_REQUIREMENT="$OPTARG";;
[?])
print >&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