fajoy / typhoonae

Automatically exported from code.google.com/p/typhoonae
1 stars 1 forks source link

apptool complaining about celeryconfig module not found #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I was trying out typhoon from trunk to see if it would work on my appengine 
app and ran into to some issues and this last one has me confused.

I created a virtualenv for python2.7 with --no-site-packages --distribute (now 
the default options)

cloned typhoonae into the virtual env.

ran ~/env/bin/python2.7 ./bootstrap.py --distribute && ./bin/buildout

everything built fine after I made the attached changes which may be 
environment specific (Ubuntu oneiric)

from the docs ran 

./bin/apptool parts/demo 

and got 

(default) twillis@twillis-MacBookPro:~/projects/typhoonae.env/src/typhoonae$ 
./bin/apptool parts/demo
/home/twillis/.buildout/eggs/celery-2.3.3-py2.7.egg/celery/loaders/default.py:33
: NotConfigured: No 'celeryconfig' module found! Please make sure it exists and 
is available to Python.
  "is available to Python." % (configname, )))

However apptool seems to by default refer to celeryconfig.py in etc, and it is 
there. 

(default) twillis@twillis-MacBookPro:~/projects/typhoonae.env/src/typhoonae$ ls 
etc
1.latest.demo-supervisor.conf         celeryconfig.py     ejabberd.cfg     
server.conf.in    supervisord.conf.in  versions.cfg
1.latest.hydrant-dev-supervisor.conf  default-nginx.conf  ejabberd.cfg.in  
supervisord.conf  typhoonae.cfg

contents of celeryconfig.py

BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"

CELERY_RESULT_BACKEND = "amqp"
CELERY_IMPORTS = ("typhoonae.taskqueue.celery_tasks",)

CELERYD_LOG_FILE = 
"/home/twillis/projects/typhoonae.env/src/typhoonae/var/log/celeryd.log"
CELERYD_LOG_LEVEL = "INFO"
CELERYD_MAX_TASKS_PER_CHILD = 1000
CELERYD_SOFT_TASK_TIME_LIMIT = None
CELERYD_TASK_TIME_LIMIT = None

CELERY_QUEUES = {
    "default": { "binding_key": "default" }
}
CELERY_DEFAULT_QUEUE = "default"
CELERY_DEFAULT_EXCHANGE = "demo"
CELERY_DEFAULT_EXCHANGE_TYPE = "direct"
CELERY_DEFAULT_ROUTING_KEY = "default"

Attached are changes I had to make in order to get buildout to run 
successfully.(mainly updating memcached version and distribute version) 

Any ideas?

Original issue reported on code.google.com by tom.wil...@gmail.com on 7 Mar 2012 at 1:42

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
`celeryconfig.py` has been generated by `apptools.py` whene you have run the 
command `./bin/apptool parts/demo`

This bug comes because apptool.py load `typhoonae.taskqueue.celery_tasks` to 
use the method `_ParseQueueYaml` to generate the `configcelery.py` but 
`typhoonae.taskqueue.celery_tasks` needs `configcelery.py` ;)

The simple solution a have found to correct this bug is to add an empty 
`configcelery.py` by default in `etc/`

Now I don't know if it is the best solution. Tobias it is good?

You can see my diff on 
http://code.google.com/r/sahidferdjaoui-typhoonae/source/detail?r=7a9ff7f74f1a25
785a832f54b705034bc77e580c

diff -r f9e6d5a7f679 buildout.cfg
--- a/buildout.cfg  Tue Mar 27 17:45:33 2012 +0200
+++ b/buildout.cfg  Wed Mar 28 11:05:03 2012 +0200
@@ -12,6 +12,7 @@
     bdbdatastore
     rabbitmq
     celery
+    celery-config
     ejabberd
     ejabberd-config
     demo
@@ -94,6 +95,11 @@
     celeryd-multi
     celerybeat

+[celery-config]
+recipe = collective.recipe.template
+input = inline:# Do not edit this file .
+output = ${buildout:directory}/etc/celeryconfig.py
+
 [ejabberd]
 recipe = rod.recipe.ejabberd
 url = http://www.process-one.net/downloads/ejabberd/2.1.8/ejabberd-2.1.8.tar.gz

Original comment by sahid.fe...@gmail.com on 28 Mar 2012 at 9:10