Skip to content

Commit 2a76a8d

Browse files
committed
deal with pip on ancient ubuntus like 1204
1 parent 35ae750 commit 2a76a8d

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

.evergreen/Dockerfile.erb

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ RUN echo 2
3232

3333
RUN apt-get install -y curl
3434

35+
<% if preload? && distro =~ /ubuntu1204/ %>
36+
37+
# ubuntu1204 comes with python 2.7.3.
38+
# Install a more recent one from deadsnakes ppa so that pip works.
39+
RUN apt-get install -y python-software-properties
40+
# https://github.com/deadsnakes/issues/issues/53
41+
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C
42+
RUN add-apt-repository ppa:fkrull/deadsnakes-python2.7
43+
RUN apt-get update
44+
RUN apt-get install -y python2.7-dev
45+
46+
<% end %>
47+
3548
<% end %>
3649

3750
<% if ruby_head? %>
@@ -107,6 +120,17 @@ RUN echo 2
107120
ENV USE_OPT_TOOLCHAIN=1
108121

109122
<% end %>
123+
124+
<% if distro =~ /ubuntu1204/ %>
125+
126+
# Ubuntu 12.04 ships pip 1.0 which is ancient and does not work.
127+
# https://pip.pypa.io/en/stable/installing/
128+
RUN curl --retry 3 -fLo get-pip.py https://bootstrap.pypa.io/get-pip.py
129+
RUN python get-pip.py
130+
131+
<% end %>
132+
133+
RUN pip --version
110134

111135
<% end %>
112136

@@ -124,9 +148,7 @@ WORKDIR /app
124148

125149
COPY . .
126150

127-
ENV MONGO_ORCHESTRATION_HOME=/tmpfs
128-
ENV PROJECT_DIRECTORY=/app
151+
ENV MONGO_ORCHESTRATION_HOME=/tmpfs \
152+
PROJECT_DIRECTORY=/app
129153

130-
<% @env.each do |k, v| %>
131-
ENV <%= k %>="<%= v %>"
132-
<% end %>
154+
ENV <%= @env.map { |k, v| %Q`#{k}="#{v}"` }.join(" \\\n ") %>

.evergreen/functions.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,6 @@ install_mlaunch_pip() {
300300
python -V || true
301301
python3 -V || true
302302
pythonpath="$MONGO_ORCHESTRATION_HOME"/python
303-
# The scripts in a python installation have shebangs pointing to the
304-
# prefix, which doesn't work for us because we unpack toolchain to a
305-
# different directory than prefix used for building. Work around this by
306-
# explicitly running pip3 with python.
307303
pip install -t "$pythonpath" 'mtools-legacy[mlaunch]'
308304
export PATH="$pythonpath/bin":$PATH
309305
export PYTHONPATH="$pythonpath"

.evergreen/run-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ if test "$SSL" = ssl; then
7878
"tlsCertificateKeyFile=spec/support/certificates/$client_pem"
7979
fi
8080

81-
mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args
81+
python -m mtools.mlaunch.mlaunch --dir "$dbdir" --binarypath "$BINDIR" $args
8282

8383
install_deps
8484

@@ -164,6 +164,6 @@ echo ${test_status}
164164

165165
kill_jruby
166166

167-
mlaunch stop --dir "$dbdir"
167+
python -m mtools.mlaunch.mlaunch stop --dir "$dbdir"
168168

169169
exit ${test_status}

0 commit comments

Comments
 (0)