Commit Graph

53 Commits

Author SHA1 Message Date
Pedro Henrique 3114c3f979 Add grenade tests
Change-Id: I427d4b91cc5da9e9b2ffdb4239a5256ab44a1e06
2024-03-05 18:06:11 +01:00
Zuul 85ad6904fd Merge "Add support to InfluxDB v2 as storage backend" 2024-02-19 16:03:46 +00:00
Pedro Henrique 101a410739 Add support to InfluxDB v2 as storage backend
This patch allows CloudKitty to use InfluxDB v2 with Flux queries. This
type of query uses less CPU and RAM to be processed in the InfluxDB
backend.

Change-Id: I8ee3c92776aa69afbede353981a5fcd65dd7d099
Depends-On: https://review.opendev.org/c/openstack/requirements/+/895629
Story: 2010863
Task: 48539
2024-02-19 15:30:37 +01:00
Pedro Henrique 25a7306412 Fix devstack runprocess for cloudkitty api
After the commit
8778c64776

The module PBR in openstack started to validating the parameters when
creating an embedded WSGI, now if invalid arguments are given
to the cloudkitty-api it raises an error as we are facing in the
devstack when using `CLOUDKITTY_USE_MOD_WSGI=False`:

cloudkitty-api[86126]: usage: cloudkitty-api [-h] [--port PORT] [--host IP] -- [passed options]
cloudkitty-api[86126]: cloudkitty-api: error: unrecognized arguments: --config-file=/etc/cloudkitty/cloudkitty.conf

This PR also extracts the upgrade database workflow to a function
to be used in grenade tests

Change-Id: Ifc1a8563a9efcae2abaa6f8eb036405a93ff296d
2024-02-12 10:33:48 -03:00
Matt Crees 964c6704a2 Add OpenSearch as a v2 storage backend
To facilitate the switch from Elasticsearch to OpenSearch, the ES
backend has been duplicated and renamed where appropriate to OpenSearch.

The OpenSearch implementation was modified in places for compatibility
with OpenSearch 2.x, for example:

- remove mapping name from bulk API URL
- replace put_mapping by post_mapping

This will allow for the future removal of the Elasticsearch backend.

Change-Id: I88b0a30f66af13dad1bd75cde412d2880b4ead30
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>
2023-11-27 15:19:14 +01:00
Rafael Weingärtner 94630b97cd Use DevStack VENV path
DevStack is moving to adopt VENV to manage its python versions.
However, CloudKittty DevStack integration was not using the
DevStack VENV variable. This, in turn, causes issues with tempest
tests, as they are based on a DevStack deployment.

We need to merge this patch to fix the tempest tests.

Change-Id: I17de617557fb86c002814941325d71e3c08e0e72
2023-08-23 17:01:01 -03:00
Pierre Riteau 5fdb65b71a CI: deploy OpenSearch 1.x instead of Elasticsearch
Change DevStack plugin to deploy OpenSearch 1.x instead of Elasticsearch
when using the elasticsearch storage driver. This is in preparation for
supporting OpenSearch instead of Elasticsearch. Note that CloudKitty
does not work with OpenSearch 2.x yet, likely due to the removal of
mapping types [1].

[1] https://opensearch.org/docs/2.0/breaking-changes/#remove-mapping-types-parameter

Change-Id: I572cba384a9a16ee2bbfe07b5c316ed5abbb5681
2022-12-06 10:33:04 +01:00
Zuul fd58a2004c Merge "Replace deprecated devstack authtoken function" 2019-09-24 14:17:50 +00:00
Luka Peschke cb858a918b Replace deprecated devstack authtoken function
Change-Id: Ib310d3c6170b17ede3dd74d8fdb96bd74ce31155
2019-09-24 10:37:42 +02:00
Luka Peschke d252f59b6e Add support for Elasticsearch to devstack plugin
This adds support for the elasticsearch v2 storage driver to the devstack
plugin. Two non-voting check jobs running a the tempest test suite
against a devstack deployment using the elasticsearch driver have also been
added.

Story: 2006332
Task: 36078
Task: 36080
Change-Id: Ib531f83e2c8e5c2494b36af250d7630e32f49f40
2019-09-18 09:19:52 +02:00
caoyuan 8243e18d78 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I12e967cd13f063298fa81689646191c81316468a
2019-04-24 14:13:58 +08:00
Luka Peschke 4c69a86fcc [devstack] Setting [collect]/wait_periods to 0 by default
This is done in order to get quicker results when creating a devstack.
Production deployments should keep the default value.

Change-Id: I899311ba1d87f23133b650567a63863005caf56c
2019-03-27 17:05:07 +01:00
Luka Peschke 87ab314fcf Update the devstack plugin
This updates various parts of the devstack plugin:

* The fetcher is now configurable via the "CLOUDKITTY_FETCHER" variable and
  defaults to gnocchi (this allows the user to have immediate results).

* The "CLOUDKITTY_SERVICES" variable was removed as it is not used anymore.

* The storage backend does now default to "influxdb". If this storage backend is
  selected, influxdb is installed. This can be done on fedora and ubuntu. The
  storage backend to use in devstack can be configured through the
  ``CLOUDKITTY_STORAGE_BACKEND`` and ``CLOUDKITTY_STORAGE_VERSION`` variables.

* Some details about available variables have been added to the devstack
  documentation. Since the "admin/quick_deployment" section did only contain
  the devstack documentation, it has been removed for now.

* Given that the "ceilometer-low" archive-policy (default in devstack) only
  provides the "mean" aggregation method, it is now the aggregation method
  used in the default metrics.yml file.

Change-Id: I37452772de163b5fafc502917af870c86a3d38b2
2019-03-21 09:18:32 +00:00
Dao Cong Tien b3ae81dc92 Adds doc8 check to pep8
This patch adds doc8 check for .rst files to pep8.
Files that fail doc8 check are also fixed.

Change-Id: Ib8556b6eac0fb5a9bd3b7f8dcf000ab1b23e23bc
2018-10-22 11:14:57 +02:00
Martin CAMEY fb0b176ac7 Change configuration section names
In order to respect the convention [backendtype_backendname]
for all collectors and storage backends in Cloudkitty configuration
some sections names has changed.

  * For the Gnocchi collector, [collector_gnocchi] has been added
    in addition to [gnocchi_collector].
    This last one will be removed in the future.

  * For the hybrid storage, [storage_hybrid] has been added
    in addition to [hybrid_storage].
    This last one will be removed in the future.

  * For the keystone fetcher, [fetcher_keystone] has been added
    in addition to [keystone_fetcher].
    This last one will be removed in the future.

  * For the hybrid storage, [fetcher_source] has been added
    in addition to [source_fetcher].
    This last one will be removed in the future.

  * Fix Prometheus section name.

Change-Id: I3435a151de4b384f2f2540225504abe6c99b928e
Story: 2001053
Task: 4654
2018-10-15 10:47:11 +02:00
zhu.boxiang f1e7d3ef11 Hard to read README from github because of wrong format
Replace three spaces with four spaces.

Change-Id: Ic657ec34aa1b1ee32dca4235aaccd558250f7736
2018-09-12 11:41:15 +08:00
Luka Peschke 3ab4774f66 Adding a v2 storage backend
This adds a v2 storage interface as well as a gnocchi backend for it to
cloudkitty. This new interface will allow us to implement the v2 API, which will
be more metric-oriented.

This new storage uses the new dataframe format ('desc' is now split up into
'groupby' and 'metadata', following the collect logic); and supports grouping,
filters and pagination.

Modifications:

  * The tenant/scope state management isn't handled by the storage backend
    anymore. A StateManager object has been added.

  * All internal interactions with the storage backend use the v2 interface.
    An adapter class has been added to ensure retrocompatibility with the
    v1 interface.

  * A base class for functional tests testing the v2 storage interface has been
    added. It contains generic tests, which should allow easier testing for new
    v2 backends.

  * Some developer documentation explaining how to implement a v2 storage
    backend has been added. User documentation will be updated once the v2
    storage backend is considered stable.

The v1 is still the default storage version. Note that this new version is
considered unstable and should only be used for upstream development.

