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

job expiration not working #328

Closed
aydas opened this issue Aug 26, 2020 · 17 comments
Closed

job expiration not working #328

aydas opened this issue Aug 26, 2020 · 17 comments

Comments

@aydas
Copy link

aydas commented Aug 26, 2020

Hi ,

I still have problem with WOOEY_JOB_EXPIRATION parameter. I set this to:

user_job_expire=timedelta(hours=1)
anonymous_job_expire=timedelta(minutes=10)

WOOEY_JOB_EXPIRATION = {'user':user_job_expire,'anonymous':anonymous_job_expire}

But no success.
Please help me to fix

Aidas

@zz138960
Copy link

zz138960 commented Sep 7, 2020

task:cleanup-old-jobs run at midnight each day,so the results will not be verified until the next day
celery_app.conf.beat_schedule.update({
'cleanup-old-jobs': {
'task': 'wooey.tasks.cleanup_wooey_jobs',
'schedule': crontab(hour=0, minute=0), # cleanup at midnight each day
},
'cleanup-dead-jobs': {
'task': 'wooey.tasks.cleanup_dead_jobs',
'schedule': crontab(minute='*/10'), # run every 6 minutes
}
})

@aydas
Copy link
Author

aydas commented Sep 7, 2020

Hi,
Thank you for answer.
Problem is that system still keep all competed jobs from beginning (more then month) even after I set WOOEY_JOB_EXPIRATION parameter to 1 hour (in timedelta) for user.
So I guess problem is in parameter format or in celery side or somewhere else.
Please help me to understand how to fix this.

@zz138960
Copy link

zz138960 commented Sep 7, 2020

Please confirm whether the beat command works normally,Has your celery received cleanup_wooey_jobs task or cleanup_dead_jobs task?

@Chris7
Copy link
Member

Chris7 commented Sep 7, 2020

Keep in mind if you are running windows, celery beat is not really supported. I've found some ways to get it running, but the reliability probably varies and is not guaranteed between versions.
https://wooey.readthedocs.io/en/latest/running_wooey.html#through-two-separate-processes

``
On Windows, the --beat option may not be supported and the eventlet pool will need to be specified. This looks like:

celery -A your_project_name worker --pool=eventlet -l info

@aydas
Copy link
Author

aydas commented Sep 7, 2020

wooey is running on ubuntu.
python jobs is running and executed as excepted, Using rabbitmq.
The problem is with scheduled tasks like cleanup-old-jobs only.
Is there any way to check is cleanup-old-jobs started and completed successfully?

@Chris7
Copy link
Member

Chris7 commented Sep 8, 2020

Scheduled tasks should be getting recorded in the celery output. Could you provide how you are running wooey and celery?

@aydas
Copy link
Author

aydas commented Sep 11, 2020

I setup production server on digitalocean droplet. As broker using rabbitmq.
And set supervisor service.
Celery see tasks:
[tasks]
. inovega.wooey_celery_app.debug_task
. wooey.tasks.cleanup_dead_jobs
. wooey.tasks.cleanup_wooey_jobs
. wooey.tasks.submit_script

But log shows wooey.tasks.submit_script tasks only, no other tasks:

[2020-09-11 08:42:02,496: INFO/MainProcess] Received task: wooey.tasks.submit_script[19b1bfd1-fefc-4971-bb84-ec60245b2efa]
[2020-09-11 08:42:03,443: INFO/ForkPoolWorker-1] Task wooey.tasks.submit_script[19b1bfd1-fefc-4971-bb84-ec60245b2efa] succeeded

Any ideas, that is wrong?

Aidas

@Chris7
Copy link
Member

Chris7 commented Oct 4, 2020

How are you invoking hte celery command? I don't see anything indicating the beat option is being used.

@aydas
Copy link
Author

aydas commented Oct 5, 2020 via email

@Chris7
Copy link
Member

Chris7 commented Oct 5, 2020

Hi @aydas ,

You need to add the --beat command to your celery worker. See https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html#starting-the-scheduler. It should be celery -A appname worker -l info --beat

@aydas
Copy link
Author

aydas commented Oct 5, 2020 via email

@aydas
Copy link
Author

aydas commented Oct 5, 2020 via email

@aydas
Copy link
Author

aydas commented Oct 6, 2020 via email

@Chris7
Copy link
Member

Chris7 commented Oct 6, 2020

It seems to be. The management panel of your broker may be a good place to look to see if tasks are piling up there or being sent at all.

@aydas
Copy link
Author

aydas commented Oct 6, 2020 via email

@Chris7
Copy link
Member

Chris7 commented Oct 13, 2020

Hi @aydas ,

I love translations :). The translation system is part of the standard Django package. To add a new translation, you'd do this:

Run django-admin makemessages --locale the_locale_to_add from the wooey directory (where git clone drops you). This will create a directory under wooey/locale/the_locale_name with a .po file. This file is where you enter the human readable text. Following translations, you run django-admin compilemessages --locale the_locale_to_add.

How to add a new translations I think would be a great thing to add to the docs as well.

@aydas
Copy link
Author

aydas commented Oct 15, 2020 via email

@Chris7 Chris7 closed this as completed Jul 18, 2021
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

3 participants