From: Zack Cerza Date: Thu, 10 Apr 2025 19:22:33 +0000 (-0600) Subject: Use uv's venv path X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36e38100ae5b3de5c4e27e5c0b17ae1cdb635417;p=teuthology.git Use uv's venv path Signed-off-by: Zack Cerza --- diff --git a/bootstrap b/bootstrap index 323846efa..5309a8906 100755 --- a/bootstrap +++ b/bootstrap @@ -85,6 +85,8 @@ fi command -v uv > /dev/null || pipx ensurepath PATH=$PATH:$HOME/.local/bin uv sync --frozen --all-extras +# To avoid crashing older dispatchers +ln -sf .venv virtualenv # Install ansible collections uv run ansible-galaxy install -r requirements.yml diff --git a/containers/teuthology-dev/teuthology.sh b/containers/teuthology-dev/teuthology.sh index 373f6efb8..49219d205 100755 --- a/containers/teuthology-dev/teuthology.sh +++ b/containers/teuthology-dev/teuthology.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash set -e -source /teuthology/virtualenv/bin/activate +PATH=$PATH:/teuthology/.venv/bin set -x cat /run/secrets/id_rsa > $HOME/.ssh/id_rsa if [ -n "$TEUTHOLOGY_TESTNODES" ]; then diff --git a/docs/docker-compose/teuthology/teuthology.sh b/docs/docker-compose/teuthology/teuthology.sh index 78770e323..c9ed897e2 100755 --- a/docs/docker-compose/teuthology/teuthology.sh +++ b/docs/docker-compose/teuthology/teuthology.sh @@ -4,7 +4,7 @@ set -e if [ -n "$SSH_PRIVKEY_FILE" ]; then echo "$SSH_PRIVKEY" > $HOME/.ssh/$SSH_PRIVKEY_FILE fi -source /teuthology/virtualenv/bin/activate +PATH=$PATH:/teuthology/.venv/bin set -x if [ -n "$TESTNODES" ]; then for node in $(echo $TESTNODES | tr , ' '); do diff --git a/teuthology/dispatcher/__init__.py b/teuthology/dispatcher/__init__.py index 59f8ae327..f64246f2a 100644 --- a/teuthology/dispatcher/__init__.py +++ b/teuthology/dispatcher/__init__.py @@ -304,7 +304,7 @@ def prep_job(job_config, log_file_path, archive_dir): ) raise SkipJob() - teuth_bin_path = os.path.join(teuth_path, 'virtualenv', 'bin') + teuth_bin_path = os.path.join(teuth_path, '.venv', 'bin') if not os.path.isdir(teuth_bin_path): raise RuntimeError("teuthology branch %s at %s not bootstrapped!" % (teuthology_branch, teuth_bin_path)) diff --git a/teuthology/dispatcher/test/test_dispatcher.py b/teuthology/dispatcher/test/test_dispatcher.py index 58f58cf9c..4b15e3537 100644 --- a/teuthology/dispatcher/test/test_dispatcher.py +++ b/teuthology/dispatcher/test/test_dispatcher.py @@ -71,7 +71,7 @@ class TestDispatcher(object): ) assert got_config['teuthology_branch'] == 'main' m_fetch_teuthology.assert_called_once_with(branch='main', commit='teuth_hash') - assert teuth_bin_path == '/teuth/path/virtualenv/bin' + assert teuth_bin_path == '/teuth/path/.venv/bin' m_fetch_qa_suite.assert_called_once_with('main', 'suite_hash') assert got_config['suite_path'] == '/suite/path' diff --git a/teuthology/repo_utils.py b/teuthology/repo_utils.py index 79fd92eda..6d135b469 100644 --- a/teuthology/repo_utils.py +++ b/teuthology/repo_utils.py @@ -462,7 +462,7 @@ def bootstrap_teuthology(dest_path): if returncode != 0: for line in out.split("\n"): log.warning(line.strip()) - venv_path = os.path.join(dest_path, 'virtualenv') + venv_path = os.path.join(dest_path, '.venv') log.info("Removing %s", venv_path) shutil.rmtree(venv_path, ignore_errors=True) raise BootstrapError("Bootstrap failed!")