Commit Graph

200 Commits

Author SHA1 Message Date
Takashi Kajinami fd87af8719 Replace md5 with oslo version
This follows what was already done in the other projects like [1].

In FIPS mode, md5 is allowed only in non-security contexts. This
change disables the security context in the md5 call to determine
the hash for workload partitioning, because this usage does not
involve any security risks.

[1] 8027d907109b6b3c96623f9793aff752cec8ed12

Change-Id: I7d622a6e7d324a765760819c024295b57990f95c
2024-01-31 08:01:46 +00:00
Stephen Finucane 6c032153bf setup: Remove unused dependencies
None of oslo.context, debtcollector or testresources are used by aodh.
Remove them, along with the warnings about requirements order that no
longer applies with the "new" dependency resolver introduced in pip
20.3.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I37a1ffe9c9617262eb5e40fc3ad1b02277a11513
2023-11-16 14:52:35 +00:00
Martin Mágr f932265290 Add Prometheus evaluator
This patch adds threshold evaluator for Prometheus metrics.
Alarms are based on Prometheus query only. The library
python-observabilityclient is used for querying Prometheus.

Co-authored-by: Jaromír Wysoglad <jwysogla@redhat.com>
Depends-On: Ie7477e0b11479449f7f13c7a784737ac70059964
Change-Id: I72e124cca4398b78f7ed12e1db3f66bdbfcb196e
2023-11-07 06:22:28 +00:00
Erno Kuvaja ab29096236 Revert "Fix docs job"
The actual cause is been solved here
Depends-on: https://review.opendev.org/c/openstack/requirements/+/896195

This reverts commit 2a2958bd63.

Change-Id: I29123962edc4b0e1423dbbf1b2705a4692adbf6c
2023-09-22 16:18:15 +01:00
Dmitriy Rabotyagov 800402e7ad Add check-requirements job
This job is maintained by requirements team and ensures that
requirements and constraints have proper format and do not conflict
with guidelines.

Co-Authored-By: Erno Kuvaja <jokke@usr.fi>
Change-Id: I3dd8b1b1826473495725bb8cff2c42c6aa7b35f1
2023-05-10 13:31:18 +01:00
Erno Kuvaja 0782615601 Drop tenacity cap to align with global_requirements
The cap does not seem to be needed anymore.

Change-Id: Iaff14e4b004e8562b41f8c94e40c2ee595884f6e
2023-04-28 11:24:46 +01:00
Takashi Kajinami 6648f6b684 Bump minimum version of gnocchiclient for aggregats API support
The commit 74eadfbd58 introduced usage
of aggregates API, which is available since gnocchiclient 6.0.0 .

This change bumps the minimum version to ensure the API is available.

Change-Id: I64a984fe64c8fe69856980df9e28a67f5eb29b58
2022-04-18 12:50:38 +09:00
Zuul 9fa5ad045b Merge "Introduce Guru Meditation Reports into Aodh" 2021-09-29 07:57:26 +00:00
Zuul 85882a3fc2 Merge "Revert "Support Ceilometer API"" 2021-08-26 10:20:15 +00:00
Takashi Kajinami 0416ccec8c Introduce Guru Meditation Reports into Aodh
This change introduces support for Guru Meditation Report(GMR) into
Aodh, using oslo.reportis library.
With this change, each service prints GMR to stderr or file when
the service receives SIGUSR1.

The same was introduced into Cilometer a long ago[1], and this change
is based on the change made in Ceilometer.
 [1] https://review.opendev.org/c/openstack/ceilometer/+/196369

Change-Id: I7f67acd98c2089bb248d3249159719a3979d27e7
2021-08-15 03:23:23 +09:00
Zuul 10383f4d5b Merge "Fix oslo policy DeprecatedRule warnings" 2021-07-14 07:34:12 +00:00
Matthias Runge 7a166e05f7 Replace oslo_utils.fnmatch with fnmatch
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.

SQLAlchemy url is now immutable
Use URL.set to update

