Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
storagedriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f1db7c23
authored
Sep 10, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revorking layout
parent
56c496dd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
10 deletions
+36
-10
miscellaneous/storagecelery.conf
+15
-0
storagecelery.py
+19
-0
storagedriver.py
+2
-10
No files found.
miscellaneous/storagecelery.conf
0 → 100644
View file @
f1db7c23
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
storagecelery.py
0 → 100644
View file @
f1db7c23
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'
),
)
)
storagedriver.py
View file @
f1db7c23
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment