Commit f3981a63 authored by Flávio Ramalho's avatar Flávio Ramalho
Browse files

Applies latest changes from Monasca

parent 997cb7d5
## Monasca
monasca_common_git_repo: "https://git.openstack.org/openstack/monasca-common.git"
monasca_statsd_git_repo: "https://git.openstack.org/openstack/monasca-statsd.git"
monasca_api_git_repo: "https://git.openstack.org/openstack/monasca-api.git"
monasca_persister_git_repo: "https://git.openstack.org/openstack/monasca-persister.git"
monasca_notification_git_repo: "https://git.openstack.org/openstack/monasca-notification.git"
......
......@@ -17,11 +17,10 @@
hosts: monasca-agent
user: ubuntu
become: yes
pre_tasks:
pre_tasks:
- name: "Install python 2 when not installed"
raw: "test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)"
changed_when: false
- name: "Gather facts"
setup:
roles:
......
......@@ -21,7 +21,7 @@
pre_tasks:
- name: "Install python 2 when not installed"
raw: "test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)"
changed_when: false
- name: "Gather facts"
setup:
roles:
......
......@@ -15,6 +15,7 @@
## Monasca
monasca_common_git_repo: "https://git.openstack.org/openstack/monasca-common.git"
monasca_statsd_git_repo: "https://git.openstack.org/openstack/monasca-statsd.git"
monasca_api_git_repo: "https://git.openstack.org/openstack/monasca-api.git"
monasca_persister_git_repo: "https://git.openstack.org/openstack/monasca-persister.git"
monasca_notification_git_repo: "https://git.openstack.org/openstack/monasca-notification.git"
......@@ -85,6 +86,7 @@ monasca_system_user_home: "/var/lib/{{ monasca_system_user_name }}"
pip_install_options: ""
monasca_required_pip_packages:
- "--upgrade pip"
- virtualenv
- virtualenv-tools
- httplib2
......@@ -93,4 +95,3 @@ monasca_required_pip_packages:
monasca_pip_packages:
- python-keystoneclient
- keystoneauth1
- simport
......@@ -21,6 +21,9 @@
- "gunicorn"
- "influxdb==2.8.0"
- "PyMySQL"
- "six>=1.10.0"
- "file://{{ monasca_common_tarball.stdout }}"
- "file://{{ monasca_statsd_tarball.stdout }}"
tags:
- monasca-api-pip-packages
- monasca-install-api
......
......@@ -20,4 +20,33 @@
register: common_result
changed_when: "common_result.rc == 0"
tags:
- monasca-install-common
- monasca-install-libraries
- name: Create monasca libraries tarball
command: "/opt/venvs/monasca-api/bin/python setup.py sdist"
args:
chdir: "/opt/cloned-repos/monasca-{{ item }}"
with_items:
- "common"
- "statsd"
register: result
changed_when: "result.rc == 0"
tags:
- monasca-libraries-tarball
- monasca-install-libraries
- name: Get monasca-common tarball file name
shell: "ls -td /opt/cloned-repos/monasca-common/dist/monasca-common*.tar.gz | head -1"
register: monasca_common_tarball
changed_when: false
tags:
- monasca-common-install
- monasca-install-libraries
- name: Get monasca-statsd tarball file name
shell: "ls -td /opt/cloned-repos/monasca-statsd/dist/monasca-statsd*.tar.gz | head -1"
register: monasca_statsd_tarball
changed_when: false
tags:
- monasca-statsd-install
- monasca-install-libraries
......@@ -19,6 +19,8 @@
virtualenv: "/opt/venvs/monasca-notification"
with_items:
- "mysql-python"
- "file://{{ monasca_common_tarball.stdout }}"
- "file://{{ monasca_statsd_tarball.stdout }}"
tags:
- monasca-notification-pip-packages
- monasca-install-notification
......
......@@ -19,6 +19,8 @@
virtualenv: "/opt/venvs/monasca-persister"
with_items:
- "influxdb==2.8.0"
- "six>=1.10.0"
- "file://{{ monasca_common_tarball.stdout }}"
tags:
- monasca-persister-pip-packages
- monasca-install-persister
......
......@@ -30,7 +30,7 @@
- include: install_storm.yml
- include: install_influxdb.yml
- include: install_schema.yml
- include: install_monasca_common.yml
- include: install_monasca_libraries.yml
- include: install_monasca_api.yml
- include: install_monasca_persister.yml
- include: install_monasca_notification.yml
......
......@@ -197,6 +197,9 @@
- repo: "{{ monasca_common_git_repo }}"
dest: "monasca-common"
version: "{{ monasca_git_branch }}"
- repo: "{{ monasca_statsd_git_repo }}"
dest: "monasca-statsd"
version: "{{ monasca_git_branch }}"
- repo: "{{ monasca_api_git_repo }}"
dest: "monasca-api"
version: "{{ monasca_git_branch }}"
......
......@@ -4,8 +4,7 @@
name = monasca_api
[pipeline:main]
# Add validator in the pipeline so the metrics messages can be validated.
pipeline = auth keystonecontext api
pipeline = request_id auth api
[app:api]
paste.app_factory = monasca_api.api.server:launch
......@@ -13,8 +12,8 @@ paste.app_factory = monasca_api.api.server:launch
[filter:auth]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
[filter:keystonecontext]
paste.filter_factory = monasca_api.middleware.keystone_context_filter:filter_factory
[filter:request_id]
paste.filter_factory = oslo_middleware.request_id:RequestId.factory
[server:main]
use = egg:gunicorn#main
......
......@@ -5,11 +5,10 @@ keys = root, sqlalchemy, kafka
keys = console, file
[formatters]
keys = generic
keys = context
[logger_root]
level = DEBUG
formatter = default
handlers = console, file
[logger_sqlalchemy]
......@@ -18,14 +17,12 @@ qualname = sqlalchemy.engine
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)
level = DEBUG
formatter = default
handlers = console, file
propagate=0
[logger_kafka]
qualname = kafka
level = DEBUG
formatter = default
handlers = console, file
propagate = 0
......@@ -33,14 +30,14 @@ propagate = 0
class = logging.StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic
formatter = context
[handler_file]
class = logging.handlers.RotatingFileHandler
level = DEBUG
formatter = generic
formatter = context
# store up to 5*100MB of logs
args = ('/var/log/monasca/api/monasca-api.log', 'a', 104857600, 5)
[formatter_generic]
format = %(asctime)s %(levelname)s [%(name)s][%(threadName)s] %(message)s
[formatter_context]
class = oslo_log.formatters.ContextFormatter
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 to comment