summaryrefslogtreecommitdiff
path: root/evergreen
diff options
context:
space:
mode:
authorMikhail Shchatko <mikhail.shchatko@mongodb.com>2022-01-25 16:56:18 +0300
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-25 17:19:27 +0000
commit40f1055e50e3cfa122c2075ef692243987d80438 (patch)
treeb488b9935acd03e489087e2d56d68ed4c7bed74b /evergreen
parent0d6e7a4a1a035b57178458c341578260f956977c (diff)
downloadmongo-40f1055e50e3cfa122c2075ef692243987d80438.tar.gz
SERVER-62912 Install db-contrib-tool in a separate venv
Diffstat (limited to 'evergreen')
-rwxr-xr-xevergreen/compiled_binaries_get.sh4
-rw-r--r--evergreen/multiversion_setup.sh4
-rwxr-xr-xevergreen/prelude.sh1
-rw-r--r--evergreen/prelude_db_contrib_tool.sh31
4 files changed, 36 insertions, 4 deletions
diff --git a/evergreen/compiled_binaries_get.sh b/evergreen/compiled_binaries_get.sh
index 2adf1073521..ed4cdbe86dc 100755
--- a/evergreen/compiled_binaries_get.sh
+++ b/evergreen/compiled_binaries_get.sh
@@ -6,8 +6,8 @@ cd src
set -o errexit
set -o verbose
-activate_venv
-$python -m pip --disable-pip-version-check install "db-contrib-tool==0.1.7"
+setup_db_contrib_tool_venv
+activate_db_contrib_tool_venv
rm -rf /data/install dist-test/bin
diff --git a/evergreen/multiversion_setup.sh b/evergreen/multiversion_setup.sh
index a0deb40e237..6718e59ad61 100644
--- a/evergreen/multiversion_setup.sh
+++ b/evergreen/multiversion_setup.sh
@@ -6,8 +6,8 @@ cd src
set -o errexit
set -o verbose
-activate_venv
-$python -m pip --disable-pip-version-check install "db-contrib-tool==0.1.7"
+setup_db_contrib_tool_venv
+activate_db_contrib_tool_venv
rm -rf /data/install /data/multiversion
diff --git a/evergreen/prelude.sh b/evergreen/prelude.sh
index abb0c6bce83..3844afaead5 100755
--- a/evergreen/prelude.sh
+++ b/evergreen/prelude.sh
@@ -10,6 +10,7 @@ evergreen_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
. "$evergreen_dir/prelude_workdir.sh"
. "$evergreen_dir/prelude_python.sh"
. "$evergreen_dir/prelude_venv.sh"
+. "$evergreen_dir/prelude_db_contrib_tool.sh"
expansions_yaml="$evergreen_dir/../../expansions.yml"
expansions_default_yaml="$evergreen_dir/../etc/expansions.default.yml"
diff --git a/evergreen/prelude_db_contrib_tool.sh b/evergreen/prelude_db_contrib_tool.sh
new file mode 100644
index 00000000000..fad6d6ec41f
--- /dev/null
+++ b/evergreen/prelude_db_contrib_tool.sh
@@ -0,0 +1,31 @@
+function setup_db_contrib_tool_venv {
+ local db_contrib_tool_venv_dir="${workdir}/db_contrib_tool_venv"
+ if [ -d "$db_contrib_tool_venv_dir" ]; then
+ echo "Found existing db-contrib-tool venv. Skipping setup."
+ exit 0
+ fi
+
+ $python -m venv "$db_contrib_tool_venv_dir"
+
+ if [ "Windows_NT" = "$OS" ]; then
+ dos2unix "$db_contrib_tool_venv_dir/Scripts/activate"
+ fi
+
+ activate_db_contrib_tool_venv
+ python -m pip --disable-pip-version-check install "pip==21.0.1" "wheel==0.37.0" || exit 1
+ python -m pip --disable-pip-version-check install "db-contrib-tool==0.1.7" || exit 1
+}
+
+function activate_db_contrib_tool_venv {
+ local db_contrib_tool_venv_dir="${workdir}/db_contrib_tool_venv"
+ if [ ! -d "$db_contrib_tool_venv_dir" ]; then
+ echo "Could not find db-contrib-tool venv."
+ exit 1
+ fi
+
+ if [ "Windows_NT" = "$OS" ]; then
+ . "$db_contrib_tool_venv_dir/Scripts/activate"
+ else
+ . "$db_contrib_tool_venv_dir/bin/activate"
+ fi
+}