Commit Graph

57 Commits

Author SHA1 Message Date
likui c84e98d6b6 Remove six
Replace the following items with Python 3 style code.

- six.PY2
- six.add_metaclass
- six.string_types
- six.text_type
- six.moves
- six.StringIO
- six.wraps
- six.integer_types

Story: 2008305
Task: 41191

Change-Id: I68710421b69d4049c9e990451da491dc14251fb5
2020-11-13 16:16:58 +01:00
Ghanshyam Mann c57f201c7c [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

monasca-agent 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://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Depends-On: https://review.opendev.org/#/c/693631/
Change-Id: I6cd8c92e4c7c9228ae14596e1535f40184a5ae22
2019-11-16 14:09:24 +00:00
Stefano Canepa a8a2bb845b Removed dependency on supervisor
To support python3 in the near future this was done:

* Removed dependency on supervisor.
* Added template configuration for systemd target that includes all
  services.
* Added templates configuration for systemd service for every single
  service.
* Changed monasca_setup to use the new templates.

In the meanwhile code was formated to cope with pep8 settings and some
other small changes were done to comply with pycodestyle and
pydocstring.

Task: 4126
Story: 2000975

Depends-On: https://review.openstack.org/#/c/566475/

Change-Id: I0d0c4ea41a830581d6b9f247fad6a2dda1f96cbe
2018-06-27 11:28:43 +02:00
Doug Hellmann c5899b1d8a uncap eventlet
We will manage the eventlet version using constraints now. See the
thread starting at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129096.html
for more details.

Change-Id: I589a35f4ec9f322a6a0fb026a83f6c42bfc377f0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-11 11:52:25 -04:00
Zuul 7053113ae5 Merge "Manual updated from global requirements" 2018-03-21 14:36:16 +00:00
Zuul 332fe52879 Merge "Update supervisor version lower bound" 2018-03-19 17:54:18 +00:00
Amir Mofakhar 2662ebb399 Manual updated from global requirements
Change-Id: I1398a674b22647214c0f851b6def8404c3163e0e
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-03-14 07:00:13 +01:00
James Gu 3e94038aba Update supervisor version lower bound
Supervisor has XML-RPC security vulenalbility. Upgrade to 3.3.3.
Refer to https://nvd.nist.gov/vuln/detail/CVE-2017-11610.

Story: 2001648
Task: 6667

Change-Id: I1f0e2c3436a0bbeeaf8beebcf15b066de5df7c90
2018-03-08 13:19:12 -08:00
Amir Mofakhar a7498c2797 Manual update from global requirements
Change-Id: I027e2f9532979901b22f0536e17184c25613eede
2018-03-07 22:08:45 +01:00
Witold Bedyk e76cb28897 Manual update from global requirements
Change-Id: Ia6694822a0c75a503fe30677c8a40e6dfb0a0ab1
2018-02-07 15:55:33 +01:00
kaiokassiano 0c49ed4a8e Remove deprecated io_loop argument
The argument io_loop on the ioloop.PeriodicCallback constructor is
deprecated in newer tornado versions, so we can just remove it.

Since we are using tornado<=4.5.2 on stable/pike, we can correctly set
master's version to tornado>=4.5.3.

Story: 2001489
Task: 6218

Change-Id: Id621d5b609e1bf4eac3a3dd4aff44436dd012b87
2018-01-29 13:33:54 -03:00
Christoph Held f50a006b37 added license comments
Change-Id: I60856fab2112f88ac24fa5812207c41e0c8844f4
2017-12-21 14:22:59 +01:00
Kaiyan Sheng aaa4440fd3 Use monasca-common to validate metrics
Change-Id: I2f52cef518c492cf73ff8310d343363f2863b390
2017-12-01 08:51:11 -07:00
Witold Bedyk 8229af83ef Update from global requirements
Change-Id: I5ae6513db8b4227501c7713ed1cc8d941413bccd
2017-11-15 16:54:00 +01:00
Witold Bedyk b75320bfc2 Manual update from global requirements
Change-Id: I882407cdb191c924bbfbce843fbe2abece71db21
2017-08-08 15:28:07 +02:00
Tomasz Trębski 75247c6257 Update to global requirements
Updates all outdates packages (compared to
requirements of openstack) to their proper
versions.

Change-Id: I0938df74935f3e9a9a80ea3cbb46eb806cdad9a2
2017-07-12 07:03:11 +02:00
Tomasz Trębski b71fd4bef4 Integrate with keystoneauth
Following commit makes enhancements to the
keystone handling inside monasca-agent:

* using generic password approach that abstracts from underlying
keystone version thus allows agent to be used seamlessly with
either v2.0 or v3. The only relevant part is the set of parameters
that one needs to supply to either monasca-reconfigure or agent.yaml
configuration file
* using keystone discovery - it simply means that agent will no longer
enforce particular keystone version but will allow keystoneauth
to pick the best match for given environment

Extra:
* extracted methods get_session and get_client utilize an aproach
presented above and can be used outside of monasca_agent.common.keystone
inside checks or detection plugins
* make imports to import only modules instead specific objects
* removed some redundant methods

Story: 2000995
Task: 4191

Needed-By: I579f6bcd5975a32af2a255be41c9b6c4043fa1dc
Needed-By: Ifee5b88ccb632222310aafb1081ecb9c9d085150
Change-Id: Iec97e50089ed31ae7ad8244b37cec128817871a5
2017-07-11 09:02:34 +02:00
James Gu 30d9176e50 Monasca agent on ESX hangs on collector autorestart
This improves the likelyhood that the collector daemon will exit during
auto restart. Also removed gevent requirement and usage so only
eventlet is used. The conflict between gevent and eventlet caused
multiproccessing worker join and sys.exit to hang forever.

Change-Id: I60f980f4a74eafb709e51c0f520a81e2d72cb609
2017-04-19 17:19:11 -07:00
Jenkins 37bb11e6a0 Merge "Introduce DynamicCheckHelper class" 2017-03-28 15:48:46 +00:00
WangBinbin 2f23d40dcf Use HostAddressOpt for opts that accept IP and hostnames
Some configuration options were accepting both IP addresses
and hostnames. Since there was no specific OSLO opt type to
support this, we were using ``StrOpt``. The change [1] that
added support for ``HostAddressOpt`` type was merged in Ocata
and became available for use with oslo version 3.22.

This patch changes the opt type of configuration options to use
this more relevant opt type - HostAddressOpt.

[1] I77bdb64b7e6e56ce761d76696bc4448a9bd325eb

Change-Id: I3b2239dbc19b3fc074702804c83a77ad4b269b94
2017-03-24 05:39:05 +08:00
Jakub Wachowski f87a29a364 Introduce DynamicCheckHelper class
This class shall be used to map external metrics from Prometheus, InfluxDB, ...
to well-formed Monasca metrics.

It supports:
* filtering by name (regex)
* renaming of metrics
* renamign of dimensions
* filtering by dimension value
* transforming of dimension values (regex based)

Change-Id: If0a5fdb1126bdfc93a88d5c1c7266d0c152d925f
2017-03-16 14:05:35 +00:00
Kaiyan Sheng 059d7eedd5 Add cAdvisor host plugin
Queries a given cAdvisor instance for host metrics. This is useful
when the agent in running in a container and does not have access
to all host level metrics

Taken from original review https://review.openstack.org/#/c/391559/

Change-Id: Ifc3d514e5256bdbc6089ec653065348a488f7c57
2017-03-14 16:05:12 -06:00
Witold Bedyk 6f3e984ca0 Add support for psutil<2.0.0
* Introduce module psutil_wrapper to handle backward compatibility.
* Lower psutil constraint to psutil>=1.1.1

Change-Id: I9575cf4bdff29f3b35725c2bd21bb73752a5cfaf
2017-02-06 11:05:57 +01:00
Tim Buckley 9f605ff395 Update psutil version to >= 3.0.1
This bumps the psutil requirement to >= 3.0.1 to match the new upper
constraint in the global requirements [1]. This also removes the local
capping of psutil to version 3.0.1.

Removing the 3.0.1 cap is also necessary to run the agent in
environments using the musl libc, such as Alpine Linux, due to an issue
resolved in more recent releases [2].

[1]: https://review.openstack.org/#/c/420837/
[2]: https://github.com/giampaolo/psutil/issues/664

Change-Id: If811db1aeac7cb7b37c710f1ba79568d7beb101f
2017-02-01 18:37:57 -07:00
Jenkins 53f6e9b2ac Merge "Sync oslo/test-requirements with global-requirements" 2017-01-11 19:58:08 +00:00
Dirk Mueller dc2029f313 Allow supervisor 3.3.x
I see no reason for limiting to such an old version.

Change-Id: I84ff2e6c3306adc0dd0769ce79039b9f45dcec70
2017-01-11 11:41:17 +01:00
Dirk Mueller bad768ed9a Sync oslo/test-requirements with global-requirements
As an initial step to make monasca-agent coinstallable we
need to converge to use the OpenStack global-requirements

Change-Id: Icdaa769b114f83af3cff2274bd20ea6d74b8f944
2017-01-02 12:41:12 +01:00
Tomasz Trębski d95dec1c44 Sync to global-requirements
Following changes syncs requirements
of monasca-agent project to the openstack's
global requirements.

Needed-by: Ic1e157e7374885378223549644173adbed9c70dc
Change-Id: I0f48a72894ea07a7c67befb575e5cc1decdc3b5f
2016-12-06 13:00:26 +00:00
Craig Bryant 2b370fedd8 Fix version mismatch of oslo.utils
ContextualVersionConflict: (oslo.utils 3.16.0 (..../lib/python2.7/site-packages),
Requirement.parse('oslo.utils>=3.18.0'), set(['python-keystoneclient']))

Change to use 3.18.0

Change-Id: I4bc82134a26340127b6ee2437c179f647cedd77b
2016-11-22 09:32:08 -07:00
Tony Xu fc23c32b85 Add stevedore to requirements
This module is be used in:
monasca_agent/collector/virt/inspector.py

Change-Id: If15e0bdeccd6150446cd1ad88ef65daa41e51d55
2016-10-25 11:06:58 +08:00
Claudiu Belu c88de30c1b Fixes process checker using older psutil versions
Generally, psutil is restricted to versions older than 2.0.0
in OpenStack [1].

Because of this, there can exist nodes with psutil older than 2.0.0.

The data from Process object are accessed differently, depending on
the version. For example, in older versions, this is valid:

process.name()
process.pid
process.username()
process.cmdline()

While in older versions than 2.0.0, those are not methods:

process.name
process.pid
process.username
process.cmdline

Transforming the Process object into a dict solves the issue, as it
behaves the same across different psutil versions.

[1] https://github.com/openstack/requirements/blob/master/global-requirements.txt#L142

Closes-Bug: #1592695

Change-Id: I9b0ff7a666ac9900809f8e4dc07d2b2afbe43516
2016-10-11 19:42:05 +03:00
Kaiyan Sheng 9dc0e21205 self.name doesn't exist in Rate and Counter object
Saw error message in collector log showing:
AttributeError: 'Rate' object has no attribute 'name'

In the new base metric class init function, variable name
got passed into self.metric. That's why self.name doesn't
exist anymore.

Change-Id: Idfd2fe5d257332327449e2766544dd36d8a003c1
2016-08-02 14:27:41 -06:00
Kaiyan Sheng 4d1ab9b338 Change tox.ini to not install requirements using global requirements
Also add constraints on each library in requirements.txt

Change-Id: If93862e438e5e724fb5fb94296ae7879411a5cd4
2016-07-15 13:15:26 -06:00
Kaiyan Sheng dd6cecbab8 Remove gearmand check plugin
We dont use gearmand plugin and we dont use gearman library anywhere else.

Change-Id: I41708b6f25aac49b7974d93128b83eb9b59ba267
2016-07-08 15:49:02 -06:00
Joe Keen 19fbf09a7e Remove restriction on python-monascaclient
There is no reason to add an upper bound on python-monascsaclient.  The overall
constraints should handle it.

Change-Id: I4e51a3a447fbf4136b4fe07185778dd1bc299773
2016-06-20 13:53:03 -06:00
Jenkins fa4529cac5 Merge "Rework agent to better handle multithreaded checks" 2016-05-25 17:48:15 +00:00
Bertrand Lallau 2a36cf4013 Remove Oslo modules useless requirement
This patch cleans up the requirement list to remove OSLO modules
that are not used by monasca-agent.

Change-Id: I3f7e39f864db2a0e267650af9e54e0f82cb34c72
2016-05-24 21:55:14 +02:00
Bertrand Lallau 07d2c3ea1d Remove simplejson useless requirement
This patch cleans up the requirement list to remove simplejson module
that is not used anymore directly by monasca-agent.

Change-Id: I7f7aea7cb28ef428f1559e59e2c6f0fa25a7e65c
2016-05-24 09:34:08 +02:00
Ryan Bak a0259e6b14 Rework agent to better handle multithreaded checks
The custom thread_pool could not restart in certain cases due to limitations
with python threads.  This moves to using multiprocessing.dummy for the thread
pool and gevent to allow thread timeouts.

Also cleans up some of the asynchronous logic.
Pools have constant numbers of threads, so thread count is checked at pool creation
No longer tracks job start time, as this is handled by timeouts.
Move resultsq instantiation so pool restart does not drop data.
Mark checks as done at end of run rather than when results are processed.

Closes-Bug: 1446757

Change-Id: I28bdd8d8404087097bff9f93ff60f5cc86a72fbb
2016-05-18 12:31:43 -06:00
nsren 1281e51809 vCenter detection reads hypervisor.conf
- modify vcenter detection plugin to read the details
      from hypervisor.conf instead of nova.conf
    - oslo.vmware dependency added to requirements.txt

Change-Id: I6f7aa966ccdad711269a643eebffa7396359aa72
2016-03-18 09:07:16 -06:00
Kaiyan Sheng 4e1cc0d2cf Update Agent Requirements.txt
Change-Id: I7827b4811a9d5784e9c7e2e24ceb14c36a64029f
2016-01-21 16:00:07 -07:00
David Schroeder d42c5918eb Add ability to run ping tests against VMs
This patch adds the ability to ping virtual machines from their
compute node host, utilizing Neutron and network namespaces.  It
replaces the nova-network ping test, as nova-network has been
deprecated.
http://docs.openstack.org/openstack-ops/content/nova-network-deprecation.html

The included documentation covers the functionality and requirements
of the new ping checks, and also include a few other minor fixes.

Change-Id: I88b59f79ec391cf3fb190bfdd7207e6c4256830c
2015-12-21 12:39:27 -07:00
Joe Keen 453ba0b99e Adding liberty versions of oslo to requirements.txt
Change-Id: I4878641bba3887df0ce5d4781b368151b853d89e
2015-12-10 23:01:06 -07:00
Joe Keen eb172ffc8d Fixing oslo.serialization requirement
oslo.serialization released a new version today that requires a new version of
oslo.utils that we don't necessarily want yet.

Change-Id: I5b62ce7343b3ce87de1469c8781b424e7da26cce
2015-09-08 13:54:34 -06:00
Joe Keen eb616ec191 Adding stricter requirements
Change-Id: Ic42c57826e079cfcbfd6dfb0663f662cbc793d51
2015-08-28 16:37:00 -06:00
Tim Kuhlman a6119ba157 Remove pylint from the dependencies
Change-Id: Ieaf1fc683d6c136baa4428e300bd005fba75af78
2015-07-27 12:46:55 -06:00
Tim Kuhlman 714a0b7849 psutil 3.1+ is broken
Change-Id: I5f35b4b4f0307d26f53e804e9b87d82fe16fb507
2015-07-15 10:19:54 -06:00
Tim Kuhlman 3eaf9d8afe Change service plugin to choose an alternate ip if needed.
Change-Id: Ia9f107b7993236bc4b30aa149d2765e9e465acbd
Closes-Bug: #1461307
2015-06-24 10:41:51 -06:00
Christian Berendt caad7a3388 Change mode of requirement files
It is not necessary that the requirement files are executable.

Change-Id: I1224d7bd7ef8ef426f68c963ee9794e401e0a7f8
2014-08-13 09:27:04 +02:00
gary-hessler fde221f5db Fixing psutil version issue.
Bump Version

Change-Id: I6b93c85832632335a96d59912e2db795b0d90812
2014-07-29 15:10:16 -06:00