diff options
author | Bin Yang <bin.yang@windriver.com> | 2022-03-21 22:40:51 +0800 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2022-03-22 14:31:13 +0800 |
commit | de7df2bb51ecd068d3eae6cf314b20c744e96927 (patch) | |
tree | b55034272a7d683dba1a95c504c6594d970645d3 /fcaps/fcaps | |
parent | 3bd3e44e2c9533b96f6f6664f9d6ed2150515955 (diff) |
memcached container as sidecar1.5.7
To fix the dependency on memcached which depends on the GPLv3 licensed gdbm indirectly,
Use sidecar to integrate memcached from dockerhub
Add docker-composer scripts to support local test
Issue-ID: MULTICLOUD-1457
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Change-Id: I55a156c0af158535dccfa87e7b9603e47be4d9c1
Diffstat (limited to 'fcaps/fcaps')
-rw-r--r-- | fcaps/fcaps/celery.py | 5 | ||||
-rw-r--r-- | fcaps/fcaps/settings.py | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/fcaps/fcaps/celery.py b/fcaps/fcaps/celery.py index ca3b2e56..93ad6982 100644 --- a/fcaps/fcaps/celery.py +++ b/fcaps/fcaps/celery.py @@ -16,11 +16,14 @@ from __future__ import absolute_import, unicode_literals import os from celery import Celery import logging +from django.conf import settings + # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fcaps.settings') -app = Celery('fcaps') +# app = Celery('fcaps', broker='amqp://guest:guest@localhost:5672//') +app = Celery('fcaps', broker=settings.RABBITMQ_URL) # Using a string here means the worker doesn't have to serialize # the configuration object to child processes. diff --git a/fcaps/fcaps/settings.py b/fcaps/fcaps/settings.py index 37021e05..5e663c61 100644 --- a/fcaps/fcaps/settings.py +++ b/fcaps/fcaps/settings.py @@ -79,9 +79,12 @@ TIME_ZONE = 'UTC' STATIC_URL = '/static/' - DEFAULT_MSB_ADDR = "127.0.0.1" -DEFAULT_CACHE_BACKEND_LOCATION = '127.0.0.1:11211' +# DEFAULT_CACHE_BACKEND_LOCATION = '127.0.0.1:11211' +MEMCACHED_HOST = os.environ.get('MEMCACHED_HOST', '127.0.0.1') +MEMCACHED_PORT = os.environ.get('MEMCACHED_PORT', '11211') +DEFAULT_CACHE_BACKEND_LOCATION = "%s:%s" % (MEMCACHED_HOST, MEMCACHED_PORT) + CACHES = { 'default': { @@ -90,6 +93,14 @@ CACHES = { } } +# [RABBITMQ] +RABBITMQ_DEFAULT_USER = os.environ.get('RABBITMQ_DEFAULT_USER', 'guest') +RABBITMQ_DEFAULT_PASS = os.environ.get('RABBITMQ_DEFAULT_PASS', 'guest') +RABBITMQ_HOST = os.environ.get('RABBITMQ_HOST', 'localhost') +RABBITMQ_PORT = os.environ.get('RABBITMQ_PORT', '5672') +RABBITMQ_URL = "amqp://%s:%s@%s:%s//" % ( + RABBITMQ_DEFAULT_USER, RABBITMQ_DEFAULT_PASS, RABBITMQ_HOST, RABBITMQ_PORT) + # [MSB] DEFAULT_MSB_PROTO = "http" MSB_SERVICE_PROTOCOL = os.environ.get('MSB_PROTO', DEFAULT_MSB_PROTO) |