osm/POL.git
3 years agoResolved bug 1047. 31/8831/12
Atul Agarwal [Tue, 28 Apr 2020 10:12:28 +0000 (15:42 +0530)]
Resolved bug 1047.

Adds # pylint: disable=no-member due to dynamic creation of VNF
alarm member.

Change-Id: I7ce58193e60847699777521c115384fde1ca6ec4
Signed-off-by: Atul Agarwal <atul.agarwal@altran.com>
4 years agoFix metric name at VNF Alarms feature 43/8343/3 sol006 v7.0.0 v7.0.0rc1 v7.0.1 v7.0.1rc1 v7.0.1rc2 v7.0.1rc3
Gianpietro Lavado [Fri, 6 Dec 2019 15:46:23 +0000 (15:46 +0000)]
Fix metric name at VNF Alarms feature

Change-Id: Ia996a26befe7bc871b2801c4758fe1deaf2eb987
Signed-off-by: Gianpietro Lavado <glavado@whitestack.com>
4 years agoAdds arch docs to POL 39/8039/2 feature5837 feature7928
Benjamin Diaz [Wed, 9 Oct 2019 17:29:59 +0000 (14:29 -0300)]
Adds arch docs to POL

Change-Id: If8ad88148e50b76c7df29d7a16ddaa58fce9f84b
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoRefactors alarm creation to comply with changes regarding the use of tags instead... 64/7964/2
Benjamin Diaz [Thu, 19 Sep 2019 15:01:14 +0000 (12:01 -0300)]
Refactors alarm creation to comply with changes regarding the use of tags instead of fixed fields

MON changed alarms to include the concept of tags. POL process for alarm creation has
modified to comply with this.
Also, some refactoring has been done in the autoscaling service.

Change-Id: Iaf18262d05727bbb8ff06e83bce13e991aecab6c
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoAdds unit test coverage 78/7878/2
beierl [Thu, 29 Aug 2019 19:57:14 +0000 (15:57 -0400)]
Adds unit test coverage

Adds the coverage module and reporting to tox so it can be
reported with each build.

Change-Id: Ib05fed7b5fea8d777b57deb42912f4a8898832b4
Signed-off-by: beierl <mbeierl@vmware.com>
4 years agoAdds projects_read and projects_write params to scaling nslcmop 45/7845/2
Benjamin Diaz [Wed, 14 Aug 2019 13:27:25 +0000 (10:27 -0300)]
Adds projects_read and projects_write params to scaling nslcmop

Change-Id: Iebd318b9815e711a374ba6ee235577cb2e5234ff
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoUpgrading aiokafka to 0.5.* 85/7785/1
Benjamin Diaz [Fri, 19 Jul 2019 17:13:22 +0000 (14:13 -0300)]
Upgrading aiokafka to 0.5.*

Change-Id: I287b95a0d9fc6132edadfb2b7b446a3ec7d9e142
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoRemoves kafka check from healthcheck 73/7773/1
Benjamin Diaz [Fri, 12 Jul 2019 20:09:37 +0000 (17:09 -0300)]
Removes kafka check from healthcheck

Change-Id: I307361789522b87b7191019ee8f99394ffce605a
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoChanges vnf_member_index to a string 17/7617/1 v6.0 v6.0.0 v6.0.1 v6.0.2 v6.0.2rc1 v6.0.3 v6.0.4 v6.0.4rc1
Benjamin Diaz [Wed, 5 Jun 2019 19:24:34 +0000 (16:24 -0300)]
Changes vnf_member_index to a string

bug 690

Change-Id: I13200cef5039368215a6df2c7f0e93a7de12f2a4
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoAdds missing healthcheck command to setup.py 91/7591/2
Benjamin Diaz [Fri, 31 May 2019 14:47:34 +0000 (11:47 -0300)]
Adds missing healthcheck command to setup.py

bug 716

Change-Id: I63df0ee76b48722fdba480db851cda3a502702c4
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoAdds basic healthcheck to Dockerfile 57/7557/1
Benjamin Diaz [Mon, 27 May 2019 17:57:51 +0000 (14:57 -0300)]
Adds basic healthcheck to Dockerfile

