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

Make Celery backend purely optional #295

Closed
oh2fih opened this issue Jun 30, 2024 · 1 comment
Closed

Make Celery backend purely optional #295

oh2fih opened this issue Jun 30, 2024 · 1 comment

Comments

@oh2fih
Copy link
Collaborator

oh2fih commented Jun 30, 2024

The documentation states that

The use of this backend is optional and CveXplore can function perfectly without one; the tasks it performs can well be handled by another mechanism. It is, however, a nice addition to the functionalities CveXplore offers.

However, the main.py imports

from CveXplore.core.celery_task_handler.task_handler import TaskHandler

that imports

from celery.schedules import schedule, crontab
from redbeat import RedBeatSchedulerEntry
from redbeat.decoder import RedBeatJSONEncoder
from redbeat.schedulers import ensure_conf

The problem is that even if you choose not to use the Celery runners you must have the celery[redis] and celery-redbeat dependencies installed. As the requirements are made modular and the celery is not included in the default, it is possible to install CveXplore without cvexplore[celery], causing a ModuleNotFoundError, e.g.:

Traceback (most recent call last):
  File "cve-search/sbin/db_updater.py", line 28, in <module>
    from CveXplore import CveXplore
  File "/usr/lib/python3/dist-packages/CveXplore/__init__.py", line 1, in <module>
    from CveXplore.main import CveXplore
  File "/usr/lib/python3/dist-packages/CveXplore/main.py", line 47, in <module>
    from CveXplore.core.celery_task_handler.task_handler import TaskHandler
  File "/usr/lib/python3/dist-packages/CveXplore/core/celery_task_handler/task_handler.py", line 12, in <module>
    from celery.schedules import schedule, crontab
ModuleNotFoundError: No module named 'celery'

Furthermore, the work on the celery runners have made CveXplore less modular, as requirements/modules/celery.txt inherits all-db.txt dependencies (MongoDB, MySQL, PostgreSQL & SQLite).

@oh2fih
Copy link
Collaborator Author

oh2fih commented Aug 9, 2024

The problem in the title of this issue has been solved in #297.

I have opened issue #302 for the other problem mentioned to better describe the incomplete part.

@oh2fih oh2fih closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant