Commit Graph

22 Commits

Author SHA1 Message Date
licanwei c1a5e443fe Add uWSGI support
This patch implements uWSGI support for Watcher API service.
Because mod_wsgi is deprecated, using uwsgi to replace of mod_wsgi.
Most of Openstack projects have finished it.

Closes-Bug: #1834392
Change-Id: I3fad8d30a15aba493fb91da9337c2515ddea5167
2019-06-27 14:56:52 +08:00
Lance Bragstad 0242d33adb Register default policies in code
This commit registers all policies formally kept in policy.json as
defaults in code. This is an effort to make policy management easier
for operators. More information on this initiative can be found
below:

  https://governance.openstack.org/tc/goals/queens/policy-in-code.html

bp policy-and-docs-in-code

Change-Id: Ibab08f8e1c95b86e08737c67a39c293566dbabc7
2017-12-11 15:19:10 +03:00
Alexander Chadin 8fd57276be Remove all sphinx warnings
This patch set fixes all sphinx warnings and makes
https://docs.openstack.org/watcher/latest/configuration/index.html
available.

Change-Id: I76a715c10cb1d582419ff37869093fa9b8678310
2017-07-25 07:31:53 +00:00
aditi af22899ebe Run Watcher-API behind mod-wsgi
This patch adds support to run watcher-api
with mod-wsgi. It provides
1. wsgi app script files, to run watcher-api under apache.
2. updated devstack plugin to run watcher-api default with
   mod-wsgi.
3. Document to deploy watcher-api behind wsgi.

Change-Id: I8f1026f0b09fd774376220c2d117ee66f72421b8
Closes-Bug: #1675376
2017-04-01 19:03:17 +05:30
zhuzeyu 23442a4da6 Modify the field in tox.ini
We use 'genconfig' field to generate configuration file generally.

TrivialFix

Change-Id: I152613103594dd7bcbc8b7f53a12e223a25bb051
2017-01-17 18:01:56 +08:00
Alexander Chadin e7a1e148ca Add service supervisor
This patch set adds supervisor mechanism for Watcher services
to get ability to track states.

Partially-Implements: blueprint watcher-service-list
Change-Id: Iab1cefb971c79ed27b22b6a5d1bed8698e35f9a4
2016-10-12 15:52:06 +03:00
Tomasz Kaczynski 26d84e353e Add scoring engines to database and API layers
A Scoring Module needs to expose a list of available
scoring engines through API and Watcher CLI. This list
is stored in database and synchronized by Decision Engine.

Partially-Implements: blueprint scoring-module
Change-Id: I32168adeaf34fd12a731204c5b58fe68434ad087
APIImpact
2016-08-01 12:40:33 +00:00
zte-hanrong bc06a7d419 Add policies for API access control to watcher project.
Change-Id: Ibdbe494c636dfaeca9cf2ef8724d0dade1f19c7f
blueprint: watcher-policies
2016-07-06 17:38:44 +08:00
Vincent Françoise cb342b45b7 Added missing config section for autogeneration
In this changeset, I added the missing entries for the configuration
sample file generation:

- oslo.reports
- oslo.cache
- oslo.concurrency
- oslo.policy
- oslo.service.periodic_task
- oslo.service.service
- oslo.service.wsgi

Change-Id: I826f5cc1185d75f545c96242022a07089cf3042e
2016-06-06 17:47:13 +02:00
David TARDIVEL c9e0dfd3f5 Remove the watcher sample configuration file
Watcher sample configuration file groups parameters from
various projects and the watcher project ones. This makes it
tricky to review updates on configuration parameters.

It is inconvenient for developer if the add/remove/change some
configuration options cause they need to take care about the
config.sample file.

The sample configuration file should be available into HTML doc.

This patchset:
. removes the file /etc/watcher/watcher.conf.sample
. adds an admin script tool to be able to built it, by using tox
. includes a new section 'Watcher sample configuration files' into
  the doc source files
. uses sphinx extension oslo_config.sphinxgenconfig

Change-Id: If2180de3614663f9cbc5396961a8d2175e28e315
Closes-Bug: #1541734
2016-03-21 11:47:29 +01:00
Taylor Peoples 0ba8a35ade Sync with openstack/requirements master branch
In order to accept the requirements contract defined in
openstack/requirements, we need to sync with the master branch of that
project's global-requirements.txt and test-requirements.txt files.

Most of the changes are just version changes and nothing major.  The
only major change is:

1) The twine dependency is removed, and therefore the pypi tox
environment was also removed.

Change-Id: Idbe9e73ddc5a34ac49aa6f6eff0779d46a75f583
Closes-Bug: #1533282
2016-02-09 16:31:07 +00:00
Taylor Peoples 9a6811ae6b Create OpenStackClients convenience class
The OpenStackClients class provides a convenient way to create and
cache client instances.  The idea behind this code comes from Magnum
[0].

The OpenStackClients class will act as the manager of other project's
clients, providing an easy way to fetch instances of said clients. This
will allow the clients to be cached.

An instance of OpenStackClients is created for every call that comes
into the decision engine and the applier, using the request context to
pass needed (domain id) parameters to get a Keystone session.  This
instance should be shared as much as possible to avoid additional
unneccessary connections to the other services.

This class will also allow for the version of each client to be
configurable via the watcher.conf file.

The method by which a Keystone session is also changed to use the
keystoneauth1.loading library.  In order to avoid DuplicateOptErrors
with the keystone_authtoken group used for the keystonemiddleware in the
API code, a new conf group named "watcher_clients_auth" is created.  A
typical configuration using a password authentication scheme will look
like:
  [watcher_clients_auth]
  auth_type = password
  auth_url = http://<server-ip>:<port>
  username = <username>
  password = <password>
  project_domain_id = default
  user_domain_id = default

[0]: https://github.com/openstack/magnum/blob/master/magnum/common/clients.py

DocImpact
Change-Id: Iab9d0b304099686da2e9e2b19e8b1de4332ff378
Implements: blueprint external-api-versioning
Closes-Bug: #1530790
Closes-Bug: #1539670
Closes-Bug: #1522774
2016-02-03 02:27:26 +01:00
Jean-Emile DARTOIS 0e7bfe61bd Use taskflow library for building and executing action plans
The aim of this patchset is to integrate taskflow in
the Watcher Applier. Taskflow will help us a lot to make
Action Plan execution easy, consistent, scalable and reliable.

DocImpact

Partially implements: blueprint use-taskflow

Change-Id: I903d6509d74a61ad64e1506b8a7156e6e91abcfb
Closes-Bug: #1535326
Closes-Bug: #1531912
2016-01-21 18:13:42 +01:00
Jean-Emile DARTOIS 47759202a8 Add a dynamic loading of the Watcher Planner implementation
In watcher, an audit generates a set of actions which
aims at achieving a given goal (lower energy consumption, ...).
It is possible to configure different strategies in order to achieve
each goal. Each strategy is written as a Python class which produces
a set of actions. Today, the set of possible actions is fixed for a
given version of Watcher and enables optimization algorithms to
include actions such as instance migration, changing hypervisor state,
changing power state (ACPI level, ...).

The objective of this patchset is to give the ability to extend the
default set of planner algorithms currently available in Watcher
using Stevedore.

The doc need to explain how create a new planner.

DocImpact
Partially implements: blueprint watcher-add-actions-via-conf

Change-Id: I2fd73f8c4a457ee391d764a7a3f494deecd2634f
2016-01-13 08:26:21 +00:00
Jean-Emile DARTOIS 4c3073efb4 Code refactoring - StrategyContext and Auditendpoint
This patchset aim to remove useless code in StrategyContext
and AuditEndPoint.
This patchset also add a parameter for strategy context to define the
numbers of thread of execute the strategies.

DocImpact
Change-Id: I83e87165b03b42fe6b863921502a300bd94d2982
2015-12-18 14:25:07 +00:00
Jean-Emile DARTOIS 633b360652 Fix generation of watcher config file
Although the refactoring of the applier got merged we have an issue
to generate the config. This pathset fix that

Change-Id: Iafce7d0136b2ad813102c3e3caeebafa215363c8
Closes-Bug: 1526851
2015-12-16 16:09:12 +00:00
Vincent Françoise 8756c70060 Removed 'watcher_messaging' to use oslo.messaging
The old 'watcher_messaging' section of the Watcher configuration file
has now been replaced by the more standard oslo.configuration one.

DocImpact

Change-Id: Ie027df023e6133f3188e57b42846083f28c282bd
2015-12-01 16:02:03 +01:00
Vincent Françoise 9078e1e138 Added 'dummy' entrypoint within watcher_strategies
This should make our 'dummy' strategy available for use.
I also removed all previously defined default goals, which means
that they will have to define it themselves from now on.
This can also be useful for future integration tests.

Change-Id: I6c43eba941022a88851a199b56a6c20f017b9e71
DocImpact
Closes-Bug: #1520178
2015-11-30 16:06:45 +01:00
Vincent Françoise 5f8a601c63 Updated the config sample file generation command
Following the update of the project requirements, we should now
use the oslo.config namespace of oslo.log when generating ou
Watcher config sample file.

Change-Id: I7a1f3d555534b40c041b7f042f19fae231b7e80c
Closes-Bug: #1518297
2015-11-27 15:46:49 +01:00
Jean-Emile DARTOIS 827563608f Integration of Ceilometer in Watcher
In current implementation is not easy to use ceilometer.
Watcher must query metrics from the Telemetry v2 API to allow an easiest integration with OpenStack components (especially devstack).

blueprint telemetry-integration
Change-Id: Ide515472f1d160925d9f4aabf48c96dea4f6bc05
2015-11-23 15:29:28 +01:00
Jean-Emile DARTOIS 8c76c7fbef update config file sample
Change-Id: Ib30538514826819f09c8a2f9322bf8f00896c2eb
2015-10-22 17:01:23 +02:00
David TARDIVEL d14e057da1 initial version
Change-Id: I699e0ab082657880998d8618fe29eb7f56c6c661
2015-06-04 15:27:57 +02:00