Co-authored by: Takashi Kajinami
[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b

Change-Id: I59c4d93a5914b8e14f7ef93bcaff8d1caaf5e75a
2021-07-09 12:47:17 +02:00
Ghanshyam Mann 082f6cf0ae Fix oslo policy DeprecatedRule warnings
Since 3.7.0, oslo policy started the DeprecationWarning[1] if
deprecated_reason and deprecated_since param are not passed
in DeprecatedRule or they are passed in RuleDefault object.

These warnings are logged for every test which increase the
log size and sometime can full the log buffer and fail the
job.

[1] https://github.com/openstack/oslo.policy/blob/3.7.0/oslo_policy/policy.py#L1538

Change-Id: I8b9f0611364f6857b86fc800c89fe403672af975
2021-07-06 16:52:33 +00:00
Matthias Runge 95d616dc90 sqlalchemy is used but not declared
in requirements.

It is used e.g. in
aodh/storage/sqlalchemy/models.py

Change-Id: I3677fddb70b4b2b0452e37a2a512997e7e4b5f0c
2021-05-19 11:15:14 +02:00
Matthias Runge 9cf69d72d2 Cap tenacity < 7.0.0
https://github.com/jd/tenacity/pull/274/files removed code
which was still in use.

Change-Id: Ib7c0be686aaf542a483a426c1966ad067a5fe3eb
2021-03-22 11:43:03 +01:00
Matthias Runge 9b50734bf7 Revert "Support Ceilometer API"
ceilometerclient is deprecated and not supported since 2017.

This reverts commit d32ca24453.

Change-Id: Id5bac2f317deceefe625d91f0dc91b071a6f8037
2021-03-01 18:21:09 +01:00
Ghanshyam Mann 5e7a0519cf [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ia0fa4ba1fecf2740a291c5a65b906b089c95404d
2020-12-25 16:41:53 +00:00
Zuul 0bac3700b3 Merge "Update requirements to implement secure RBAC" 2020-12-11 08:59:44 +00:00
wangzihao a2d9f3ce50 Remove six
Remove six.moves Replace the following items with Python 3 style code.

- six.moves.range
- six.moves.xrange
- six.text_type
- six.PY2
- six.PY3
- six.moves.urllib
- six.string_types
- six.iteritems
- six.add_metaclass
- six.moves.map
- six.with_metaclass
- six.iterkeys
- six.itervalues

Change-Id: I469b49772899672c05f869c6870512fddfc6183d
2020-12-04 01:35:57 +00:00
Lance Bragstad b99761d38f Update requirements to implement secure RBAC
This commit bumps the versions for oslo.policy, oslo.log, and
keystonemiddleware. It also adds a dependency on oslo.context so that we
can re-use context objects to make authorization decisions in
oslo.policy, instead of building authorization information from the
request manually, which is error-prone and redundant.

The versions bumps for these libraries are necessary to provide better
default policies through deprecations and enhanced scope checking.

Change-Id: I1bdecf2e762e2b7652a411efd03210ea51575ada
2020-12-01 15:38:47 +00:00
Hervé Beraud 32e956517b Cap jsonschema 3.2.0 as the minimal version
Previous versions of jsonschema (<3.2.0) doesn't support python 3.8 [1].
Python 3.8 is part of the victoria supported runtimes [2] so we now force
to use jsonschema version 3.2.0 to avoid issues, remove ambiguity and ensure
that everything works with python 3 in general.

[1] https://github.com/Julian/jsonschema/pull/627
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I6e47beaf0a5f2e455db5828dd2381d98aba25bd8
2020-05-26 21:45:41 +02:00
Lingxian Kong d32ca24453 Support Ceilometer API
This patch adds the Ceilometer API support back to Aodh.

Change-Id: I7b3301fd0569e041218196f1d05047ae7a6138e4
2019-11-22 15:38:10 +13:00
Ghanshyam Mann 95c2b51463 Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Aodh is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal - https://review.opendev.org/#/c/691178/

Change-Id: I12158c5f382f832da50d5be90906ca4a7dd8ccdc
2019-10-30 07:21:50 +00:00
Eyal c79990e8a3 Update jsonschema according to requirements
Change-Id: I8b0b07bdbe7145fb080e77726e76db5108a2c160
2019-09-10 12:47:35 +03:00
Lingxian Kong a8285b564d Support Heat auto-healing notifier
The auto-healing notifier works together with loadbalancer_member_health
evaluator.

Presumably, the end user defines a Heat template which contains an
autoscaling group and all the members in the group are joined in an
Octavia load balancer in order to expose service to the outside, so that
when the stack scales up or scales down, Heat makes sure the new members
are joining the load balancer automatically and the old members are
removed.

However, this notifier deals with the situation that when some member
fails, the stack could be recovered by marking the given autoscaling
group member unhealthy, then update Heat stack in place.

Change-Id: I6e92d1fc2125e155bb5068ff2c14fa318b126442
2019-05-16 11:26:13 +12:00
Lingxian Kong 018b7d45fe Add load balancer pool member evaluator
This patch is adding a new evaluator for the alarms of type
'loadbalancer_member_health' which evaluates the alarm by checking
the operating status of the members in a given load balancer pool.

A new config option 'member_creation_time' is introduced in order to
ignore the members in initialization status.

This is the first part of the auto-healing solution.

Change-Id: I57b848e6dc6aa5e79af1c17dbf1a42a9f068f174
2019-04-16 21:15:44 +12:00
akhiljain23 bef0f9bfd0 Add framework for aodh-status upgrade check
This commit adds the functionality of aodh-status CLI for performing
upgrade checks as part of the Stein cycle upgrade-checkers goal.
It only includes a sample check which must be replaced by real checks in
future.

Change-Id: I21e331266ab061a41d0ffe3c179b10f777af44f5
Story: 2003657
Task: 27733
2019-04-10 10:43:37 +00:00
Nagasai Vinaykumar Kapalavai 701e05bb38 Validation Check for 'query' params of alarm type 'event'
Currently an alarm rule is created even though the query is not
adhered to the format.
Now it does a validation check against the input and gives a
http 400 error message.

Closes-Bug: #1467317

Change-Id: Ibfca9c7e4ec0c1b37272fc410df36ff43a3eb3f2
2018-07-13 02:22:56 +00:00
Mehdi Abaakouk b53d862bb5 Remove ceilometer-api alarm type
This change removes the deprecated 'threshold' alarm type from Aodh.

This also removes the useless ceilometerclient dependency.

Depends-On: Id89130fd8a782dea863c85b37a919fbf0f0897dd
Change-Id: I7ccf930f2ad0316dbda0675a2ec0344e61986022
2018-01-12 21:03:25 +01:00
gordon chung 4f16ed6c34 Revert "Replace jsonutils by ujson"
This reverts commit 17feef6c66.

ujson isn't necessary required and ubuntu packagers raised concerned.
replace with json

Change-Id: Ia53fc9226ab7a8348bf134b3b3aaf37927398cd3
related-bug: #1737989
2018-01-03 13:39:23 +00:00
Mehdi Abaakouk 607d4e876c don't use last keystonemiddleware
Related-bug: #1737115
Change-Id: Id8368c0091ef8eb6a567ba9036bd11d656bcf8d4
2017-12-12 19:04:57 +01:00
unknown 17feef6c66 Replace jsonutils by ujson
ujson is faster than jsonutils, and we do not need any fancy feature jsonutils
might offer.

This also has the benefit of removing a big dependency on Aodh.

Change-Id: I4773ac55a5aedf4960c4ce611873813922ca01e5
2017-11-01 21:06:20 +08:00
gord chung 3227ae9377 remove gnocchiclient cap
fix remaining usage of recently changed client init interface.
fix req as we don't need it anymore.

Related-Bug: #1714483
Change-Id: I3d7652d294d8082a5ef526d1e51add8056dc3114
2017-09-04 23:30:30 +00:00
gord chung 59355a39ea support new gnocchiclient interface
support for explicitly setting interface/regoin_name was changed in
gnocchiclient 3.1 and remove in gnocchiclient 4.
Closes-Bug: #1714483

Change-Id: I7ef25df606e07c6c235afa286ae83450488cd8e0
2017-09-01 20:23:36 +00:00
Jenkins b154e48b22 Merge "deprecate threshold rule alarms" 2017-03-10 00:15:19 +00:00
alextricity25 60ad8b0afc Update pbr requirement to match global requirement
This is to match what is in the global-requirements.txt
in the requirements project.

Change-Id: I7ab338a27d22b60719798546206db776c6f70dd9
2017-03-06 16:09:11 -06:00
gord chung 69cfeca362 deprecate threshold rule alarms
ceilometer's api is deprecated, so threshold rule alarms cannot exist
either.

Change-Id: I69a5778edb62843acc36b5366947071745fb43b4
2017-02-28 11:14:02 -05:00
Julien Danjou d09874ecf2 Add keystoneauth1 in requirements
It's actually imported by aodh.keystone_client directly. Version 2.1 seems to
be the minimal version to have it to work correctly.

Change-Id: Ia6fccd25a08adf46b3c21c49e775d1da5648899f
2017-02-17 18:12:00 +01:00
gord chung bebe5204fc enable cachetools for gnocchi alarms
- set ttl to an hour since capabilities rarely change (if ever?)
- set cachetools to 1.1.6 since it has some ttl expiration
  improvements and it's a year old so why not.
- i give up trying to disable cache

Change-Id: I1b83ffd32cfd631fc340b068e71f61789388ee73
2017-01-17 00:25:01 +00:00
Julien Danjou e86f216aa2 Enable healthcheck app to check API status
Change-Id: Ide2aa8613fe4767c9e93e1421dbf7ba7439bb3c7
2016-12-20 17:04:30 +01:00
Boden R 7587ab9bf3 Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.

Tenacity provides the same functionality as retrying, but has the
following major differences to account for:
- Tenacity uses seconds rather than ms as retrying did.
- Tenacity has different kwargs for the decorator and
Retrying class itself.
- Tenacity has a different approach for retrying args by
using classes for its stop/wait/retry kwargs.
- By default tenacity raises a RetryError if a retried callable
times out; retrying raises the last exception from the callable.
Tenacity provides backwards compatibility here by offering
the 'reraise' kwarg.
- Tenacity defines 'time.sleep' as a default value for a kwarg.
That said consumers who need to mock patch time.sleep
need to account for this via mocking of time.sleep before
tenacity is imported.
- For retries that check a result, tenacity will raise if the retried
function raises, whereas retrying retried on all exceptions.

This patch updates all usages of retrying with tenacity.
Unit tests will be added where applicable.

Note: This change is not newton critical so projects are welcome
to hold off on committing until post-newton. Ideally this change
will merge by the first part of Ocata so dependant functionality
can land and have time to solidify for Ocata.

[1] https://github.com/jd/tenacity

Co-Authored-By: gordon chung <gord@live.ca>
Closes-Bug: #1635402
Change-Id: Ife452b18709ff34ec48a39bbe5407d69a5b2e3c2
2016-12-14 17:15:58 +00:00
gord chung ba56a0fadf add testresources req
inew oslo.db requires it. also, bump oslo.db since it's old as hell
and block the versions we know are broke

Change-Id: I31abf319a43346b18b29f6217ca1d7764ef48db8
2016-12-06 15:32:42 +00:00
Jenkins 0578ade715 Merge "Use pbr wsgi_scripts to build aodh-api" 2016-07-18 10:32:35 +00:00
Mehdi Abaakouk ddedc4b49d use Cotyledon lib
This change replaces oslo.service with Cotyledon

Change-Id: Ic724be73660727b123a3be280b0891f9dd014957
2016-07-06 13:14:35 +02:00
liusheng cb91079a62 Bump the oslo.messaging version
Bump the oslo.messaging version to 5.2.0 to avoid the issue occurred with
Ceilometer py34 jenkins job, see:
Icb34a7f0e03662868aa0ce6e060c5e951711b79e

Change-Id: Iaeb3c50b834b846588d07ee02f4ab1b2be37b6af
2016-06-02 13:04:34 +08:00
Julien Danjou 67b607fdb6 Use pbr wsgi_scripts to build aodh-api
Change-Id: Iefd6f4d9f76c69ed9b49483e1feda0b7dbe2cb81
2016-05-24 19:37:09 +02:00
Jenkins b5ebdaf58d Merge "Fix and improve the partition coordinator" 2016-05-03 15:28:58 +00:00
liusheng dd06bf9277 Fix and improve the partition coordinator
* Fix the partition coordinator to distribute tasks properly.

* Improve the partition coordination mechanism in retry logic, exception
  handling, and log messages, etc. Refer to the Ceilometer's changes:

- Icf60381e30f3baf986cf9e008e133287765d9827
- I6a48cf38b24a00a0db94d3dea0c6746b52526026
- Ic0b6b62dace88e4e1ce7932024350bb211efb9ef
- I8100160a3aa83a190c4110e6e8be9b26aef8fd1c
- I2aed2241ded798464089b3eec5e1394422a45844

Closes-Bug: #1575530
Change-Id: I5729ae3080898e8a6d92889f8c520174dc371113
2016-05-03 19:45:45 +08:00
liusheng 520425faf8 support batch listener for aodh-notifier
This change add batch messages listener for aodh-notifier service, that
allow users configure aodh-notifier to receive messages in batch.

Change-Id: I5d1eb60be656088a83a3428d0387338b081d1b88
Signed-off-by: liusheng <liusheng@huawei.com>
2016-05-03 10:24:09 +08:00
Jenkins 6ed262a8c2 Merge "replace eventlet timer with thread manner" 2016-04-21 15:41:52 +00:00