#celery

March 9th, 2010

16:38 asksol
>>> chan = establish_connection().create_backend().channel
16:39 asksol
>>> chan.queue_delete("one.sync.down")
16:40 asksol
I think there might be a rabbitmq web interface to do these things
16:40 asksol
if you find one, do share
16:40 harel_
should i be 'binding' those queus as well? doesn' tseem like celery is binding them on startup. i deleted them, restarted celery, and same thing happens.
16:42 asksol
what is your config now
16:42 asksol
?
16:43 asksol
are you sure you don't have anything in "rabbitmqctl list_bindings" interfering?
16:44 harel_
16:44 asksol
you don't have any bindings keys there
16:44 harel_
16:45 harel_
that's what i thought.....
16:45 harel_
i couldn't find anything on tha tin the docs
16:45 asksol
you can use the same exchange for all of them even
16:45 asksol
but using several is just as fine I guess
16:46 asksol
just do "xone.sync.up": {"exchange": "xone.sync.up", "routing_key": "xone.sync.up"}
16:46 asksol
argh
16:46 asksol
just do "xone.sync.up": {"exchange": "xone.sync.up", "binding_key": "xone.sync.up"}
16:47 asksol
if it doesn't work, try to change the queue names
16:47 asksol
because there might be an old binding messing it up
16:48 asksol
the only docs describing this is: http://ask.github.com/celery/faq.html#can-i-sen...
16:55 harel
asksol, sorry i think the last kernel update does not agree with my laptop and it just commited repeated suicide. didn't catch anything after "but using several is just as fine I guess"....
16:57 harel
is it "queue.name" : {"exchange": "queue.name", "binding": "queue.name"} ?
17:26 harel_
found it.... the faq... should have looked before.
22:29 machrider
hi, quick question: where does celery's task list live? in the database? i'm particularly interested in using it with Django.
22:32 asksol
by task list, you mean waiting tasks?
22:32 machrider
yes, sorry if my terminology is off
22:32 asksol
no problem
22:32 machrider
i want to put jobs in a queue, like "send an email to this user"
22:32 machrider
and not have it get lost if the server gets rebooted or whatever
22:33 asksol
in rabbitmq you can't get that list, but we're working an app called celerymon
22:34 asksol
with ghettoq you can use the database to store tasks
22:34 asksol
or redis
22:34 asksol
then you have access to them of course
22:44 machrider
asksol: what about django in particular?
22:44 machrider
i sort of got the impression from the docs that celery stores its data in the django database, but i didn't see it explicitly stated
22:44 machrider
i don't care so much about accessing it, i just care about the persistence of it
23:00 harel_
do you guys know why the #django channel won't let me join?
23:06 SeanOC
harel_: you need to register you nick with the nicksrv, see http://freenode.net/faq.shtml#nicksetup
23:07 harel_
is that a new thing? i don't remember it being like this last i was here...
23:13 flexic
harel_ I think the tasks go to rabbitmq. so celery gets its tasks from rabbitmq. what it uses django for is keeping the tombstones, the results
23:16 harel_
flexic, i think you are ansewring machrider ;o)
23:16 harel_
but thanks anyway ;o))
23:17 flexic
yes, sorry, your'e right
23:17 flexic
I'm trying to deploy using buildout, with celery as an egg. but it keeps installing django 1.1.1 and my app needs 1.2.0
23:18 machrider
flexic: ohhh... so you need rabbitmq first?
23:18 machrider
i was hoping to keep this simple, and rabbitmq looked sort of.. massive
23:18 flexic
i'm going straight for rabbitmq
23:18 flexic
i know what you mean.
23:18 flexic
actually getting that running wasn't difficult
23:20 flexic
the trick is to cleanly start all of these and safely stop / reboot when needed
23:20 machrider
yeah.. plus i just don't like adding deployment complexity if i can avoid it
23:20 machrider
the benefits have to outweight the extra hassle..
23:21 flexic
i've been playing with buildout and its quite promising
23:21 flexic
its the fulfilment of the promise that I'm working on now
23:21 flexic
there are recipes for supervisor so that you can specify your processes in your config file, and it gets deployed with everything else
23:22 flexic
adds supervisor as an egg, builds the config file for that
23:22 flexic
my prob at the moment is that celery seems to have django as a dependency and its fetching 1.1.1
23:23 machrider
interesting
23:23 flexic
the other day I casually added ipython to my beta server. this went in sitepackages.
23:24 flexic
an import happened on some debug page and threw another error and took the beta server down.
23:24 flexic
so I need to not use sitepackages anymore.
23:24 flexic
can't have that exposure
23:24 machrider
it seems like virtualenv is good for that kind of problem
23:24 flexic
buildout makes a safe environment with all the packages you need
23:24 flexic
you can use both
23:24 flexic
or you can use buildout to do the same thing
23:25 flexic
the advantage here is that you can specify everything you need in one config file
23:25 flexic
and you can deploy or make second local dev copies with just a single command
23:28 machrider
yeah, that's cool
23:28 machrider
i'll definitely look into it
23:28 machrider
looking at the docs, it appears celery supports using backends other than AMPQ.. in particular, just using a database
23:28 flexic
23:28 flexic
kind of a quick read/ summary
23:28 machrider
thanks :)
23:30 flexic
just looked it up: redis is an in-memory key value database
23:30 flexic
which saves to disk now and then
23:31 flexic
there was something about setting rabbitmq to save its tasks
23:31 flexic
because otherwise it would get wiped if it gets rebooted
23:33 machrider
that was my fear :)
23:33 machrider
23:33 machrider
i think a database suits my needs, and keeps things fairly simple
23:36 flexic
i'm also concerned myself about not knowing what's going on.
23:37 flexic
db seems more familiar
23:39 asksol
23:39 flexic
awesome, thax !
23:39 asksol
idea was that if django is already installed, celery shouldn't add it to install_requires
23:40 asksol
not sure if it works, but maybe you could try to install django first, if you don't already
23:41 asksol
flexic: rabbitmq has persistence
23:41 asksol
and celery uses it by default, so you can restart rabbitmq without the tasks being lost
23:41 flexic
is it something we have to enable ?
23:41 flexic
ok thx
23:41 asksol
no, it's default
23:41 flexic
i'm using buildout, and i ordered the parts so that django 1.2.0 would go in there
23:42 flexic
or even better my slightly hacked / improved django
23:48 flexic
I'm new to buildout, but I think because celery is an egg, the eggs get installed before it processes the parts
23:48 flexic
and any djangorecipe (with explicit branch/rev) is in a part

March 10th, 2010

00:00 flexic
actually it seems to have worked
00:23 nwilkens
Good day!
00:24 nwilkens
After you schedule a PeriodicTask, can you reschedule it?