Merge pull request #2 from coreycb/master

Various updates to get snap and tests working
This commit is contained in:
Pete Vander Giessen 2017-09-05 14:38:02 -04:00 committed by GitHub
commit 3e9c070ae1
15 changed files with 180 additions and 1251 deletions

View File

@ -1,584 +0,0 @@
[DEFAULT]
#
# From cotyledon
#
# Enables or disables logging values of all registered options when starting a
# service (at DEBUG level). (boolean value)
# Note: This option can be changed without restarting.
#log_options = true
# Specify a timeout after which a gracefully shutdown server will exit. Zero
# value means endless wait. (integer value)
# Note: This option can be changed without restarting.
#graceful_shutdown_timeout = 60
#
# From oslo.log
#
# If set to true, the logging level will be set to DEBUG instead of the default
# INFO level. (boolean value)
# Note: This option can be changed without restarting.
#debug = false
# The name of a logging configuration file. This file is appended to any
# existing logging configuration files. For details about logging configuration
# files, see the Python logging module documentation. Note that when logging
# configuration files are used then all logging configuration is set in the
# configuration file and other logging configuration options are ignored (for
# example, logging_context_format_string). (string value)
# Note: This option can be changed without restarting.
# Deprecated group/name - [DEFAULT]/log_config
#log_config_append = <None>
# Defines the format string for %%(asctime)s in log records. Default:
# %(default)s . This option is ignored if log_config_append is set. (string
# value)
#log_date_format = %Y-%m-%d %H:%M:%S
# (Optional) Name of log file to send logging output to. If no default is set,
# logging will go to stderr as defined by use_stderr. This option is ignored if
# log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logfile
#log_file = <None>
# (Optional) The base directory used for relative log_file paths. This option
# is ignored if log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logdir
#log_dir = <None>
# Uses logging handler designed to watch file system. When log file is moved or
# removed this handler will open a new log file with specified path
# instantaneously. It makes sense only if log_file option is specified and
# Linux platform is used. This option is ignored if log_config_append is set.
# (boolean value)
#watch_log_file = false
# Use syslog for logging. Existing syslog format is DEPRECATED and will be
# changed later to honor RFC5424. This option is ignored if log_config_append
# is set. (boolean value)
#use_syslog = false
# Enable journald for logging. If running in a systemd environment you may wish
# to enable journal support. Doing so will use the journal native protocol
# which includes structured metadata in addition to log messages.This option is
# ignored if log_config_append is set. (boolean value)
#use_journal = false
# Syslog facility to receive log lines. This option is ignored if
# log_config_append is set. (string value)
#syslog_log_facility = LOG_USER
# Log output to standard error. This option is ignored if log_config_append is
# set. (boolean value)
#use_stderr = false
# Format string to use for log messages with context. (string value)
#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
# Format string to use for log messages when context is undefined. (string
# value)
#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
# Additional data to append to log message when logging level for the message
# is DEBUG. (string value)
#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
# Prefix each line of exception output with this format. (string value)
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s
# Defines the format string for %(user_identity)s that is used in
# logging_context_format_string. (string value)
#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s
# List of package logging levels in logger=LEVEL pairs. This option is ignored
# if log_config_append is set. (list value)
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,oslo_messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO
# Enables or disables publication of error events. (boolean value)
#publish_errors = false
# The format for an instance that is passed with the log message. (string
# value)
#instance_format = "[instance: %(uuid)s] "
# The format for an instance UUID that is passed with the log message. (string
# value)
#instance_uuid_format = "[instance: %(uuid)s] "
# Interval, number of seconds, of log rate limiting. (integer value)
#rate_limit_interval = 0
# Maximum number of logged messages per rate_limit_interval. (integer value)
#rate_limit_burst = 0
# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG
# or empty string. Logs with level greater or equal to rate_limit_except_level
# are not filtered. An empty string means that all levels are filtered. (string
# value)
#rate_limit_except_level = CRITICAL
# Enables or disables fatal status of deprecations. (boolean value)
#fatal_deprecations = false
[api]
#
# From gnocchi
#
# Path to API Paste configuration. (string value)
#paste_config = /snap/gnocchi/x1/lib/python2.7/site-packages/gnocchi/rest/api-paste.ini
# Authentication mode to use. (string value)
# Allowed values: keystone, noauth, basic
#auth_mode = basic
# The maximum number of items returned in a single response from a collection
# resource (integer value)
#max_limit = 1000
[archive_policy]
#
# From gnocchi
#
# Default aggregation methods to use in created archive policies (list value)
#default_aggregation_methods = mean,min,max,sum,std,count
[cors]
#
# From oslo.middleware.cors
#
# Indicate whether this resource may be shared with the domain received in the
# requests "origin" header. Format: "<protocol>://<host>[:<port>]", no trailing
# slash. Example: https://horizon.example.com (list value)
#allowed_origin = <None>
# Indicate that the actual request can include user credentials (boolean value)
#allow_credentials = true
# Indicate which headers are safe to expose to the API. Defaults to HTTP Simple
# Headers. (list value)
#expose_headers =
# Maximum cache age of CORS preflight requests. (integer value)
#max_age = 3600
# Indicate which methods can be used during the actual request. (list value)
#allow_methods = OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,PATCH
# Indicate which header field names may be used during the actual request.
# (list value)
#allow_headers = X-Auth-Token,X-Subject-Token,X-User-Id,X-Domain-Id,X-Project-Id,X-Roles
[database]
#
# From oslo.db
#
# If True, SQLite uses synchronous mode. (boolean value)
#sqlite_synchronous = true
# The back end to use for the database. (string value)
# Deprecated group/name - [DEFAULT]/db_backend
#backend = sqlalchemy
# The SQLAlchemy connection string to use to connect to the database. (string
# value)
# Deprecated group/name - [DEFAULT]/sql_connection
# Deprecated group/name - [DATABASE]/sql_connection
# Deprecated group/name - [sql]/connection
#connection = <None>
# The SQLAlchemy connection string to use to connect to the slave database.
# (string value)
#slave_connection = <None>
# The SQL mode to be used for MySQL sessions. This option, including the
# default, overrides any server-set SQL mode. To use whatever SQL mode is set
# by the server configuration, set this to no value. Example: mysql_sql_mode=
# (string value)
#mysql_sql_mode = TRADITIONAL
# If True, transparently enables support for handling MySQL Cluster (NDB).
# (boolean value)
#mysql_enable_ndb = false
# Timeout before idle SQL connections are reaped. (integer value)
# Deprecated group/name - [DEFAULT]/sql_idle_timeout
# Deprecated group/name - [DATABASE]/sql_idle_timeout
# Deprecated group/name - [sql]/idle_timeout
#idle_timeout = 3600
# Minimum number of SQL connections to keep open in a pool. (integer value)
# Deprecated group/name - [DEFAULT]/sql_min_pool_size
# Deprecated group/name - [DATABASE]/sql_min_pool_size
#min_pool_size = 1
# Maximum number of SQL connections to keep open in a pool. Setting a value of
# 0 indicates no limit. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_pool_size
# Deprecated group/name - [DATABASE]/sql_max_pool_size
#max_pool_size = 5
# Maximum number of database connection retries during startup. Set to -1 to
# specify an infinite retry count. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_retries
# Deprecated group/name - [DATABASE]/sql_max_retries
#max_retries = 10
# Interval between retries of opening a SQL connection. (integer value)
# Deprecated group/name - [DEFAULT]/sql_retry_interval
# Deprecated group/name - [DATABASE]/reconnect_interval
#retry_interval = 10
# If set, use this value for max_overflow with SQLAlchemy. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_overflow
# Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
#max_overflow = 50
# Verbosity of SQL debugging information: 0=None, 100=Everything. (integer
# value)
# Minimum value: 0
# Maximum value: 100
# Deprecated group/name - [DEFAULT]/sql_connection_debug
#connection_debug = 0
# Add Python stack traces to SQL as comment strings. (boolean value)
# Deprecated group/name - [DEFAULT]/sql_connection_trace
#connection_trace = false
# If set, use this value for pool_timeout with SQLAlchemy. (integer value)
# Deprecated group/name - [DATABASE]/sqlalchemy_pool_timeout
#pool_timeout = <None>
# Enable the experimental use of database reconnect on connection lost.
# (boolean value)
#use_db_reconnect = false
# Seconds between retries of a database transaction. (integer value)
#db_retry_interval = 1
# If True, increases the interval between retries of a database operation up to
# db_max_retry_interval. (boolean value)
#db_inc_retry_interval = true
# If db_inc_retry_interval is set, the maximum seconds between retries of a
# database operation. (integer value)
#db_max_retry_interval = 10
# Maximum retries in case of connection error or deadlock error before error is
# raised. Set to -1 to specify an infinite retry count. (integer value)
#db_max_retries = 20
[healthcheck]
#
# From oslo.middleware.healthcheck
#
# DEPRECATED: The path to respond to healtcheck requests on. (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#path = /healthcheck
# Show more detailed information as part of the response (boolean value)
#detailed = false
# Additional backends that can perform health checks and report that
# information back as part of a request. (list value)
#backends =
# Check the presence of a file to determine if an application is running on a
# port. Used by DisableByFileHealthcheck plugin. (string value)
#disable_by_file_path = <None>
# Check the presence of a file based on a port to determine if an application
# is running on a port. Expects a "port:path" list of strings. Used by
# DisableByFilesPortsHealthcheck plugin. (list value)
#disable_by_file_paths =
[incoming]
#
# From gnocchi
#
# Storage driver to use (string value)
#driver = ${storage.driver}
# Ceph pool name to use. (string value)
#ceph_pool = ${storage.ceph_pool}
# Ceph username (ie: admin without "client." prefix). (string value)
#ceph_username = ${storage.ceph_username}
# Ceph key (string value)
#ceph_secret = ${storage.ceph_secret}
# Ceph keyring path. (string value)
#ceph_keyring = ${storage.ceph_keyring}
# Ceph configuration file. (string value)
#ceph_conffile = ${storage.ceph_conffile}
# Path used to store gnocchi data files. (string value)
#file_basepath = ${storage.file_basepath}
# Swift authentication version to user. (string value)
#swift_auth_version = ${storage.swift_auth_version}
# Swift pre-auth URL. (string value)
#swift_preauthurl = ${storage.swift_preauthurl}
# Swift auth URL. (string value)
#swift_authurl = ${storage.swift_authurl}
# Swift token to user to authenticate. (string value)
#swift_preauthtoken = ${storage.swift_preauthtoken}
# Swift user. (string value)
#swift_user = ${storage.swift_user}
# Swift user domain name. (string value)
#swift_user_domain_name = ${storage.swift_user_domain_name}
# Swift key/password. (string value)
#swift_key = ${storage.swift_key}
# Swift tenant name, only used in v2/v3 auth. (string value)
# Deprecated group/name - [incoming]/swift_tenant_name
#swift_project_name = ${storage.swift_project_name}
# Swift project domain name. (string value)
#swift_project_domain_name = ${storage.swift_project_domain_name}
# Prefix to namespace metric containers. (string value)
#swift_container_prefix = ${storage.swift_container_prefix}
# Endpoint type to connect to Swift (string value)
#swift_endpoint_type = ${storage.swift_endpoint_type}
# Connection timeout in seconds. (integer value)
# Minimum value: 0
#swift_timeout = ${storage.swift_timeout}
# S3 endpoint URL (string value)
#s3_endpoint_url = ${storage.s3_endpoint_url}
# S3 region name (string value)
#s3_region_name = ${storage.s3_region_name}
# S3 access key id (string value)
#s3_access_key_id = ${storage.s3_access_key_id}
# S3 secret access key (string value)
#s3_secret_access_key = ${storage.s3_secret_access_key}
# Prefix to namespace metric bucket. (string value)
#s3_bucket_prefix = ${storage.s3_bucket_prefix}
[indexer]
#
# From gnocchi
#
# Indexer driver to use (string value)
#url = <None>
[metricd]
#
# From gnocchi
#
# Number of workers for Gnocchi metric daemons. By default the available number
# of CPU is used. (integer value)
# Minimum value: 1
#workers = <None>
# How many seconds to wait between scheduling new metrics to process (integer
# value)
#metric_processing_delay = 60
# How many seconds to wait between metric ingestion reporting. Set value to -1
# to disable reporting (integer value)
# Minimum value: -1
#metric_reporting_delay = 120
# How many seconds to wait between cleaning of expired data (integer value)
#metric_cleanup_delay = 300
[oslo_middleware]
#
# From oslo.middleware.http_proxy_to_wsgi
#
# Whether the application is behind a proxy or not. This determines if the
# middleware should parse the headers or not. (boolean value)
#enable_proxy_headers_parsing = false
[oslo_policy]
#
# From oslo.policy
#
# The file that defines policies. (string value)
#policy_file = policy.json
# Default rule. Enforced when a requested rule is not found. (string value)
#policy_default_rule = default
# Directories where policy configuration files are stored. They can be relative
# to any directory in the search path defined by the config_dir option, or
# absolute paths. The file defined by policy_file must exist for these
# directories to be searched. Missing or empty directories are ignored. (multi
# valued)
#policy_dirs = policy.d
[statsd]
#
# From gnocchi
#
# The listen IP for statsd (string value)
#host = 0.0.0.0
# The port for statsd (port value)
# Minimum value: 0
# Maximum value: 65535
#port = 8125
# Resource UUID to use to identify statsd in Gnocchi (unknown value)
#resource_id = <None>
# DEPRECATED: User ID to use to identify statsd in Gnocchi (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#user_id = <None>
# DEPRECATED: Project ID to use to identify statsd in Gnocchi (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#project_id = <None>
# Creator value to use to identify statsd in Gnocchi (string value)
#creator = ${statsd.user_id}:${statsd.project_id}
# Archive policy name to use when creating metrics (string value)
#archive_policy_name = <None>
# Delay between flushes (floating point value)
#flush_delay = 10
[storage]
#
# From gnocchi
#
# Storage driver to use (string value)
#driver = file
# Ceph pool name to use. (string value)
#ceph_pool = gnocchi
# Ceph username (ie: admin without "client." prefix). (string value)
#ceph_username = <None>
# Ceph key (string value)
#ceph_secret = <None>
# Ceph keyring path. (string value)
#ceph_keyring = <None>
# Ceph configuration file. (string value)
#ceph_conffile = /etc/ceph/ceph.conf
# Path used to store gnocchi data files. (string value)
#file_basepath = /var/lib/gnocchi
# Swift authentication version to user. (string value)
#swift_auth_version = 1
# Swift pre-auth URL. (string value)
#swift_preauthurl = <None>
# Swift auth URL. (string value)
#swift_authurl = http://localhost:8080/auth/v1.0
# Swift token to user to authenticate. (string value)
#swift_preauthtoken = <None>
# Swift user. (string value)
#swift_user = admin:admin
# Swift user domain name. (string value)
#swift_user_domain_name = Default
# Swift key/password. (string value)
#swift_key = admin
# Swift tenant name, only used in v2/v3 auth. (string value)
# Deprecated group/name - [storage]/swift_tenant_name
#swift_project_name = <None>
# Swift project domain name. (string value)
#swift_project_domain_name = Default
# Prefix to namespace metric containers. (string value)
#swift_container_prefix = gnocchi
# Endpoint type to connect to Swift (string value)
#swift_endpoint_type = publicURL
# Connection timeout in seconds. (integer value)
# Minimum value: 0
#swift_timeout = 300
# S3 endpoint URL (string value)
#s3_endpoint_url = <None>
# S3 region name (string value)
#s3_region_name = <None>
# S3 access key id (string value)
#s3_access_key_id = <None>
# S3 secret access key (string value)
#s3_secret_access_key = <None>
# Prefix to namespace metric bucket. (string value)
#s3_bucket_prefix = gnocchi
# Number of workers to run during adding new measures for pre-aggregation
# needs. Due to the Python GIL, 1 is usually faster, unless you have high
# latency I/O (integer value)
# Minimum value: 1
#aggregation_workers_number = 1
# Coordination driver URL (string value)
#coordination_url = <None>

View File

@ -1,27 +1,18 @@
setup:
dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
- "{snap_common}/etc/nginx/sites-enabled"
- "{snap_common}/etc/nginx/snap/sites-enabled"
- "{snap_common}/etc/uwsgi/snap"
- "{snap_common}/lib"
- "{snap_common}/lock"
- "{snap_common}/log"
- "{snap_common}/run"
- "{snap_common}/etc/nginx/sites-enabled"
- "{snap_common}/etc/nginx/snap/sites-enabled"
- "{snap_common}/etc/uwsgi/snap"
templates:
gnocchi-snap.conf.j2: "{snap_common}/etc/gnocchi/gnocchi.conf.d/gnocchi-snap.conf"
gnocchi-nginx.conf.j2: "{snap_common}/etc/nginx/snap/sites-enabled/gnocchi.conf"
nginx.conf.j2: "{snap_common}/etc/nginx/snap/nginx.conf"
entry_points:
gnocchi-api:
binary: "{snap}/bin/gnocchi-api"
config-files:
- "{snap}/etc/gnocchi/gnocchi.conf"
config-files-override:
- "{snap_common}/etc/gnocchi/gnocchi.conf"
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
log-file: "{snap_common}/log/gnocchi-api.log"
gnocchi-metricd:
binary: "{snap}/bin/gnocchi-metricd"
config-files:
@ -31,6 +22,39 @@ entry_points:
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
log-file: "{snap_common}/log/gnocchi-metricd.log"
gnocchi-statsd:
binary: "{snap}/bin/gnocchi-statsd"
config-files:
- "{snap}/etc/gnocchi/gnocchi.conf"
config-files-override:
- "{snap_common}/etc/gnocchi/gnocchi.conf"
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
log-file: "{snap_common}/log/gnocchi-statsd.log"
gnocchi-upgrade:
binary: "{snap}/bin/gnocchi-upgrade"
config-files:
- "{snap}/etc/gnocchi/gnocchi.conf"
config-files-override:
- "{snap_common}/etc/gnocchi/gnocchi.conf"
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
gnocchi-change-sack-size:
binary: "{snap}/bin/gnocchi-change-sack-size"
config-files:
- "{snap}/etc/gnocchi/gnocchi.conf"
config-files-override:
- "{snap_common}/etc/gnocchi/gnocchi.conf"
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
gnocchi-config-generator:
binary: "{snap}/bin/gnocchi-config-generator"
config-files:
- "{snap}/etc/gnocchi/gnocchi.conf"
config-files-override:
- "{snap_common}/etc/gnocchi/gnocchi.conf"
config-dirs:
- "{snap_common}/etc/gnocchi/gnocchi.conf.d"
gnocchi-uwsgi:
type: uwsgi
uwsgi-dir: "{snap_common}/etc/uwsgi/snap"

View File

@ -1,7 +1,7 @@
[DEFAULT]
# Set state path to writable directory
state_path = /lib
state_path = {{ snap_common }}/lib
[oslo_concurrency]
# Oslo Concurrency lock path
lock_path = /lock
lock_path = {{ snap_common }}/lock

View File

@ -11,16 +11,6 @@ confinement: strict
grade: devel
apps:
api:
command: snap-openstack gnocchi-api
daemon: simple
plugs:
- network-bind
metricd:
command: snap-openstack gnocchi-metricd
daemon: simple
plugs:
- network
uwsgi:
command: snap-openstack gnocchi-uwsgi
daemon: simple
@ -31,51 +21,75 @@ apps:
daemon: forking
plugs:
- network-bind
gnocchi-config-generator:
command: bin/gnocchi-config-generator
gnocchi-upgrade:
command: bin/gnocchi-upgrade
metricd:
command: snap-openstack gnocchi-metricd
daemon: simple
plugs:
- network
statsd:
command: snap-openstack gnocchi-statsd
daemon: simple
plugs:
- network
upgrade:
command: snap-openstack gnocchi-upgrade
plugs:
- network
change-sack-size:
command: snap-openstack gnocchi-change-sack-size
plugs:
- network
config-generator:
command: snap-openstack gnocchi-config-generator
plugs:
- network
parts:
gnocchi:
plugin: python
python-version: python2
source: http://tarballs.openstack.org/gnocchi/gnocchi-stable-3.1.tar.gz
source: https://pypi.debian.net/gnocchi/gnocchi-4.0.2.tar.gz
python-packages:
- tooz
- oslo.db
- futurist
- keystonemiddleware
- lz4
- python-memcached
- oslo.db
- pymysql
- python-memcached
- sqlalchemy-utils
- tooz
- uwsgi
- git+https://github.com/openstack/snap.openstack#egg=snap.openstack
# constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
constraints: https://raw.githubusercontent.com/openstack/requirements/stable/ocata/upper-constraints.txt
build-packages:
- gcc
- libffi-dev
- libssl-dev
- libxml2-dev
- libxslt1-dev
stage-packages:
- memcached
install: |
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/paste/__init__.py
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/repoze/__init__.py
export SNAP_ROOT="../../.."
export SNAP_ROOT="../../../"
export SNAP_SITE_PACKAGES="$SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages"
# patch -d $SNAP_SITE_PACKAGES -p1 < $SNAP_ROOT/patches/oslo-config-dirs.patch
patch -d $SNAP_SITE_PACKAGES -p1 < $SNAP_ROOT/patches/oslo-config-dirs.patch
templates:
after: [gnocchi]
plugin: dump
source: snap
# Following is an example of including the OpenStack project's config
config:
after: [gnocchi]
plugin: dump
source: http://tarballs.openstack.org/gnocchi/gnocchi-stable-3.1.tar.gz
source: https://pypi.debian.net/gnocchi/gnocchi-4.0.2.tar.gz
organize:
etc/*.conf: etc/gnocchi/
etc/*.ini: etc/gnocchi/
etc/*.json: etc/gnocchi/
etc/*.templates: etc/gnocchi/
gnocchi/rest/*.ini: etc/gnocchi/
gnocchi/rest/*.json: etc/gnocchi/
filesets:
etc:
- etc/gnocchi/*.conf

View File

@ -1,585 +0,0 @@
[DEFAULT]
#
# From cotyledon
#
# Enables or disables logging values of all registered options when starting a
# service (at DEBUG level). (boolean value)
# Note: This option can be changed without restarting.
#log_options = true
# Specify a timeout after which a gracefully shutdown server will exit. Zero
# value means endless wait. (integer value)
# Note: This option can be changed without restarting.
#graceful_shutdown_timeout = 60
#
# From oslo.log
#
# If set to true, the logging level will be set to DEBUG instead of the default
# INFO level. (boolean value)
# Note: This option can be changed without restarting.
#debug = false
# The name of a logging configuration file. This file is appended to any
# existing logging configuration files. For details about logging configuration
# files, see the Python logging module documentation. Note that when logging
# configuration files are used then all logging configuration is set in the
# configuration file and other logging configuration options are ignored (for
# example, logging_context_format_string). (string value)
# Note: This option can be changed without restarting.
# Deprecated group/name - [DEFAULT]/log_config
#log_config_append = <None>
# Defines the format string for %%(asctime)s in log records. Default:
# %(default)s . This option is ignored if log_config_append is set. (string
# value)
#log_date_format = %Y-%m-%d %H:%M:%S
# (Optional) Name of log file to send logging output to. If no default is set,
# logging will go to stderr as defined by use_stderr. This option is ignored if
# log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logfile
#log_file = <None>
# (Optional) The base directory used for relative log_file paths. This option
# is ignored if log_config_append is set. (string value)
# Deprecated group/name - [DEFAULT]/logdir
#log_dir = <None>
# Uses logging handler designed to watch file system. When log file is moved or
# removed this handler will open a new log file with specified path
# instantaneously. It makes sense only if log_file option is specified and
# Linux platform is used. This option is ignored if log_config_append is set.
# (boolean value)
#watch_log_file = false
# Use syslog for logging. Existing syslog format is DEPRECATED and will be
# changed later to honor RFC5424. This option is ignored if log_config_append
# is set. (boolean value)
#use_syslog = false
# Enable journald for logging. If running in a systemd environment you may wish
# to enable journal support. Doing so will use the journal native protocol
# which includes structured metadata in addition to log messages.This option is
# ignored if log_config_append is set. (boolean value)
#use_journal = false
# Syslog facility to receive log lines. This option is ignored if
# log_config_append is set. (string value)
#syslog_log_facility = LOG_USER
# Log output to standard error. This option is ignored if log_config_append is
# set. (boolean value)
#use_stderr = false
# Format string to use for log messages with context. (string value)
#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s
# Format string to use for log messages when context is undefined. (string
# value)
#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
# Additional data to append to log message when logging level for the message
# is DEBUG. (string value)
#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d
# Prefix each line of exception output with this format. (string value)
#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s
# Defines the format string for %(user_identity)s that is used in
# logging_context_format_string. (string value)
#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s
# List of package logging levels in logger=LEVEL pairs. This option is ignored
# if log_config_append is set. (list value)
#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,oslo_messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO
# Enables or disables publication of error events. (boolean value)
#publish_errors = false
# The format for an instance that is passed with the log message. (string
# value)
#instance_format = "[instance: %(uuid)s] "
# The format for an instance UUID that is passed with the log message. (string
# value)
#instance_uuid_format = "[instance: %(uuid)s] "
# Interval, number of seconds, of log rate limiting. (integer value)
#rate_limit_interval = 0
# Maximum number of logged messages per rate_limit_interval. (integer value)
#rate_limit_burst = 0
# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG
# or empty string. Logs with level greater or equal to rate_limit_except_level
# are not filtered. An empty string means that all levels are filtered. (string
# value)
#rate_limit_except_level = CRITICAL
# Enables or disables fatal status of deprecations. (boolean value)
#fatal_deprecations = false
[api]
#
# From gnocchi
#
# Path to API Paste configuration. (string value)
#paste_config = /snap/gnocchi/x1/lib/python2.7/site-packages/gnocchi/rest/api-paste.ini
# Authentication mode to use. (string value)
# Allowed values: keystone, noauth, basic
#auth_mode = basic
# The maximum number of items returned in a single response from a collection
# resource (integer value)
#max_limit = 1000
[archive_policy]
#
# From gnocchi
#
# Default aggregation methods to use in created archive policies (list value)
#default_aggregation_methods = mean,min,max,sum,std,count
[cors]
#
# From oslo.middleware.cors
#
# Indicate whether this resource may be shared with the domain received in the
# requests "origin" header. Format: "<protocol>://<host>[:<port>]", no trailing
# slash. Example: https://horizon.example.com (list value)
#allowed_origin = <None>
# Indicate that the actual request can include user credentials (boolean value)
#allow_credentials = true
# Indicate which headers are safe to expose to the API. Defaults to HTTP Simple
# Headers. (list value)
#expose_headers =
# Maximum cache age of CORS preflight requests. (integer value)
#max_age = 3600
# Indicate which methods can be used during the actual request. (list value)
#allow_methods = OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,PATCH
# Indicate which header field names may be used during the actual request.
# (list value)
#allow_headers = X-Auth-Token,X-Subject-Token,X-User-Id,X-Domain-Id,X-Project-Id,X-Roles
[database]
#
# From oslo.db
#
# If True, SQLite uses synchronous mode. (boolean value)
#sqlite_synchronous = true
# The back end to use for the database. (string value)
# Deprecated group/name - [DEFAULT]/db_backend
#backend = sqlalchemy
# The SQLAlchemy connection string to use to connect to the database. (string
# value)
# Deprecated group/name - [DEFAULT]/sql_connection
# Deprecated group/name - [DATABASE]/sql_connection
# Deprecated group/name - [sql]/connection
#connection = <None>
# The SQLAlchemy connection string to use to connect to the slave database.
# (string value)
#slave_connection = <None>
# The SQL mode to be used for MySQL sessions. This option, including the
# default, overrides any server-set SQL mode. To use whatever SQL mode is set
# by the server configuration, set this to no value. Example: mysql_sql_mode=
# (string value)
#mysql_sql_mode = TRADITIONAL
# If True, transparently enables support for handling MySQL Cluster (NDB).
# (boolean value)
#mysql_enable_ndb = false
# Timeout before idle SQL connections are reaped. (integer value)
# Deprecated group/name - [DEFAULT]/sql_idle_timeout
# Deprecated group/name - [DATABASE]/sql_idle_timeout
# Deprecated group/name - [sql]/idle_timeout
#idle_timeout = 3600
# Minimum number of SQL connections to keep open in a pool. (integer value)
# Deprecated group/name - [DEFAULT]/sql_min_pool_size
# Deprecated group/name - [DATABASE]/sql_min_pool_size
#min_pool_size = 1
# Maximum number of SQL connections to keep open in a pool. Setting a value of
# 0 indicates no limit. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_pool_size
# Deprecated group/name - [DATABASE]/sql_max_pool_size
#max_pool_size = 5
# Maximum number of database connection retries during startup. Set to -1 to
# specify an infinite retry count. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_retries
# Deprecated group/name - [DATABASE]/sql_max_retries
#max_retries = 10
# Interval between retries of opening a SQL connection. (integer value)
# Deprecated group/name - [DEFAULT]/sql_retry_interval
# Deprecated group/name - [DATABASE]/reconnect_interval
#retry_interval = 10
# If set, use this value for max_overflow with SQLAlchemy. (integer value)
# Deprecated group/name - [DEFAULT]/sql_max_overflow
# Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
#max_overflow = 50
# Verbosity of SQL debugging information: 0=None, 100=Everything. (integer
# value)
# Minimum value: 0
# Maximum value: 100
# Deprecated group/name - [DEFAULT]/sql_connection_debug
#connection_debug = 0
# Add Python stack traces to SQL as comment strings. (boolean value)
# Deprecated group/name - [DEFAULT]/sql_connection_trace
#connection_trace = false
# If set, use this value for pool_timeout with SQLAlchemy. (integer value)
# Deprecated group/name - [DATABASE]/sqlalchemy_pool_timeout
#pool_timeout = <None>
# Enable the experimental use of database reconnect on connection lost.
# (boolean value)
#use_db_reconnect = false
# Seconds between retries of a database transaction. (integer value)
#db_retry_interval = 1
# If True, increases the interval between retries of a database operation up to
# db_max_retry_interval. (boolean value)
#db_inc_retry_interval = true
# If db_inc_retry_interval is set, the maximum seconds between retries of a
# database operation. (integer value)
#db_max_retry_interval = 10
# Maximum retries in case of connection error or deadlock error before error is
# raised. Set to -1 to specify an infinite retry count. (integer value)
#db_max_retries = 20
[healthcheck]
#
# From oslo.middleware.healthcheck
#
# DEPRECATED: The path to respond to healtcheck requests on. (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#path = /healthcheck
# Show more detailed information as part of the response (boolean value)
#detailed = false
# Additional backends that can perform health checks and report that
# information back as part of a request. (list value)
#backends =
# Check the presence of a file to determine if an application is running on a
# port. Used by DisableByFileHealthcheck plugin. (string value)
#disable_by_file_path = <None>
# Check the presence of a file based on a port to determine if an application
# is running on a port. Expects a "port:path" list of strings. Used by
# DisableByFilesPortsHealthcheck plugin. (list value)
#disable_by_file_paths =
[incoming]
#
# From gnocchi
#
# Storage driver to use (string value)
#driver = ${storage.driver}
# Ceph pool name to use. (string value)
#ceph_pool = ${storage.ceph_pool}
# Ceph username (ie: admin without "client." prefix). (string value)
#ceph_username = ${storage.ceph_username}
# Ceph key (string value)
#ceph_secret = ${storage.ceph_secret}
# Ceph keyring path. (string value)
#ceph_keyring = ${storage.ceph_keyring}
# Ceph configuration file. (string value)
#ceph_conffile = ${storage.ceph_conffile}
# Path used to store gnocchi data files. (string value)
#file_basepath = ${storage.file_basepath}
# Swift authentication version to user. (string value)
#swift_auth_version = ${storage.swift_auth_version}
# Swift pre-auth URL. (string value)
#swift_preauthurl = ${storage.swift_preauthurl}
# Swift auth URL. (string value)
#swift_authurl = ${storage.swift_authurl}
# Swift token to user to authenticate. (string value)
#swift_preauthtoken = ${storage.swift_preauthtoken}
# Swift user. (string value)
#swift_user = ${storage.swift_user}
# Swift user domain name. (string value)
#swift_user_domain_name = ${storage.swift_user_domain_name}
# Swift key/password. (string value)
#swift_key = ${storage.swift_key}
# Swift tenant name, only used in v2/v3 auth. (string value)
# Deprecated group/name - [incoming]/swift_tenant_name
#swift_project_name = ${storage.swift_project_name}
# Swift project domain name. (string value)
#swift_project_domain_name = ${storage.swift_project_domain_name}
# Prefix to namespace metric containers. (string value)
#swift_container_prefix = ${storage.swift_container_prefix}
# Endpoint type to connect to Swift (string value)
#swift_endpoint_type = ${storage.swift_endpoint_type}
# Connection timeout in seconds. (integer value)
# Minimum value: 0
#swift_timeout = ${storage.swift_timeout}
# S3 endpoint URL (string value)
#s3_endpoint_url = ${storage.s3_endpoint_url}
# S3 region name (string value)
#s3_region_name = ${storage.s3_region_name}
# S3 access key id (string value)
#s3_access_key_id = ${storage.s3_access_key_id}
# S3 secret access key (string value)
#s3_secret_access_key = ${storage.s3_secret_access_key}
# Prefix to namespace metric bucket. (string value)
#s3_bucket_prefix = ${storage.s3_bucket_prefix}
[indexer]
#
# From gnocchi
#
# Indexer driver to use (string value)
url = mysql://gnocchi:changeme@localhost/gnocchi
[metricd]
#
# From gnocchi
#
# Number of workers for Gnocchi metric daemons. By default the available number
# of CPU is used. (integer value)
# Minimum value: 1
#workers = <None>
# How many seconds to wait between scheduling new metrics to process (integer
# value)
#metric_processing_delay = 60
# How many seconds to wait between metric ingestion reporting. Set value to -1
# to disable reporting (integer value)
# Minimum value: -1
#metric_reporting_delay = 120
# How many seconds to wait between cleaning of expired data (integer value)
#metric_cleanup_delay = 300
[oslo_middleware]
#
# From oslo.middleware.http_proxy_to_wsgi
#
# Whether the application is behind a proxy or not. This determines if the
# middleware should parse the headers or not. (boolean value)
#enable_proxy_headers_parsing = false
[oslo_policy]
#
# From oslo.policy
#
# The file that defines policies. (string value)
#policy_file = policy.json
# Default rule. Enforced when a requested rule is not found. (string value)
#policy_default_rule = default
# Directories where policy configuration files are stored. They can be relative
# to any directory in the search path defined by the config_dir option, or
# absolute paths. The file defined by policy_file must exist for these
# directories to be searched. Missing or empty directories are ignored. (multi
# valued)
#policy_dirs = policy.d
[statsd]
#
# From gnocchi
#
resource_id = `uuidgen`
# The listen IP for statsd (string value)
#host = 0.0.0.0
# The port for statsd (port value)
# Minimum value: 0
# Maximum value: 65535
#port = 8125
# Resource UUID to use to identify statsd in Gnocchi (unknown value)
#resource_id = <None>
# DEPRECATED: User ID to use to identify statsd in Gnocchi (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#user_id = <None>
# DEPRECATED: Project ID to use to identify statsd in Gnocchi (string value)
# This option is deprecated for removal.
# Its value may be silently ignored in the future.
#project_id = <None>
# Creator value to use to identify statsd in Gnocchi (string value)
#creator = ${statsd.user_id}:${statsd.project_id}
# Archive policy name to use when creating metrics (string value)
#archive_policy_name = <None>
# Delay between flushes (floating point value)
#flush_delay = 10
[storage]
#
# From gnocchi
#
# Storage driver to use (string value)
#driver = file
# Ceph pool name to use. (string value)
#ceph_pool = gnocchi
# Ceph username (ie: admin without "client." prefix). (string value)
#ceph_username = <None>
# Ceph key (string value)
#ceph_secret = <None>
# Ceph keyring path. (string value)
#ceph_keyring = <None>
# Ceph configuration file. (string value)
#ceph_conffile = /etc/ceph/ceph.conf
# Path used to store gnocchi data files. (string value)
#file_basepath = /var/lib/gnocchi
# Swift authentication version to user. (string value)
#swift_auth_version = 1
# Swift pre-auth URL. (string value)
#swift_preauthurl = <None>
# Swift auth URL. (string value)
#swift_authurl = http://localhost:8080/auth/v1.0
# Swift token to user to authenticate. (string value)
#swift_preauthtoken = <None>
# Swift user. (string value)
#swift_user = admin:admin
# Swift user domain name. (string value)
#swift_user_domain_name = Default
# Swift key/password. (string value)
#swift_key = admin
# Swift tenant name, only used in v2/v3 auth. (string value)
# Deprecated group/name - [storage]/swift_tenant_name
#swift_project_name = <None>
# Swift project domain name. (string value)
#swift_project_domain_name = Default
# Prefix to namespace metric containers. (string value)
#swift_container_prefix = gnocchi
# Endpoint type to connect to Swift (string value)
#swift_endpoint_type = publicURL
# Connection timeout in seconds. (integer value)
# Minimum value: 0
#swift_timeout = 300
# S3 endpoint URL (string value)
#s3_endpoint_url = <None>
# S3 region name (string value)
#s3_region_name = <None>
# S3 access key id (string value)
#s3_access_key_id = <None>
# S3 secret access key (string value)
#s3_secret_access_key = <None>
# Prefix to namespace metric bucket. (string value)
#s3_bucket_prefix = gnocchi
# Number of workers to run during adding new measures for pre-aggregation
# needs. Due to the Python GIL, 1 is usually faster, unless you have high
# latency I/O (integer value)
# Minimum value: 1
#aggregation_workers_number = 1
# Coordination driver URL (string value)
#coordination_url = <None>

View File

@ -0,0 +1,2 @@
[indexer]
url = mysql+pymysql://gnocchi:gnocchi@localhost/gnocchi?charset=utf8

View File

@ -0,0 +1,16 @@
[keystone_authtoken]
auth_uri = http://localhost:5000
auth_url = http://localhost:35357
memcached_servers = localhost:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = gnocchi
password = gnocchi
#[paste_deploy]
#flavor = keystone
[api]
auth_mode = keystone

View File

@ -0,0 +1,2 @@
[statsd]
resource_id = 0a8b55df-f90f-491c-8cb9-7cdecec6fc26

View File

@ -0,0 +1,2 @@
[storage]
file_basepath = /var/snap/gnocchi/common/lib

View File

@ -1,43 +0,0 @@
#!/bin/bash
set -ex
DAEMONS=('snap.gnocchi.api.service', 'snap.gnocchi.metricd.service')
ret=0
sudo mysql -u root <<EOF
DROP DATABASE IF EXISTS gnocchi;
CREATE DATABASE gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' \
IDENTIFIED BY 'changeme';
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' \
IDENTIFIED BY 'changeme';
EOF
while sudo [ ! -d /var/snap/gnocchi/common/etc/gnocchi/ ]; do sleep 0.1; done;
# TODO: this may not be the right dir -- gnocchi doesn't seem to be
# able to see the indexer url that we set (or it might just be the
# wrong file).
sudo cp -r $BASE_DIR/etc/snap-gnocchi/* /var/snap/gnocchi/common/etc/
gnocchi.gnocchi-upgrade
for daemon in "${DAEMONS[@]}"; do
systemctl restart $daemon
TIMEOUT=50
while [ "$TIMEOUT" -gt 0 ]; do
if systemctl is-active $daemon > /dev/null; then
echo "OK"
break
fi
TIMEOUT=$((TIMEOUT - 1))
sleep 0.1
done
if [ "$TIMEOUT" -le 0 ]; then
echo "ERROR: ${daemon} IS NOT RUNNING"
ret=1
fi
done
exit $ret

0
tests/gnocchi_cleanup.sh Normal file → Executable file
View File

10
tests/gnocchi_commands.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -ex
source $BASE_DIR/admin-openrc
gnocchi resource list | grep generic
gnocchi metric create --archive-policy-name high
gnocchi metric list | grep high

25
tests/gnocchi_daemons.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -ex
ret=0
DAEMONS=('snap.gnocchi.uwsgi' 'snap.gnocchi.nginx' 'snap.gnocchi.metricd' 'snap.gnocchi.statsd')
for daemon in "${DAEMONS[@]}"; do
sudo systemctl restart $daemon
TIMEOUT=50
while [ "$TIMEOUT" -gt 0 ]; do
if systemctl is-active $daemon > /dev/null; then
echo "OK"
break
fi
TIMEOUT=$((TIMEOUT - 1))
sleep 0.1
done
if [ "$TIMEOUT" -le 0 ]; then
echo "ERROR: ${daemon} IS NOT RUNNING"
ret=1
fi
done
exit $ret

41
tests/gnocchi_setup.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
set -ex
source $BASE_DIR/admin-openrc
DEBIAN_FRONTEND='noninteractive' sudo -E apt install --yes python-gnocchiclient
sudo mysql -u root << EOF
CREATE DATABASE IF NOT EXISTS gnocchi;
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' \
IDENTIFIED BY 'gnocchi';
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' \
IDENTIFIED BY 'gnocchi';
EOF
while sudo [ ! -d /var/snap/gnocchi/common/etc/gnocchi/ ]; do sleep 0.1; done;
sudo cp -r $BASE_DIR/etc/snap-gnocchi/* /var/snap/gnocchi/common/etc/
openstack user show gnocchi || {
openstack user create --domain default --password gnocchi gnocchi
openstack role add --project service --user gnocchi admin
}
openstack service show metric || {
openstack service create --name gnocchi --description "Metric Service" metric
for endpoint in internal admin public; do
openstack endpoint create --region RegionOne \
metric $endpoint http://localhost:8041 || :
done
}
# Manually define alias if snap isn't installed from snap store.
# Otherwise, snap store defines this alias automatically.
snap aliases gnocchi | grep gnocchi-upgrade || sudo snap alias gnocchi.upgrade gnocchi-upgrade
sudo gnocchi-upgrade
sudo systemctl restart snap.gnocchi.*
while ! nc -z localhost 8041; do sleep 0.1; done;

View File

@ -14,9 +14,14 @@ class SnapstackTest(unittest.TestCase):
gnocchi = Step(
snap='gnocchi',
script_loc='./tests/',
scripts=['gnocchi.sh'],
scripts=['gnocchi_setup.sh',
'gnocchi_daemons.sh',
'gnocchi_commands.sh'],
files=[
'etc/snap-gnocchi/gnocchi/gnocchi.conf'
'etc/snap-gnocchi/gnocchi/gnocchi.conf.d/indexer.conf',
'etc/snap-gnocchi/gnocchi/gnocchi.conf.d/keystone.conf',
'etc/snap-gnocchi/gnocchi/gnocchi.conf.d/statsd.conf',
'etc/snap-gnocchi/gnocchi/gnocchi.conf.d/storage.conf',
],
snap_store=False)