Skip to content

Commit f6b1adf

Browse files
committed
Merge branch 'feature/dockerfile-updates' into feature/buff-worms
Closes #373
2 parents a7ef407 + 943e5f7 commit f6b1adf

File tree

5 files changed

+38
-24
lines changed

5 files changed

+38
-24
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM python:3.6-slim-buster
1+
FROM python:3.13-slim
22

33
# ensure unoconv can locate the uno library
4-
ENV PYTHONPATH /usr/lib/python3/dist-packages
4+
ENV PYTHONPATH=/usr/lib/python3/dist-packages
55

66
RUN usermod -d /home www-data \
77
&& chown www-data:www-data /home \
@@ -43,9 +43,9 @@ RUN usermod -d /home www-data \
4343
RUN mkdir -p /code
4444
WORKDIR /code
4545

46-
RUN pip install -U pip==18.1
47-
RUN pip install setuptools==37.0.0
48-
RUN pip install unoconv==0.8.2
46+
RUN pip install -U pip==24.0
47+
RUN pip install setuptools==69.5.1
48+
RUN pip install unoconv==0.9.0
4949

5050
COPY ./requirements.txt /code/
5151

@@ -55,7 +55,7 @@ RUN pip install --no-cache-dir -r ./requirements.txt
5555
COPY ./ /code/
5656

5757
ARG GIT_COMMIT=
58-
ENV GIT_COMMIT ${GIT_COMMIT}
58+
ENV GIT_COMMIT=${GIT_COMMIT}
5959

6060
RUN python setup.py develop
6161

dev-requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ coveralls
99
flake8==3.0.4
1010
ipdb
1111
mccabe
12-
pydevd==0.0.6
12+
pydevd==3.3.0
1313
pyflakes
1414
pytest==2.8.2
1515
pytest-cov==2.2.0
16-
pyzmq==14.4.1
16+
pyzmq==26.1.0

mfr/server/app.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import tornado.web
88
import tornado.httpserver
99
import tornado.platform.asyncio
10-
from raven.contrib.tornado import AsyncSentryClient
10+
11+
import sentry_sdk
12+
from sentry_sdk.integrations.tornado import TornadoIntegration
13+
from sentry_sdk.integrations.logging import LoggingIntegration
1114

1215
from mfr import settings
1316
from mfr.server import settings as server_settings
@@ -46,6 +49,15 @@ def almost_apache_style_log(handler):
4649

4750

4851
def make_app(debug):
52+
sentry_logging = LoggingIntegration(
53+
level=logging.INFO, # Capture INFO level and above as breadcrumbs
54+
event_level=None, # Do not send logs of any level as events
55+
)
56+
sentry_sdk.init(
57+
dsn=settings.SENTRY_DSN,
58+
release=__version__,
59+
integrations=[TornadoIntegration(), sentry_logging, ],
60+
)
4961
app = tornado.web.Application(
5062
[
5163
(r'/static/(.*)', tornado.web.StaticFileHandler, {'path': server_settings.STATIC_PATH}),
@@ -59,7 +71,6 @@ def make_app(debug):
5971
debug=debug,
6072
log_function=almost_apache_style_log,
6173
)
62-
app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=__version__)
6374
return app
6475

6576

mfr/server/handlers/core.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import tornado.web
99
import tornado.iostream
10-
from raven.contrib.tornado import SentryMixin
10+
import sentry_sdk
1111

1212
import waterbutler.core.utils
1313
import waterbutler.server.utils
@@ -76,7 +76,7 @@ def options(self):
7676
self.set_header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE'),
7777

7878

79-
class BaseHandler(CorsMixin, tornado.web.RequestHandler, SentryMixin):
79+
class BaseHandler(CorsMixin, tornado.web.RequestHandler):
8080
"""Base class for the Render and Export handlers. Fetches the file metadata for the file
8181
indicated by the ``url`` query parameter and builds the provider caches. Also handles
8282
writing output and errors.
@@ -159,8 +159,11 @@ async def write_stream(self, stream):
159159
return
160160

161161
def write_error(self, status_code, exc_info):
162-
self.captureException(exc_info) # Log all non 2XX codes to sentry
163162
etype, exc, _ = exc_info
163+
scope = sentry_sdk.get_current_scope()
164+
scope.set_tag('class', etype.__name_)
165+
scope.set_tag('status_code', status_code)
166+
sentry_sdk.capture_exception(exc) # Log all non 2XX codes to sentry
164167

165168
if issubclass(etype, exceptions.PluginError):
166169
try: # clever errors shouldn't break other things

requirements.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
aiohttp==0.18.4
1+
aiohttp==3.10.6
22
chardet==2.3.0
33
furl==0.4.2
44
humanfriendly==2.1
5-
invoke==0.13.0
5+
invoke==2.2.0
66
mako==1.0.1
7-
raven==5.27.0
8-
setuptools==37.0.0
7+
sentry-sdk==2.22.0
8+
setuptools==78.1.0
99
stevedore==1.2.0
10-
tornado==4.3
10+
tornado==6.4.2
1111

1212
# WaterButler
13-
git+https://github.com/CenterForOpenScience/waterbutler.git@0.38.6#egg=waterbutler
13+
git+https://github.com/CenterForOpenScience/waterbutler.git@feature/buff-worms
1414
agent==0.1.2
1515
google-auth==1.4.1
1616

@@ -23,7 +23,7 @@ pydocx==0.7.0
2323

2424
# Image
2525
olefile==0.44
26-
Pillow==4.3.0
26+
Pillow==11.0.0
2727
psd-tools==1.4
2828

2929
# IPython
@@ -36,7 +36,7 @@ jinja2==2.10.1
3636
mistune==0.8.1
3737

3838
# Pdf
39-
reportlab==3.6.5
39+
reportlab==4.2.4
4040

4141
# Pptx
4242
# python-pptx==0.5.7
@@ -45,10 +45,10 @@ reportlab==3.6.5
4545
docutils==0.12
4646

4747
# Tabular
48-
pandas==0.25.1
48+
pandas==2.2.3
4949
xlrd==1.0.0
50-
h5py==2.7.0
51-
scipy==0.19.1
50+
h5py==3.13
51+
scipy==1.14.1
5252

5353
# Md
5454
markdown==2.6.2

0 commit comments

Comments
 (0)