Skip to content

[ENG-7595] 3.2.1 BE: MFR Update Dockerfile to py3.13 #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.6-slim-buster
FROM python:3.13-slim

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

RUN usermod -d /home www-data \
&& chown www-data:www-data /home \
Expand Down Expand Up @@ -43,9 +43,9 @@ RUN usermod -d /home www-data \
RUN mkdir -p /code
WORKDIR /code

RUN pip install -U pip==18.1
RUN pip install setuptools==37.0.0
RUN pip install unoconv==0.8.2
RUN pip install -U pip==24.0
RUN pip install setuptools==69.5.1
RUN pip install unoconv==0.9.0

COPY ./requirements.txt /code/

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

ARG GIT_COMMIT=
ENV GIT_COMMIT ${GIT_COMMIT}
ENV GIT_COMMIT=${GIT_COMMIT}

RUN python setup.py develop

Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ coveralls
flake8==3.0.4
ipdb
mccabe
pydevd==0.0.6
pydevd==3.3.0
pyflakes
pytest==2.8.2
pytest-cov==2.2.0
pyzmq==14.4.1
pyzmq==26.1.0
15 changes: 13 additions & 2 deletions mfr/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import tornado.web
import tornado.httpserver
import tornado.platform.asyncio
from raven.contrib.tornado import AsyncSentryClient

import sentry_sdk
from sentry_sdk.integrations.tornado import TornadoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration

from mfr import settings
from mfr.server import settings as server_settings
Expand Down Expand Up @@ -46,6 +49,15 @@ def almost_apache_style_log(handler):


def make_app(debug):
sentry_logging = LoggingIntegration(
level=logging.INFO, # Capture INFO level and above as breadcrumbs
event_level=None, # Do not send logs of any level as events
)
sentry_sdk.init(
dsn=settings.SENTRY_DSN,
release=__version__,
integrations=[TornadoIntegration(), sentry_logging, ],
)
app = tornado.web.Application(
[
(r'/static/(.*)', tornado.web.StaticFileHandler, {'path': server_settings.STATIC_PATH}),
Expand All @@ -59,7 +71,6 @@ def make_app(debug):
debug=debug,
log_function=almost_apache_style_log,
)
app.sentry_client = AsyncSentryClient(settings.SENTRY_DSN, release=__version__)
return app


Expand Down
9 changes: 6 additions & 3 deletions mfr/server/handlers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import tornado.web
import tornado.iostream
from raven.contrib.tornado import SentryMixin
import sentry_sdk

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


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

def write_error(self, status_code, exc_info):
self.captureException(exc_info) # Log all non 2XX codes to sentry
etype, exc, _ = exc_info
scope = sentry_sdk.get_current_scope()
scope.set_tag('class', etype.__name_)
scope.set_tag('status_code', status_code)
sentry_sdk.capture_exception(exc) # Log all non 2XX codes to sentry

if issubclass(etype, exceptions.PluginError):
try: # clever errors shouldn't break other things
Expand Down
22 changes: 11 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
aiohttp==0.18.4
aiohttp==3.10.6
chardet==2.3.0
furl==0.4.2
humanfriendly==2.1
invoke==0.13.0
invoke==2.2.0
mako==1.0.1
raven==5.27.0
setuptools==37.0.0
sentry-sdk==2.22.0
setuptools==78.1.0
stevedore==1.2.0
tornado==4.3
tornado==6.4.2

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

Expand All @@ -23,7 +23,7 @@ pydocx==0.7.0

# Image
olefile==0.44
Pillow==4.3.0
Pillow==11.0.0
psd-tools==1.4

# IPython
Expand All @@ -36,7 +36,7 @@ jinja2==2.10.1
mistune==0.8.1

# Pdf
reportlab==3.6.5
reportlab==4.2.4

# Pptx
# python-pptx==0.5.7
Expand All @@ -45,10 +45,10 @@ reportlab==3.6.5
docutils==0.12

# Tabular
pandas==0.25.1
pandas==2.2.3
xlrd==1.0.0
h5py==2.7.0
scipy==0.19.1
h5py==3.13
scipy==1.14.1

# Md
markdown==2.6.2
Expand Down