Change-Id: I5e9b95c79292582fab3017289d35ee310e35ffea
Story: 2001372
Task: 6585
Task: 14361
Task: 24535
2018-08-22 12:11:25 +02:00
François Magimel ae09b39f55 Remove tail_log in the devstack plugin script
This function is deprecated and will be removed after Queens.

Change-Id: I780c0ce7fe618bd0cd23194224d8ed14c3723cdc
2018-08-21 09:27:16 +00:00
Luka Peschke 87bbf23bfa Add storage configuration option to devstack plugin
This adds the CLOUDKITTY_STORAGE_BACKEND option to CloudKitty's devstack
plugin, allowing users to choose the storage backend they want to use.

Change-Id: I442131cfbbb6f6229a5e8e2a9efe4a4b33338ac9
2018-06-28 14:41:36 +00:00
Luka Peschke 0b978000a8 Update Devstack documentation and README
CloudKitty's ceilometer collector and Gnocchi's devstack plugin do not exist
anymore, so the documentation has been updated accordingly.

Change-Id: Ief49cffae2a7c5a5a292eae5850ef10e21f275bb
2018-04-03 14:28:09 +02:00
Luka Peschke dd64aaa3d5 Remove Ceilometer collector and transformer
As announced during the Queens cycle, all ceilometer-collector
related code has been removed.

Change-Id: I03f9a89ae4bc970fbc421dd6964be95cdacfe758
Task: 6293
Story: 2001503
2018-03-07 09:14:02 +00:00
ghanshyam 93d420b361 Remove use of unsupported TEMPEST_SERVICES variable
TEMPEST_SERVICES global variable is not supported
by devstack since long back.
- I380dd20e5ed716a0bdf92aa02c3730359b8136e4
- I9c24705e494689f09a885eb0a640efd50db33fcf

Service availability of tempest known services will be
set by devstack with local check.
- I02be777bf93143d946ccbb8e9eff637bfd1928d4

cloudkitty does not have tempest plugin so it does
not need to have service register in tempest.

This commit removes the TEMPEST_SERVICES setting.

Change-Id: Ica3d142ad1c95379771fc1f045dd7e80ca0452a5
Related-Bug: #1743688
2018-01-23 16:47:08 +03:00
Jeremy Liu 7eca672645 Policy in code
This patch introduces the implementation for registering
default policy rules in code. Default rules are defined under
cloudkitty.common.policies. Each API's policies are defined in a
sub-folder under that path and __init__.py contains all the
default policies in code which are registered in the ``init``
enforcer function in cloudkitty/common/policy.py.

This commit does the following:
 - Creates the ``policies`` module that contains all the default
   policies in code.
 - Adds the base policy rules into code (context_is_admin,
   admin_or_owner and default rules).
 - Add policies in code for current APIs
 - Add a tox env to generate default policy sample file
 - Delete policy.json from repo as policies in code will be used.

Change-Id: I257e8cefc2b699fc979c717531cd9ba77233d94b
Implements: blueprint policy-in-code
2017-12-08 16:45:13 +00:00
Martin CAMEY b8c848f9ec Split metrology configuration from CK config file
To avoid source code updates with metrology conf update,
the metrology configuration is separated from Cloudkitty
configuration file and placed in a yaml one.

Task: 5724
Story: 2001215

Change-Id: Icc098c40bc52c2589e89d705d9d711d0ce2fb557
2017-11-28 16:49:29 +01:00
Luka Peschke e5e90e8813 Fix Devstack plugin
When using mod-wsgi with devstack, apache is configured and restarted just
after cloudkitty-processor is started, causing a ConnexionRefused error when
ck-proc tries to authenticate against keystone and making the devstack fail.
This adds a sleep to avoid this issue.

Change-Id: I080a364be2f783610252a40dc70f2eb5babd1467
2017-11-15 18:16:29 +01:00
Luka Peschke a3a1ee6416 Update devstack/README.rst
* Horizon is enabled by default, so there is no need to enable it.
       * The Gnocchi plugin should be enabled
       * The CloudKitty services need to be enabled

