Skip to content

Commit ea86529

Browse files
Sylvain ZimmerSylvain Zimmer
authored andcommitted
Update dependencies & Docker environment. Fixes #225
1 parent 60c8d88 commit ea86529

8 files changed

Lines changed: 25 additions & 23 deletions

File tree

Dockerfile

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:jessie
1+
FROM debian:buster-slim
22

33
#
44
# httpredir.debian.org is often unreliable
@@ -11,32 +11,35 @@ FROM debian:jessie
1111
# deb http://security.debian.org jessie/updates main\n' \
1212
# > /etc/apt/sources.list
1313

14-
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
15-
RUN echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" > /etc/apt/sources.list.d/mongodb-org-3.4.list
1614
RUN apt-get update && \
1715
apt-get install -y --no-install-recommends \
1816
curl \
1917
gcc \
2018
python-dev \
2119
python-pip \
20+
python-setuptools \
2221
python3-pip \
2322
python3-dev \
23+
python3-setuptools \
2424
make \
2525
git \
2626
vim \
2727
bzip2 \
28-
mongodb-org \
2928
nginx redis-server \
3029
g++ \
3130
&& \
3231
apt-get clean -y && \
3332
rm -rf /var/lib/apt/lists/*
3433

35-
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
34+
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
3635
RUN apt-get install -y --no-install-recommends nodejs
3736

37+
RUN curl -sL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
38+
RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" > /etc/apt/sources.list.d/mongodb-org-4.2.list
39+
RUN apt-get update && apt-get install -y --no-install-recommends mongodb-org
40+
3841
# Download pypy
39-
RUN curl -sL 'https://bitbucket.org/squeaky/portable-pypy/downloads/pypy-5.8-1-linux_x86_64-portable.tar.bz2' > /pypy.tar.bz2 && tar jxvf /pypy.tar.bz2 && rm -rf /pypy.tar.bz2 && mv /pypy-* /pypy
42+
RUN curl -sL 'https://github.com/squeaky-pl/portable-pypy/releases/download/pypy-7.2.0/pypy-7.2.0-linux_x86_64-portable.tar.bz2' > /pypy.tar.bz2 && tar jxvf /pypy.tar.bz2 && rm -rf /pypy.tar.bz2 && mv /pypy* /pypy
4043

4144
# Upgrade pip
4245
RUN pip install --upgrade --ignore-installed pip
@@ -48,16 +51,16 @@ ADD requirements-base.txt /app/requirements-base.txt
4851
ADD requirements-dev.txt /app/requirements-dev.txt
4952
ADD requirements-dashboard.txt /app/requirements-dashboard.txt
5053

51-
RUN pip3 install -r /app/requirements-heroku.txt && \
52-
pip3 install -r /app/requirements-base.txt && \
53-
pip3 install -r /app/requirements-dev.txt && \
54-
pip3 install -r /app/requirements-dashboard.txt && \
54+
RUN python3 -m pip install -r /app/requirements-heroku.txt && \
55+
python3 -m pip install -r /app/requirements-base.txt && \
56+
python3 -m pip install -r /app/requirements-dev.txt && \
57+
python3 -m pip install -r /app/requirements-dashboard.txt && \
5558
rm -rf ~/.cache
5659

57-
RUN pip install -r /app/requirements-heroku.txt && \
58-
pip install -r /app/requirements-base.txt && \
59-
pip install -r /app/requirements-dev.txt && \
60-
pip install -r /app/requirements-dashboard.txt && \
60+
RUN python -m pip install -r /app/requirements-heroku.txt && \
61+
python -m pip install -r /app/requirements-base.txt && \
62+
python -m pip install -r /app/requirements-dev.txt && \
63+
python -m pip install -r /app/requirements-dashboard.txt && \
6164
rm -rf ~/.cache
6265

6366
RUN /pypy/bin/pip install -r /app/requirements-heroku.txt && \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dashboard:
5656
python mrq/dashboard/app.py
5757

5858
stack:
59-
mongod --smallfiles --noprealloc --nojournal &
59+
mongod &
6060
redis-server &
6161
python mrq/dashboard/app.py &
6262

mrq/processes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def request_shutdown_graceful():
3737
self.shutdown_graceful()
3838

3939
# First time CTRL-C, try to shutdown gracefully
40-
gevent.signal(signal.SIGINT, request_shutdown_graceful)
40+
gevent.signal_handler(signal.SIGINT, request_shutdown_graceful)
4141

4242
# User (or Heroku) requests a stop now, just mark tasks as interrupted.
43-
gevent.signal(signal.SIGTERM, request_shutdown_now)
43+
gevent.signal_handler(signal.SIGTERM, request_shutdown_now)
4444

4545

4646
class ProcessPool(object):

mrq/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def report_worker(self, w=0):
347347

348348
if self.config["report_file"]:
349349
with open(self.config["report_file"], "wb") as f:
350-
f.write(bytes(json.dumps(report, ensure_ascii=False), 'utf-8')) # pylint: disable=no-member
350+
f.write(bytes(json.dumps(report, ensure_ascii=False, default=str), 'utf-8')) # pylint: disable=no-member
351351

352352
if "_id" in report:
353353
del report["_id"]

requirements-base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pymongo==3.7.2
44
gevent>=1.2.2
55
ujson>=1.33
66
hiredis>=0.1.5
7-
psutil>=5.1.2,<6.0
7+
psutil>=5.1.2,<=5.6.3 # https://github.com/giampaolo/psutil/issues/1659#issuecomment-586032229
88
objgraph>=1.8.1
99
termcolor>=1.1.0
1010
subprocess32>=3.2.7; python_version < '3.2' and sys.platform != "win32"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pylint==1.7.1
33
pytest-cov==2.4.0
44
pytest-instafail==0.3.0
55
pytest-html==1.14.2
6-
pytest-httpbin==0.2.0
6+
pytest-httpbin==1.0.0
77
pytest-timeout==1.2.0
88

99
subprocess32>=3.2.7; python_version < '3.2'

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def get_version():
6161
classifiers=[
6262
"Programming Language :: Python",
6363
"Programming Language :: Python :: 2.7",
64-
"Programming Language :: Python :: 3.4",
6564
"Programming Language :: Python :: 3.5",
6665
"Programming Language :: Python :: 3.6",
6766
"Programming Language :: Python :: 3.7",

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,15 @@ def httpstatic(request):
373373

374374
@pytest.fixture(scope="function")
375375
def mongodb(request):
376-
cmd = "mongod --smallfiles --noprealloc --nojournal"
376+
cmd = "mongod --nojournal"
377377
if os.environ.get("STACK_STARTED"):
378378
cmd = "sleep 1h"
379379
return MongoFixture(request, cmd, wait_port=27017, quiet=True)
380380

381381

382382
@pytest.fixture(scope="function")
383383
def mongodb_with_journal(request):
384-
cmd = "mongod --smallfiles --noprealloc"
384+
cmd = "mongod"
385385
if os.environ.get("STACK_STARTED"):
386386
cmd = "sleep 1h"
387387
return MongoFixture(request, cmd, wait_port=27017, quiet=True)

0 commit comments

Comments
 (0)