From 534fee83d9cbad5401c50d48c51cbf219db8f1e7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 8 Mar 2020 15:42:31 -0400 Subject: [PATCH 1/3] provision with mlaunch once on the supposition that #691 is fixed --- .evergreen/run-tests.sh | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index a70ccaa0b8..74b9734ad5 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -78,23 +78,7 @@ if test "$SSL" = ssl; then "tlsCertificateKeyFile=spec/support/certificates/$client_pem" fi -# mlaunch frequently fails to provision sharded clusters with authentication - -# see https://github.com/rueckstiess/mtools/issues/691. -# Give it 5 attempts. -ok=false -for i in `seq 5`; do - if mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args; then - ok=true - break - fi - mlaunch stop --dir "$dbdir" || true - rm -rf "$dbdir" -done - -if ! $ok; then - echo mlaunch failed to provision the desired deployment 1>&2 - exit 5 -fi +mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args install_deps From 35ae7505a8dc4601ddccd8200776ac378e9d2da8 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 8 Mar 2020 16:14:12 -0400 Subject: [PATCH 2/3] use mtools-legacy 1.5.5 --- .evergreen/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 74b9734ad5..1353384e00 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -16,7 +16,7 @@ setup_ruby prepare_server $arch -install_mlaunch_git https://github.com/p-mongo/mtools wait-for-rs +install_mlaunch_pip # Launching mongod under $MONGO_ORCHESTRATION_HOME # makes its log available through log collecting machinery From 2a76a8d180c6fd2e94d87725b8feeeffd2151924 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 8 Mar 2020 19:25:35 -0400 Subject: [PATCH 3/3] deal with pip on ancient ubuntus like 1204 --- .evergreen/Dockerfile.erb | 32 +++++++++++++++++++++++++++----- .evergreen/functions.sh | 4 ---- .evergreen/run-tests.sh | 4 ++-- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.evergreen/Dockerfile.erb b/.evergreen/Dockerfile.erb index c80d33e24d..a0e41e8d96 100644 --- a/.evergreen/Dockerfile.erb +++ b/.evergreen/Dockerfile.erb @@ -32,6 +32,19 @@ RUN echo 2 RUN apt-get install -y curl + <% if preload? && distro =~ /ubuntu1204/ %> + + # ubuntu1204 comes with python 2.7.3. + # Install a more recent one from deadsnakes ppa so that pip works. + RUN apt-get install -y python-software-properties + # https://github.com/deadsnakes/issues/issues/53 + RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C + RUN add-apt-repository ppa:fkrull/deadsnakes-python2.7 + RUN apt-get update + RUN apt-get install -y python2.7-dev + + <% end %> + <% end %> <% if ruby_head? %> @@ -107,6 +120,17 @@ RUN echo 2 ENV USE_OPT_TOOLCHAIN=1 <% end %> + + <% if distro =~ /ubuntu1204/ %> + + # Ubuntu 12.04 ships pip 1.0 which is ancient and does not work. + # https://pip.pypa.io/en/stable/installing/ + RUN curl --retry 3 -fLo get-pip.py https://bootstrap.pypa.io/get-pip.py + RUN python get-pip.py + + <% end %> + + RUN pip --version <% end %> @@ -124,9 +148,7 @@ WORKDIR /app COPY . . -ENV MONGO_ORCHESTRATION_HOME=/tmpfs -ENV PROJECT_DIRECTORY=/app +ENV MONGO_ORCHESTRATION_HOME=/tmpfs \ + PROJECT_DIRECTORY=/app -<% @env.each do |k, v| %> -ENV <%= k %>="<%= v %>" -<% end %> +ENV <%= @env.map { |k, v| %Q`#{k}="#{v}"` }.join(" \\\n ") %> diff --git a/.evergreen/functions.sh b/.evergreen/functions.sh index 526b59400f..a0e20f82bb 100644 --- a/.evergreen/functions.sh +++ b/.evergreen/functions.sh @@ -300,10 +300,6 @@ install_mlaunch_pip() { python -V || true python3 -V || true pythonpath="$MONGO_ORCHESTRATION_HOME"/python - # The scripts in a python installation have shebangs pointing to the - # prefix, which doesn't work for us because we unpack toolchain to a - # different directory than prefix used for building. Work around this by - # explicitly running pip3 with python. pip install -t "$pythonpath" 'mtools-legacy[mlaunch]' export PATH="$pythonpath/bin":$PATH export PYTHONPATH="$pythonpath" diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index 1353384e00..70bdfd6e48 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -78,7 +78,7 @@ if test "$SSL" = ssl; then "tlsCertificateKeyFile=spec/support/certificates/$client_pem" fi -mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args +python -m mtools.mlaunch.mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args install_deps @@ -164,6 +164,6 @@ echo ${test_status} kill_jruby -mlaunch stop --dir "$dbdir" +python -m mtools.mlaunch.mlaunch stop --dir "$dbdir" exit ${test_status}