From: Zack Cerza Date: Tue, 31 May 2022 19:19:09 +0000 (-0600) Subject: Merge pull request #1753 from ceph/dc-venv X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e66caa0bb65ec716c16f9e64e23b146c9cfea928;p=teuthology.git Merge pull request #1753 from ceph/dc-venv --- e66caa0bb65ec716c16f9e64e23b146c9cfea928 diff --cc bootstrap index 5aa9fd834a,24729e25d1..91af9bdb4c --- a/bootstrap +++ b/bootstrap @@@ -144,24 -143,9 +143,21 @@@ f export LC_ALL=en_US.UTF-8 if [ -z "$NO_CLOBBER" ] || [ ! -e ./$VENV ]; then - if ! virtualenv --version &>/dev/null; then - pip install virtualenv - fi - virtualenv --python=$PYTHON $VENV + python3 -m venv $VENV fi +./$VENV/bin/pip install packaging + +# It is impossible to upgrade ansible from 2.9 to 2.10 via pip. +# See https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.10.html#known-issues +if [ -f "$VENV/bin/ansible" ]; then + ansible_version=$($VENV/bin/pip list --format json | python3 -c "import sys; import json; print(list(filter(lambda i: i['name'] == 'ansible', json.loads(sys.stdin.read())))[0]['version'])") + uninstall_ansible=$(./$VENV/bin/python3 -c "from packaging.version import parse; print(parse('$ansible_version') < parse('2.10.0'))") + if [ "$uninstall_ansible" = "True" ]; then + ./$VENV/bin/pip uninstall -y ansible + fi +fi + # First, upgrade pip ./$VENV/bin/pip install --upgrade pip diff --cc docs/docker-compose/teuthology/teuthology.sh index 54fdbe8203,b4e6c9224e..85029b975b --- a/docs/docker-compose/teuthology/teuthology.sh +++ b/docs/docker-compose/teuthology/teuthology.sh @@@ -18,10 -16,10 +16,10 @@@ f export MACHINE_TYPE=${MACHINE_TYPE:-testnode} if [ -z "$TEUTHOLOGY_WAIT" ]; then teuthology-suite -v \ - --teuthology-branch $TEUTHOLOGY_BRANCH \ + --teuthology-branch $TEUTH_BRANCH \ --ceph-repo https://github.com/ceph/ceph.git \ --suite-repo https://github.com/ceph/ceph.git \ - -c master \ + -c main \ -m $MACHINE_TYPE \ --limit 1 \ -n 100 \ diff --cc teuthology/suite/run.py index a99e0d2710,e680c53140..7ae4a37646 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@@ -245,12 -246,25 +247,25 @@@ class Run(object) log.warning( 'The teuthology branch config is empty, skipping') if not teuthology_branch: - teuthology_branch = config.get('teuthology_branch', 'master') + teuthology_branch = config.get('teuthology_branch', 'main') - teuthology_sha1 = util.git_ls_remote( - 'teuthology', - teuthology_branch - ) + if config.teuthology_path is None: + teuthology_sha1 = util.git_ls_remote( + 'teuthology', + teuthology_branch + ) + else: + actual_branch = repo_utils.current_branch(config.teuthology_path) + if actual_branch != teuthology_branch: + raise BranchMismatchError( + teuthology_branch, + config.teuthology_path, + "config.teuthology_path is set", + ) + teuthology_sha1 = util.git_ls_remote( + f"file://{config.teuthology_path}", + teuthology_branch + ) if not teuthology_sha1: exc = BranchNotFoundError(teuthology_branch, build_git_url('teuthology')) util.schedule_fail(message=str(exc), name=self.name)