Change-Id: Ia69f49dbfb6e1ff479548d19327d5f26e1a291ed
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoImproves handling of database connections 36/7536/2
Benjamin Diaz [Thu, 23 May 2019 17:19:06 +0000 (14:19 -0300)]
Improves handling of database connections

Change-Id: Ice70378bb0bad3566f51b65476eafcfdac3c991c
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoMakes actions in vnf alarm optional 35/7535/1
Benjamin Diaz [Tue, 21 May 2019 15:31:15 +0000 (12:31 -0300)]
Makes actions in vnf alarm optional

Change-Id: I4db3e01903d4c82cd8c89529e62fc0146853969f
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoRemoving unused CMD from Dockerfile 49/7449/1
Benjamin Diaz [Wed, 8 May 2019 20:23:48 +0000 (17:23 -0300)]
Removing unused CMD from Dockerfile

Change-Id: I41457113b0ff55cf3e3544c70365b4de56b3cc20
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoAdds requests package installation to debian postinst 42/7442/1 feature7106
Benjamin Diaz [Tue, 30 Apr 2019 13:20:57 +0000 (10:20 -0300)]
Adds requests package installation to debian postinst

Change-Id: Ibeb270fce9cc0fe546da479a7c34981c4b918329
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
4 years agoImproves README 31/7431/2
Benjamin Diaz [Fri, 26 Apr 2019 19:35:32 +0000 (16:35 -0300)]
Improves README

Change-Id: I378ef316d15e5a2d0f943cfb93e92127d80cd82e
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds pylint to tox test pipeline and fixes related errors 05/7405/3
Benjamin Diaz [Thu, 11 Apr 2019 17:29:14 +0000 (14:29 -0300)]
Adds pylint to tox test pipeline and fixes related errors

Change-Id: Ie19400ce0cf591e0bfcbca690bd5d905ad9bd6f5
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds support for vnf alarms 79/7379/4
Benjamin Diaz [Mon, 1 Apr 2019 17:56:26 +0000 (14:56 -0300)]
Adds support for vnf alarms

Abstracts database logic into repositories for easier unit testing
Adds unit tests

Feature 6373

Change-Id: If006a680227f814de1516ec35aa177ed66b48ca1
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoRefactors autoscaling module to separate concerns and allow better control of db... 78/7378/1
Benjamin Diaz [Mon, 4 Mar 2019 16:59:53 +0000 (13:59 -0300)]
Refactors autoscaling module to separate concerns and allow better control of db connections

Change-Id: I57034d34ae2fbb3c4aeda784f9542e643d348460
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds support in entrypoint script for more complex mysql URI (+pool and query params) 89/7289/1
Benjamin Diaz [Mon, 11 Mar 2019 16:36:34 +0000 (13:36 -0300)]
Adds support in entrypoint script for more complex mysql URI (+pool and query params)

Change-Id: Iab6bd86196d9b0bf330eac6b053fdda5dc021328
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoModifies POL to create database if using mysql URI 57/7257/1
Benjamin Diaz [Tue, 26 Feb 2019 19:54:10 +0000 (16:54 -0300)]
Modifies POL to create database if using mysql URI

Change-Id: I718e703992eac66bae22cbc44ea8b78cbd776371
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds migration engine for peewee ORM 44/7244/5
Benjamin Diaz [Tue, 5 Feb 2019 20:44:42 +0000 (17:44 -0300)]
Adds migration engine for peewee ORM

bug 590

Change-Id: If6752715d455cbeb3dc2633e9b62f79360fef767
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoReplaces direct use of aiokafka with osm_common message bus in agent and 76/7176/4
Benjamin Diaz [Fri, 1 Feb 2019 16:31:47 +0000 (13:31 -0300)]
Replaces direct use of aiokafka with osm_common message bus in agent and
lcmclient

Changes config handling to comply with the way it is handled in other modules,
by using a config file and overriding it with env vars.

Adds unit tests for message_bus_client.

Mon client remains using aiokafka directly, as there is no support yet for
auto_offset_reset configuration in osm_common.

Change-Id: I99615287cc934ce310105e86544a6bfe26bc0673
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoExits process when encountered by a database exception 69/7169/1
Benjamin Diaz [Fri, 25 Jan 2019 17:30:20 +0000 (14:30 -0300)]
Exits process when encountered by a database exception

Database errors could mean database node failure. In this cases, the process
should exit so it could be automatically restarted (when handled by Docker Swarm, K8s, etc)
so it can obtain a new DB connection to an alive node.

Change-Id: I42a3954fe238a0445101eb71add79aaef4315c2e
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoRemoves try except block from creation of database tables 68/7168/1
Benjamin Diaz [Thu, 3 Jan 2019 02:13:32 +0000 (23:13 -0300)]
Removes try except block from creation of database tables

In case there is an error connecting to the database engine, or the database
is not yet created, POL should fail. This is specially relevant to avoid race
conditions in Docker and K8s deployments using MySQL/MariaDB, because peewee
needs the database to already exist.

Change-Id: Iabe46c1c4f718919e10fc65271d0e814c5f9a146
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds pymysql to requirements.txt 67/7167/1
Benjamin Diaz [Thu, 27 Dec 2018 21:25:43 +0000 (18:25 -0300)]
Adds pymysql to requirements.txt

Allows using a mysql database as peewee backend

Change-Id: If0c408d57f9d20d36a04e5cf8421a0a9f9c1d0b9
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds deletion of orphaned alarms after an scalein operation 81/6981/1 v5.0 v5.0.0 v5.0.1 v5.0.2 v5.0.3 v5.0.4 v5.0.5
Benjamin Diaz [Tue, 27 Nov 2018 20:40:30 +0000 (17:40 -0300)]
Adds deletion of orphaned alarms after an scalein operation

Change-Id: Ic461abb88d5514367c284ae79b4ed8914bc0281e
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoMerge "Adds use of alarm response topics based on cor_id"
lavado [Tue, 27 Nov 2018 14:00:26 +0000 (15:00 +0100)]
Merge "Adds use of alarm response topics based on cor_id"

5 years agoMerge "added env vars for mongo ha"
lavado [Tue, 27 Nov 2018 14:00:13 +0000 (15:00 +0100)]
Merge "added env vars for mongo ha"

5 years agoAdds use of alarm response topics based on cor_id 67/6967/1
Benjamin Diaz [Mon, 26 Nov 2018 21:05:53 +0000 (18:05 -0300)]
Adds use of alarm response topics based on cor_id

Change-Id: I6cde487c95c55e6b9b0e021d058d95fcec8881ba
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds support for autoscaling based on vnf-metric 56/6956/2
Benjamin Diaz [Fri, 23 Nov 2018 18:34:24 +0000 (15:34 -0300)]
Adds support for autoscaling based on vnf-metric

Change-Id: I179395ce1390f9031b15d141ff3b37839943368e
Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds deletion of scaling alarms in POL and MON after ns termination 44/6944/4
Benjamin Diaz [Wed, 21 Nov 2018 21:53:18 +0000 (18:53 -0300)]
Adds deletion of scaling alarms in POL and MON after ns termination

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Iefe8de25061cfffa0220671a8072c2bc155332eb

5 years agoadded env vars for mongo ha 37/6937/2
Juan [Wed, 21 Nov 2018 15:21:34 +0000 (12:21 -0300)]
added env vars for mongo ha

Change-Id: Ied541f300e819eacbc31426089eb7ca547b59f34
Signed-off-by: Juan <jquiroga@whitestack.com>
5 years agoRefactor scaling group config and adds partial support for vnf metrics 09/6909/2
Benjamin Diaz [Fri, 16 Nov 2018 22:46:50 +0000 (19:46 -0300)]
Refactor scaling group config and adds partial support for vnf metrics

Adds support for scaling groups based on vdu-metric corresponding to a juju
metric. It also includes modifications to support MON modifications regarding
vnf-monitoring-params.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I1a1604f965c077fa14a19ad7a26da0facc4818ba

5 years agoFixes discrepancies with IM related to monitoring params 03/6803/3
Benjamin Diaz [Wed, 31 Oct 2018 03:58:22 +0000 (20:58 -0700)]
Fixes discrepancies with IM related to monitoring params

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Ie57107550b229292fad7ecb9ed154dd51bf5985e

5 years agoRenames DbClient to CommonDbClient to avoid confusion 53/6653/8
Benjamin Diaz [Mon, 8 Oct 2018 19:26:32 +0000 (16:26 -0300)]
Renames DbClient to CommonDbClient to avoid confusion

POL comunicates with two different databases, a relational
one, that stores records for alarms, scaling groups and more,
and a nonrelational one, that is common to all OSM modules,
which we call CommonDB, that currently corrsponds to a MongoDB
instance and stores nsds, vnfds, etc.
The name db_client and DbClient used in the file and
class that comunicates with CommonDB may be open to confussion,
so it has been renamed as common_db_client and CommonDbClient.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I8209cbc23b5ab129221d1c928703929e4f405a4c

5 years agoImplements aiokafka and modifies code to support asyncio 89/6689/11
Benjamin Diaz [Thu, 11 Oct 2018 15:34:20 +0000 (12:34 -0300)]
Implements aiokafka and modifies code to support asyncio

Replaces multithreading with asyncronous calls to kafka.
Implements the async/await keywords in methods that needed
it.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Ic93054dc9a6b3835e2eaf1a480e5081c5eb9d4f5

5 years agoAdds use of OSMPOL_SQL_DATABASE_URI config param to connect to DB 54/6654/4
Benjamin Diaz [Mon, 8 Oct 2018 19:34:17 +0000 (16:34 -0300)]
Adds use of OSMPOL_SQL_DATABASE_URI config param to connect to DB

The OSMPOL_SQL_DATABASE_URI was not being used by POL to connect
to the database. There was a hardcoded sqlite database name.
This change should now provide capability to the user to use any
SQL database engine supported by the peewee ORM (mysql/mariadb,
postgres, sqlite).

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Iff406862fb3dfeb4453fb3213c94db6d62385d96

5 years agoAdds deletion of alarms in case exception is thrown during scaling config 52/6652/4
Benjamin Diaz [Mon, 8 Oct 2018 19:25:36 +0000 (16:25 -0300)]
Adds deletion of alarms in case exception is thrown during scaling config

If a exception is thrown during the configuration of a scaling group, POL
will check if there have been alarms created through MON, and if that is
the case, it will delete them.
Also, it adds validation of the MON alarm responses. It throws an exception
if MON returns status: False, meaning there was an error creating the alarm.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I4f5f0c95ae2cce0c71efb73ff2e06cdf8ea08864

5 years agoMerge "Added LICENSE file to root folder" netslice
lavado [Sat, 13 Oct 2018 12:08:08 +0000 (14:08 +0200)]
Merge "Added LICENSE file to root folder"

5 years agoAdds vnf_member_index attribute to ScalingGroup model 74/6674/1
Benjamin Diaz [Wed, 10 Oct 2018 13:53:49 +0000 (10:53 -0300)]
Adds vnf_member_index attribute to ScalingGroup model

Changes default last_scale attribute in ScalingPolicy
to datetime.datetime.now.
Adds some debug logs.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds unique group_id to KafkaConsumer used in MonClient 71/6671/1
Benjamin Diaz [Tue, 9 Oct 2018 23:07:43 +0000 (20:07 -0300)]
Adds unique group_id to KafkaConsumer used in MonClient

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoModifies version_command to use pep440-git-full 66/6666/3
Benjamin Diaz [Tue, 9 Oct 2018 18:56:22 +0000 (15:56 -0300)]
Modifies version_command to use pep440-git-full

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds support for cooldown-time variable in scaling-policy 65/6665/3
Benjamin Diaz [Tue, 9 Oct 2018 18:04:24 +0000 (15:04 -0300)]
Adds support for cooldown-time variable in scaling-policy

Cooldown time defines the minimum time that needs to happen between
each scaling action. If an alarm triggers before this has happened,
no action should be executed. When POL receives an alarm notification
it will check that the difference between the current time and the
last scaling action of the alarm's scaling policy is bigger than the
cooldown time.
During configuration of the scaling groups, POL will now store the
cooldown time of the scaling policy. Also, it adds a new last_scale
var to ScalingPolicy, which has as default the oldest time supported
by Python datetime.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I6d110ccc7f89af29500c602d05054e7ba78808a0

5 years agoFixes StopIteration error in multi scaling group descriptor scenarios 59/6659/8
Benjamin Diaz [Mon, 8 Oct 2018 22:38:49 +0000 (19:38 -0300)]
Fixes StopIteration error in multi scaling group descriptor scenarios

The code was iterating over all vdus in a vnfd, instead of doing
so over the vdu refs inside the scaling-group. This lead to errors
when there was a vdu without the metric declared in the criteria.
It has been replaced to iterate over the vdus in the scaling group
descriptor, which is the correct behaviour.
This commit also fixes an error in the scale function, which was
still using the old db structure.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I8b8450534f739e6afecc2602086c868ffaee79bc

5 years agoRemoves filter param from osm-common function calls 62/6662/1
Benjamin Diaz [Tue, 9 Oct 2018 14:44:53 +0000 (11:44 -0300)]
Removes filter param from osm-common function calls

The filter argument was replaced to q_filter. Instead of
renaming the keyword arg, now functions are called using
only positional args.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoAdds handling of scaled life cycle operation 20/6620/2
Benjamin Diaz [Wed, 3 Oct 2018 18:52:47 +0000 (15:52 -0300)]
Adds handling of scaled life cycle operation

Configures alarms on vdus created after a scaling operation, which
correspond to the 'scaled' message, using the same handler used with
the 'instantiated' message, in which a check has been added to avoid
duplicate alarms.
It also fixes the vdu name used when creating the alarm through MON,
which is now the vdur name and not the vdu-id-ref used in the vnfd.
Finally, it adds a check for the scaling-type param in the scaling policy,
only executing the autoscaling logic if it is set to 'automatic'.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I3499ebdb5605f80ff73d905fbe3ac61d0d806687

5 years agoRefactor common_db client code 19/6619/2
Benjamin Diaz [Wed, 3 Oct 2018 17:36:49 +0000 (14:36 -0300)]
Refactor common_db client code

Creates DbClient which exposes methods to interact with the common
database, using osm_common module.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Ib81bb44e5f2c6ffd289380936b089af2f9e76e63

5 years agoAdds pip installation of python deps in deb package install 41/6541/25
Benjamin Diaz [Wed, 26 Sep 2018 23:12:58 +0000 (20:12 -0300)]
Adds pip installation of python deps in deb package install

Adds postinst script
Adds Makefile (there is an issue when using postinst with tox)
Adds stdeb.cfg declaring binary dependencies
Reenables flake8 in tox
Removes consumer timeout that should have never been there
Readds group_id in kafka consumer

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Ied0cb6135aee5f08cfd36c9cbaafa4c174b7434f

5 years agoAdded LICENSE file to root folder 69/6569/1
garciadeblas [Thu, 27 Sep 2018 08:29:33 +0000 (10:29 +0200)]
Added LICENSE file to root folder

Change-Id: I411ad72697d614558e9bed2b20e750b1725c6e2e
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
5 years agoFixup name of MON -> POL 32/6532/1
Mike Marchetti [Thu, 20 Sep 2018 18:51:45 +0000 (14:51 -0400)]
Fixup name of MON -> POL

Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
5 years agoFixes dependency error in setup.py 30/6530/1
Benjamin Diaz [Thu, 20 Sep 2018 17:12:52 +0000 (14:12 -0300)]
Fixes dependency error in setup.py

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
5 years agoMigrates POL code from MON repo 87/6487/2 v4.0.1
Benjamin Diaz [Fri, 14 Sep 2018 15:03:38 +0000 (12:03 -0300)]
Migrates POL code from MON repo

Adds support for VDU metric autoscaling
Modifies env var names

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: If9587e1b8eacaf6fb297306050a97d33c8a63ead

5 years agoInitial empty repository
garciadeblas [Fri, 31 Aug 2018 10:53:37 +0000 (12:53 +0200)]
Initial empty repository