Change-Id: I2b0bac8c8c62479a4701f66efc2703e12ecbaaa3
2017-10-24 17:38:28 +02:00
Martin CAMEY 5baa3b8fe3 Allow authentification method to be chosen
To reach Cloudkitty API endpoints, an authentification method must be set.
No authentification or Keystone authentification are allowed.
This should be set in the configuration file, within the DEFAULT block,
using the auth_strategy field.

Task: 4902
Story: 2001168

Change-Id: I3f9d5700e4c2d1a69b5514fd9932a62238ee659c
2017-09-25 18:15:20 +02:00
zhangguoqing 2dc80310ba Add WSGI support for `cloudkitty-api'
Recommands to setup cloudkitty through an other WSGI services
like Apache 'mod_wsgi'. And the community has set a community wide goal
in Pike cycle: "Control Plane API endpoints deployment via WSGI"
https://governance.openstack.org/tc/goals/pike/deploy-api-in-wsgi.html

Work Item: Add WSGI support
1. Provide WSGI application script file.
2. Removing the cloudkitty-api command line.
3. Adding cloudkitty-api wsgi_scripts, by 'cloudkitty-api -p 8889' to run.

Work Item: Make the devstack setup ck-api with wsgi
1. Switch devstack jobs to deploy control-plane API services in WSGI with Apache.
2. Default to deploy with Apache by global ENABLE_HTTPD_MOD_WSGI_SERVICES, in
   local.conf expose CLOUDKITTY_USE_MOD_WSGI=False to run without Apache.

Work Item: Update the docs about installation
1. Installing the cloudkitty-api behind mod_wsgi.
2. Updating the installation about the cloudkitty-api.

Implements: blueprint wsgi-support
Change-Id: I207587c5360bb80c0e856cd0239e4073578951aa
2017-07-18 12:55:11 +02:00
Maxime Cottret 4734be4ffa Fix devstack: replace deprecated screen functions
Since [1], systemd is the default process init. Therefore,
CK devstack plugin still uses screen_it function instead of
generic run_process function. This leads to strange behavior
of the plugin.

This patch fixes this problem.

[1] https://review.openstack.org/#/c/461716/

Story: 2001047
Task: 4634

Change-Id: I57c71c85f2a31cd90afeaf7f32754f1f1a503753
2017-05-31 11:17:24 +02:00
Maxime Cottret 27a50b4354 Fixing the gate
A recent patch in devstack [1] forces the use of path access instead
of port for Keystone authentication, leading to connection error in CK
when launching the devstack.

Now CK devstack plugin uses $KEYSTONE_SERVICE_URI to support now and
future keystone devstack modification.

[1] https://review.openstack.org/#/c/456344/

Change-Id: I7ef964185b029036e7ea7abfb555162e9f2d6ec6
2017-04-19 16:09:18 +02:00
Jenkins a6b12879b5 Merge "Generate the needed configuration files for devstack" 2017-01-08 18:33:44 +00:00
Christophe Sauthier 6761087472 Generate the needed configuration files for devstack
Generate the needed configuration files for devstack.

Change-Id: I250b70f4a937f0d5a006ca74d7fc5d6b8293e2c8
Closes-Bug: #1654742
2017-01-08 13:38:07 +01:00
Jenkins 4b8d5dcfa6 Merge "devstack: support the gnocchi collector" 2017-01-02 11:58:03 +00:00
Gauvain Pocentek f9a16c5d50 devstack: support the gnocchi collector
Actually use CLOUDKITTY_COLLECTOR to setup the ceilometer/gnocchi
collectors.

Update the documentation accordingly.

Change-Id: I7308c0597c0ae9dac435cf1c0cc2e3b4c07ba063
2016-12-13 22:35:09 +00:00
Christophe Sauthier 8e38bd4e61 Use keystone v3 instead of keystone v2 in cloudkitty's devstack plugin
Change-Id: I4b5bc6430144a41aa16c69900489fcc54febf561
Closes-Bug: #1649053
2016-12-12 17:14:24 +01:00
Jeremy Liu 85920c9626 Fix devstack plugin compatibility
'KEYSTONE_CATALOG_BACKEND' was removed recently [1],
so delete the reference in CloudKitty as it was done
in devstack [2].

[1] https://review.openstack.org/#/c/391380/
[2] https://review.openstack.org/#/c/278333/

Change-Id: Ie6dbcc5a2a1e2958a9a3fa9e9f40f71ad57b5ebb
Closes-Bug: #1644194
2016-11-23 21:26:29 +08:00
Guillaume Espanel d6b61b97b7 Use local.conf instead of localrc in devstack doc
The plugin.sh file contained a reference to the localrc configuration
file, but devstack is now configured by a local.conf file.

Change-Id: I37a73b9ef1dc1f8f1a6f640f65240997e132e9fd
2016-08-24 11:01:17 +00:00
Michael Rice ab38996aaf Changes default port from 8888 to 8889
Closes-Bug: 1566705
Change-Id: I0a1e5ba643f3222bb494d16e89194a96f9395d5b
2016-06-29 14:53:00 +02:00
Stéphane Albert 097e395cee Fix devstack cleanup of data dir
Remove wasn't recursive and failing on a second run.

Change-Id: Ieb125cc78a5db2d5d93c244a71a8a2ca027d600c
2016-04-18 17:03:32 +02:00
Stéphane Albert 1a9c279236 Fixed devstack not creating folder for tooz locks
Change-Id: I6f0f2703b4d23ab9722ecbb3f2137b793f4bf8f7
2016-03-25 13:36:18 +01:00
Jenkins 219fcaf118 Merge "Load wsgi app(api) with paste.deploy" 2016-01-04 09:36:09 +00:00
Aaron-DH a98d3b99e4 Load wsgi app(api) with paste.deploy
More scalable to add a filter

Change-Id: Ib5d3bd16d2bfbafc5a0aa5ef3b8db780e3b97520
2016-01-02 13:42:13 +08:00
ZhiQiang Fan 4ab4ee7a08 remove setting for option verbose
ck-api log complains:

Option "verbose" from group "DEFAULT" is deprecated for removal.
Its value may be silently ignored in the future.

If this option is not set explicitly, there is no such warning.
Furthermore, the default value of verbose is true, so there is
no need to set this value in devstack plugin.

Change-Id: I0dbf2ec729482883c87a89f2a13a406ff4998754
2015-12-31 21:50:33 +08:00
Stéphane Albert 91b6216976 Fixed Horizon static file compression in devstack
Static files needs to be compressed in Horizon. Since CloudKitty is
loaded as a devstack plugin its files are copied after Horizon
initialization. This patch add calls to django-admin to process new
files.

Change-Id: I51b703f682b74a35a1fb6cad64856093011ee2e2
2015-11-26 11:17:47 +01:00
venkatamahesh f331366d2e Move global variables to settings file
The global variables are moved to settings file as per
the devstack plug-ins documentation

Change-Id: Ib6f84ecaf01259c4d093df92d90d622927483033
2015-11-24 06:40:04 +01:00
Jenkins f2400e7be9 Merge "Added AuthPlugin support in devstack" 2015-10-28 05:42:19 +00:00
Stéphane Albert 57690f152a Added AuthPlugin support in devstack
Closes-Bug: #1510547
Change-Id: I1071b560414d4cbf4c520c055a14b119a538dd1b
2015-10-28 09:48:17 +09:00
Christian Berendt ecaa4e6dea devstack: enable cloudkitty services by default
Users using the cloudkitty devstack plugin want to use cloudkitty.
Because of that it makes no sense to not enable the cloudkitty services
provided by this devstack plugin by default.

Change-Id: I7188397233bcc43df39a66d407d92f6a844f374c
2015-10-23 12:52:15 +02:00
Stéphane Albert 77347ae517 Fixed files to support liberty dashboard
Related-Bug: #1507087
Change-Id: I272fc8adb62f0bcc340c7bb3bfd9ed5cbdac42ec
2015-10-19 15:56:41 +02:00
Stéphane Albert 4be901f871 Updated files to the new namespace
Change-Id: If169e093dec77acfda028c81a193a5d867cdc8f1
2015-10-19 11:46:45 +02:00