Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Simon János
/
orchestrator
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
553e5137
authored
Dec 17, 2016
by
Simon János
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
task queue util added
parent
6e4f4ff0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
orchestrator/util/__init__.py
+0
-0
orchestrator/util/task_client.py
+23
-0
tox.ini
+3
-2
No files found.
orchestrator/util/__init__.py
0 → 100644
View file @
553e5137
orchestrator/util/task_client.py
0 → 100644
View file @
553e5137
from
celery
import
Celery
from
oslo_config
import
cfg
RPC_CLI_OPTS
=
[
cfg
.
URIOpt
(
'broker-url'
,
dest
=
'broker_url'
,
default
=
'amqp://cloud:password@localhost:5672/circle'
),
# cfg.URIOpt('broker-url', dest='broker_url', default='amqp://guest:guest@localhost:5672//')
cfg
.
IntOpt
(
'operation-timeout'
,
dest
=
'operation_timeout'
,
default
=
'30'
,
help
=
'Operation timeout in seconds'
),
]
cfg
.
CONF
.
register_cli_opts
(
RPC_CLI_OPTS
,
'rpc'
)
cfg
.
CONF
.
register_opt
(
cfg
.
StrOpt
(
'datastore-root'
,
dest
=
'datastore_root'
,
default
=
'/datastore'
,
help
=
'Path to datastore dir on storage node'
),
'storage'
)
class
Tasks
(
object
):
QUEUE
=
Celery
(
'orchestrator'
,
broker
=
cfg
.
CONF
.
rpc
.
broker_url
)
QUEUE
.
conf
.
update
(
CELERY_RESULT_BACKEND
=
'amqp'
,
CELERY_TASK_RESULT_EXPIRES
=
300
)
@staticmethod
def
send_task
(
name
,
args
=
None
):
return
Tasks
.
QUEUE
.
send_task
(
name
,
args
=
args
,
queue
=
'cloud-9583.vm.fast'
)
tox.ini
View file @
553e5137
...
...
@@ -3,16 +3,17 @@ envlist = py27, py34
[dependencies]
production
=
enum34
aenum
voluptuous
oslo.config
oslo.log
falcon
; celery
celery
=
=3.1.17
test
=
pytest
pytest-pylint
flake8
mockito
; flower
[testenv]
...
...
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