Skip to content
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

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

Merged
merged 13 commits into from
Dec 16, 2024
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
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
Loading