Skip to content

Commit

Permalink
fix(docker-image): downgrade Python base image and remove pkg_resourc…
Browse files Browse the repository at this point in the history
…es (#5447)

* fix(docker-image): downgrade Python base image and remove pkg_resources

* Update cli.py

---------

Signed-off-by: Gastón Rial Saibene <[email protected]>
Co-authored-by: Gaston Rial Saibene <n/a>
Co-authored-by: Marc Vilanova <[email protected]>
Co-authored-by: David Whittaker <[email protected]>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent d379716 commit e2e731f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.13.1-slim-bullseye as sdist
FROM python:3.11.10-slim-bullseye as sdist

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Dispatch PyPI Wheel"
Expand Down Expand Up @@ -56,7 +56,7 @@ RUN YARN_CACHE_FOLDER="$(mktemp -d)" \
&& mv /usr/src/dispatch/dist /dist

# This is the image to be run
FROM python:3.13.1-slim-bullseye
FROM python:3.11.10-slim-bullseye

LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.title="Dispatch"
Expand Down
1 change: 1 addition & 0 deletions requirements-base.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jinja2
jira==2.0.0
joblib
jsonpath_ng
lxml==5.3.0
markdown
msal
numpy
Expand Down
1 change: 1 addition & 0 deletions requirements-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ limits==3.13.0
# via slowapi
lxml==5.3.0
# via
# -r requirements-base.in
# emails
# premailer
mako==1.3.6
Expand Down
9 changes: 4 additions & 5 deletions src/dispatch/common/utils/cli.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import traceback
import logging
import pkg_resources
from importlib.metadata import entry_points
from sqlalchemy.exc import SQLAlchemyError

from dispatch.plugins.base import plugins, register


logger = logging.getLogger(__name__)


# Plugin endpoints should determine authentication # TODO allow them to specify (kglisson)
def install_plugin_events(api):
"""Adds plugin endpoints to the event router."""
for plugin in plugins.all():
if plugin.events:
api.include_router(plugin.events, prefix="/{organization}/events", tags=["events"])


def install_plugins():
"""
Installs plugins associated with dispatch
:return:
"""
# Retrieve entry points for 'dispatch.plugins'
dispatch_plugins = entry_points().get("dispatch.plugins", [])

for ep in pkg_resources.iter_entry_points("dispatch.plugins"):
for ep in dispatch_plugins:
logger.info(f"Attempting to load plugin: {ep.name}")
try:
plugin = ep.load()
Expand Down

0 comments on commit e2e731f

Please sign in to comment.