Commit f1db7c23 by Guba Sándor

revorking layout

parent 56c496dd
description "CIRCLE Storage Driver Celery Upstart"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 30 30
setuid cloud
chdir /home/cloud/storagedriver
script
. /home/cloud/.virtualenvs/storage/local/bin/postactivate
exec /home/cloud/.virtualenvs/storage/bin/celery -A vmcelery worker --loglevel=info > /home/cloud/log
end script
from celery import Celery
from kombu import Queue, Exchange
from socket import gethostname
from os import getenv
HOSTNAME = gethostname()
AMQP_URI = getenv('AMQP_URI')
celery = Celery('storagedriver', backend='amqp',
broker=AMQP_URI,
include=['storagedriver'])
celery.conf.update(
CELERY_QUEUES=(
Queue(HOSTNAME + '.storage', Exchange(
'storagedriver', type='direct'), routing_key='storagedriver'),
)
)
import jsonpickle
from celery import Celery
from disk import Disk from disk import Disk
from storagecelery import celery
BROKER_URL = 'amqp://nyuszi:teszt@localhost:5672/django'
celery = Celery('tasks', broker=BROKER_URL, backend='amqp')
celery.config_from_object('celeryconfig')
@celery.task() @celery.task()
def list_disks(): def list_disks():
return jsonpickle.encode(Disk.list('/home/cloud/images'), return Disk.list('/home/cloud/images')
unpicklable=False)
@celery.task() @celery.task()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment