Skip to content

Implement Celery#632

Closed
hover2pi wants to merge 5 commits intomainfrom
celery
Closed

Implement Celery#632
hover2pi wants to merge 5 commits intomainfrom
celery

Conversation

@hover2pi
Copy link
Member

Adding celery to handle server timeout of Contamination Tool calculations.

Also fixes #624 with a quick path change.

@hover2pi hover2pi self-assigned this Jan 28, 2025
@hover2pi hover2pi marked this pull request as draft January 28, 2025 18:04
@hover2pi hover2pi changed the title [WIP]: Implement Celery Implement Celery Feb 25, 2025
@hover2pi hover2pi requested a review from mfixstsci February 25, 2025 19:01
@@ -36,6 +38,21 @@
app_exoctk.config['CACHE_TYPE'] = 'null'
app_exoctk.config['SECRET_KEY'] = 'Thisisasecret!'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't be a secret if it's in a public repo 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, this has been here forever.


# Long-running Celery task
@celery.task
def run_contam_visibility_task(params):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you haven't implemented the task to tun the contam tool quite yet? Did you mean to call the contam tool in place time with the params supplied by the user in the form?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, haha. Not sure how I avoided the timeout in my test though! Line 528 is the task that needs to be put into run_contam_visibility_task. Let me update it and test it.

@hover2pi
Copy link
Member Author

hover2pi commented Feb 25, 2025

@mfixstsci It looks like it's working but I don't think celery is handling the task. Redis has nothing in it's log and just says "OK". Do you see anything suspect?

(exoctk-3.11-celery) jcfilippazzo:exoctk_app jfilippazzo$ celery -A app_exoctk.celery worker --loglevel=info
pandeia not installed. Functionality limited.
**WARNING**: LOCAL JWST PRD VERSION PRDOPSSOC-067 DOESN'T MATCH THE CURRENT ONLINE VERSION PRDOPSSOC-068
Please consider updating pysiaf, e.g. pip install --upgrade pysiaf or conda update pysiaf
330 models loaded from /Users/jfilippazzo/exoctk_data/modelgrid/ATLAS9/
Database loaded: /Users/jfilippazzo/exoctk_data/exoctk_log/exoctk_log.db
 
 -------------- celery@jcfilippazzo.stsci.edu v5.4.0 (opalescent)
--- ***** ----- 
-- ******* ---- macOS-14.5-x86_64-i386-64bit 2025-02-25 17:21:12
- *** --- * --- 
- ** ---------- [config]
- ** ---------- .> app:         app_exoctk:0x13f665290
- ** ---------- .> transport:   redis://localhost:6379/0
- ** ---------- .> results:     redis://localhost:6379/0
- *** --- * --- .> concurrency: 12 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery
                

[tasks]
  . app_exoctk.run_contam_visibility_task

[2025-02-25 17:21:13,608: WARNING/MainProcess] /Users/jfilippazzo/opt/miniconda3/envs/exoctk-3.11-celery/lib/python3.11/site-packages/celery/worker/consumer/consumer.py:508: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
  warnings.warn(

[2025-02-25 17:21:13,615: INFO/MainProcess] Connected to redis://localhost:6379/0
[2025-02-25 17:21:13,616: WARNING/MainProcess] /Users/jfilippazzo/opt/miniconda3/envs/exoctk-3.11-celery/lib/python3.11/site-packages/celery/worker/consumer/consumer.py:508: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
  warnings.warn(

[2025-02-25 17:21:13,619: INFO/MainProcess] mingle: searching for neighbors
[2025-02-25 17:21:14,625: INFO/MainProcess] mingle: all alone
[2025-02-25 17:21:14,638: INFO/MainProcess] celery@jcfilippazzo.stsci.edu ready.

@hover2pi
Copy link
Member Author

Closing in favor of #654 .

@hover2pi hover2pi closed this Sep 25, 2025
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

Successfully merging this pull request may close these issues.

FileNotFoundError with data download utility

2 participants