Change celery config to use sqlite backend messaging and results
SQLite database file will be located in /tmp/celery.db Change-Id: I230997f01d2f37efc8897d6c489aee3900bff6c3
This commit is contained in:
parent
c922e90c18
commit
384b4e63e9
4
.config
4
.config
@ -1,3 +1,5 @@
|
|||||||
redis: redis://localhost:6379/1
|
|
||||||
|
celery_broker: sqla+sqlite:////tmp/celery.db
|
||||||
|
celery_backend: db+sqlite:////tmp/celery.db
|
||||||
solar_db: sqlite:////tmp/solar.db
|
solar_db: sqlite:////tmp/solar.db
|
||||||
# solar_db: riak://10.0.0.2:8087
|
# solar_db: riak://10.0.0.2:8087
|
||||||
|
@ -8,8 +8,6 @@ jsonschema==2.4.0
|
|||||||
requests
|
requests
|
||||||
dictdiffer==0.4.0
|
dictdiffer==0.4.0
|
||||||
enum34==1.0.4
|
enum34==1.0.4
|
||||||
redis==2.10.3
|
|
||||||
fakeredis
|
|
||||||
inflection
|
inflection
|
||||||
Fabric==1.10.2
|
Fabric==1.10.2
|
||||||
tabulate==0.7.5
|
tabulate==0.7.5
|
||||||
@ -27,6 +25,8 @@ wrapt
|
|||||||
peewee
|
peewee
|
||||||
# if you want to use lua computable inputs
|
# if you want to use lua computable inputs
|
||||||
# lupa
|
# lupa
|
||||||
|
# required for celery sql backends
|
||||||
|
sqlalchemy
|
||||||
|
|
||||||
|
|
||||||
# if you want to use complex version check in repositories
|
# if you want to use complex version check in repositories
|
||||||
|
@ -23,7 +23,8 @@ import yaml
|
|||||||
CWD = os.getcwd()
|
CWD = os.getcwd()
|
||||||
|
|
||||||
C = Bunch(solar_db="")
|
C = Bunch(solar_db="")
|
||||||
C.redis = 'redis://localhost:6379/1'
|
C.celery_broker = 'sqla+sqlite:////tmp/celery.db'
|
||||||
|
C.celery_backend = 'db+sqlite:////tmp/celery.db'
|
||||||
|
|
||||||
|
|
||||||
def _lookup_vals(setter, config, prefix=None):
|
def _lookup_vals(setter, config, prefix=None):
|
||||||
|
@ -15,14 +15,11 @@
|
|||||||
from celery import Celery
|
from celery import Celery
|
||||||
|
|
||||||
from solar.config import C
|
from solar.config import C
|
||||||
from solar.utils import parse_database_conn
|
|
||||||
|
|
||||||
conn, _ = parse_database_conn(C.redis)
|
|
||||||
_url = 'redis://{}:{}/{}'.format(conn.host, conn.port, conn.database)
|
|
||||||
|
|
||||||
app = Celery(
|
app = Celery(
|
||||||
include=['solar.system_log.tasks', 'solar.orchestration.tasks'],
|
include=['solar.system_log.tasks', 'solar.orchestration.tasks'],
|
||||||
backend=_url,
|
broker=C.celery_broker,
|
||||||
broker=_url)
|
backend=C.celery_backend)
|
||||||
app.conf.update(CELERY_ACCEPT_CONTENT=['json'])
|
app.conf.update(CELERY_ACCEPT_CONTENT=['json'])
|
||||||
app.conf.update(CELERY_TASK_SERIALIZER='json')
|
app.conf.update(CELERY_TASK_SERIALIZER='json')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user