Comments (8)
Note the error You must provide the paste --ini argument
is coming from pyramid-celery here
pyramid_celery/pyramid_celery/__init__.py
Line 105 in cf8aa80
while the got an unexpected keyword argument 'ini'
is coming from Celery
from pyramid_celery.
I'm wondering if a possible path forward is instead of using a preload
options, which seem to add these options to all commands,
celery_app.user_options['preload'].add()
e.g.,
pyramid_celery/pyramid_celery/__init__.py
Lines 25 to 36 in cf8aa80
you could instead specify which particular commands should use your ini and ini_var options as mentioned in https://github.com/celery/celery/blob/e7b47a62d789557cf18ed0e56e2dfb99a51a62f7/docs/userguide/extending.rst#adding-new-command-line-options
ini_option = Option(
('--ini', '-i',),
help='Paste ini configuration file.'
)
ini_var_option = Option(
('--ini-var',),
help='Comma separated list of key=value to pass to ini.'
)
# TODO: Add "shell" to list if Celery developers will add the "allow_extra_args"
# context flag to shell command
# https://github.com/celery/celery/blob/f3a2cf45a69b443cac6c79a5c85583c8bd91b0a3/celery/bin/shell.py#L82
for option in ['worker','beat']:
celery_app.user_options[option].add(
ini_option
)
celery_app.user_options[option].add(
ini_var_option
)
This approach does seem to be working fine for me because Celery's Beat and Worker command already specify
context_settings={
'allow_extra_args': True
}
See for example: https://github.com/celery/celery/blob/f3a2cf45a69b443cac6c79a5c85583c8bd91b0a3/celery/bin/beat.py#L11
I left a TODO above because, currently this isn't working for the shell
command because Celery does not (yet) specify allow_extra_args
in its context settings. See e.g., https://github.com/celery/celery/blob/f3a2cf45a69b443cac6c79a5c85583c8bd91b0a3/celery/bin/shell.py#L82
I've verified this solution works for worker
and beat
commands already and the Celery docs suggest it will work for events
command too. If a feature request were made to Celery for the change to shell
command to add the allow_extra_args
, do you think this could provide a path forward?
from pyramid_celery.
Also, correct me if I am wrong, while shell
does need ini
interaction, to get all the registered tasks, it doesn't seem like purge
functionality would require ini
interaction.
from pyramid_celery.
I've created a feature request ticket in Celery celery/celery#8259
from pyramid_celery.
@sontek, can you comment on the proposed approach?
from pyramid_celery.
The Celery project has now officially release their 5.3.1 https://pypi.org/project/celery/5.3.1
This inability to configure and run purge
or shell
commands with pyramid_celery persists with Celery v5.3.1
from pyramid_celery.
@sontek my pull request to Celery has been merged bringing back preload options support for purge and shell. See celery/celery#8374
I believe no code changes will be needed in pyramid-celery. We still need to confirm once a new release of Celery is available.
from pyramid_celery.
Purge, shell, inspect etc have been restored to accepting ini options from Pyramid-Celery as a result of resolution of celery/celery#8374
from pyramid_celery.
Related Issues (20)
- Environment variable parsing not supported HOT 6
- options for celerybeat? HOT 1
- ini-var interface question HOT 1
- pyramid_celery fails silently when the inifile is not well configured HOT 2
- broker_transport_options seems to not work with celery 4.1 HOT 1
- Trouble with timezones/dst HOT 1
- Release 3.0.1
- Bootstrap pyramid in each worker, instead of in main thread HOT 1
- Failing build
- result_backend config option doesn't work in .ini file HOT 1
- pyramid_celery is not compatible with pyramid 2 HOT 3
- Support custom celeryconfig modules
- Possible typo in changelog
- does this module support python3.8.5 on windows64
- Worker Concurrency configuration on .ini does not work.
- fix deprecation warnings in python3.8 and above
- Current implementation does not support SQS configuration broker transport options
- TypeError: flower() got an unexpected keyword argument 'ini_var' HOT 2
- setting worker config results in worker error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyramid_celery.