osm/N2VC.git
5 years agofix minor error 69/6769/1
tierno [Fri, 26 Oct 2018 12:54:26 +0000 (14:54 +0200)]
fix minor error

Change-Id: Id1e90d7e45a78c45d6c1e2720f3688a79d43941d
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
5 years agoMerge "Relation support for multi-charm VNFs"
Adam Israel [Mon, 15 Oct 2018 17:12:07 +0000 (19:12 +0200)]
Merge "Relation support for multi-charm VNFs"

5 years agoFull charm support 89/6489/2
Adam Israel [Fri, 14 Sep 2018 15:32:35 +0000 (11:32 -0400)]
Full charm support

This work adds the ability to deploy charms directly to an
externally instantiated VM, which is expected to have N2VC's public key
injected into it, by using the VCA's manual provisioning function.

This allows the VCA to ssh to the target machine and provision it. The
charm will then be deployed directly to that machine, allowing the charm
to fully manage the VNF lifecycle.

Change-Id: I935e432fbd60a9a6bc10a499ae1b8e07c1e70c14
Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoRelation support for multi-charm VNFs 91/6491/4
Adam Israel [Fri, 14 Sep 2018 16:01:12 +0000 (12:01 -0400)]
Relation support for multi-charm VNFs

Adds support for establishing relations between charms

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I9a0b7725013e06635875cd824e219ab6a023efb3

5 years agoMerge changes Iacd2f028,I43a6d573,Ibb6c93bb netslice
Adam Israel [Thu, 11 Oct 2018 16:25:22 +0000 (18:25 +0200)]
Merge changes Iacd2f028,I43a6d573,Ibb6c93bb

* changes:
  Secure Key Management
  Improved integration tests
  [WIP] Multi-vdu, multi-charm support

5 years agoAdd debian packaging 68/6668/1
Adam Israel [Tue, 9 Oct 2018 19:17:50 +0000 (15:17 -0400)]
Add debian packaging

Adds debian packaging, including the vendored version of libjuju

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoSecure Key Management 88/6488/2
Adam Israel [Fri, 14 Sep 2018 15:26:13 +0000 (11:26 -0400)]
Secure Key Management

This patchset implements the Secure Key Management feature
as described in Gerrit 1429, enabling support for native charms
deployed to machines provisioned by the Resource Orchestrator.

- Implement GetPublicKey, which will provide the public key to be
injected into new machines
- Support machine placement, to provision an existing machine for use
with juju
- Automatically create a SSH keypair to be used for provisioning
- Add method to check if a charm is deployed (CI)
- Update integration tests to use new ssh key workflow

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: Iacd2f02800484fd90945f9b9c1ac2d8951115a76

5 years agoUpdate package versioning 94/6594/1
Adam Israel [Mon, 1 Oct 2018 14:35:42 +0000 (10:35 -0400)]
Update package versioning

Update the package versioning to include git hash

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoImproved integration tests 61/6561/2
Adam Israel [Fri, 21 Sep 2018 12:20:55 +0000 (14:20 +0200)]
Improved integration tests

This merge includes a refactored integration test framework, to better
take advantage of asyncio, and clarifies the test logic so it's easier
to extend in the future. It also supports testing of more complex VNFs,
such as multi-vdu, multi-charm VNFs.

n2vc/vnf.py:
- Remove duplicate status filtering, as it was a poor solution and lead
to situations where some callbacks were not sent.
- Added an internal refcount to track libjuju instantiation (helpful in
debugging)

tests/charms/layers/proxy-ci/reactive/proxy_ci.py:
- Fix name of install function (remove confusion while reading logs)

tests/base.py:
- Add debug() for more consistent and useful logging
- Refactor: remove parse_metrics
- Improved error handling
- Better LXD network connectivity verification
- Refactor test framework:
    - Better use of async coded
    - Make handling of test phase more robust
    - Support more complex test cases, such as multi-vdu, multi-charm

tests/integration/*
- Update to use refactored test framework

Other:
- `make clean` now removes charm artifacts in tests/charms/builds/
- `make lint` now ignores charm artifacts

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I43a6d573a7bafdfe3ccb0bb0f0f7d75dcc9c42b1

5 years ago[WIP] Multi-vdu, multi-charm support 84/6484/2
Adam Israel [Thu, 13 Sep 2018 21:14:51 +0000 (17:14 -0400)]
[WIP] Multi-vdu, multi-charm support

This work-in-progress adds support + integration testing for multi-vdu, multi-charm VNFs

TODO:
- Resolve race condition causing some tests to hang or not clean up
properly

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: Ibb6c93bb622c5807ed136cabc0c3b1cfcc50bdbf

5 years agoAdded LICENSE file to root of the repo 74/6474/3
garciadeblas [Thu, 13 Sep 2018 09:35:31 +0000 (11:35 +0200)]
Added LICENSE file to root of the repo

Change-Id: I36d495f1c5613663f321eed9fb3629ff29b5462f
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
5 years agoTox + Integration testing 66/6466/11
Adam Israel [Thu, 6 Sep 2018 23:22:47 +0000 (19:22 -0400)]
Tox + Integration testing

This commit implements a VNF Descriptor-driven integration
test framework, which will lead to integration tests being able
to run via jenkins, and more robust testing in general.

N2VC:

- Allow the use of an event loop passed when instantiating N2VC
- Refactor the execution of the initial-config-primitive so that it can
be easily re-run, such as the case of when a proxy charm is deployed
before the VNF's VM is created.
- Refactor GetPrimitiveStatus, to return the status (queued, running,
complete, failed) of a primitive.
- Add GetPrimitiveOutput, to return the output of a completed primitive
- Fix model disconnection when executing a primitive (it was happening
in the wrong scope)
- Fix wait_for_application, which was previously unused and broken
- Add support for parameter's 'data-type' field
- Add support for better SSH key management, allowing for a proxy charm
to be deployed before the VNF, so that it's public SSH key can be
injected when the VNF's VM is created.

Integration Tests:

The integration tests are intended to exercise the expected
functionality of a VNF/charm: deploy the charm, configure it as required
(i.e., ssh credentials), and execute the VNF's
initial-config-primitives.

- test_native_charm: deploy a native charm to a juju-managed machine and
verify primitive execution works
- test_proxy_charm: deploy a proxy charm, configured to talk to a remote
machine, and verify primitive execution works
- test_metrics_native: deploy a native charm and collect a metric
- test_metrics_proxy: deploy a proxy charm and collect a metric from the
vnf
- test_no_initial-config-primitive: deploy a vnf without an
initial-config-primitive
- test_non-string_parameter: deploy a vnf with a non-string parameter in
initial-config-primitive
- test_no_parameter: deploy a vnf with a primitive with no parameters

General:
- Add a build target to tox.ini so that a .deb is built via Jenkins

TODO (in a follow-up commit):
- test multi-vdu, multi-charm
- test deploying a native charm to a manually-provisioned machine
- Update inline pydoc
- Add more integration tests
- Add global per-test timeout to catch stalled tests

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: Id322b45d65c44714e8051fc5764f8c20b76d846c

5 years agoMerge "Integration test for metrics + bug fix"
Adam Israel [Thu, 13 Sep 2018 16:20:21 +0000 (18:20 +0200)]
Merge "Integration test for metrics + bug fix"

5 years agoMerge "Fix bug #502"
Adam Israel [Thu, 23 Aug 2018 14:45:10 +0000 (16:45 +0200)]
Merge "Fix bug #502"

5 years agoadding paramiko as required package 30/6430/1
tierno [Thu, 23 Aug 2018 10:31:02 +0000 (10:31 +0000)]
adding paramiko as required package

Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
5 years agoIntegration test for metrics + bug fix 08/6408/1
Adam Israel [Wed, 8 Aug 2018 16:54:55 +0000 (12:54 -0400)]
Integration test for metrics + bug fix

This commit:
- adds the beginnings of an integration testing framework
- adds an integration test to exercise metric collection
- adds a test charm with metrics collection
- fixes a potential bug that can cause N2VC to fail if no
initial-config-primitive is specified in the VNF descriptor

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoImproved Primitive support and better testing 94/6394/1 BUILD_v4.0.1_2
Adam Israel [Thu, 2 Aug 2018 19:32:00 +0000 (15:32 -0400)]
Improved Primitive support and better testing

This changeset addresses several issues.

- Improve primitive support so the status and output of an executed
primitive can be retrieved
- Merge latest upstream libjuju (required for new primive features)
- New testing framework
    This is the start of a new testing framework with the ability to
create and configure LXD containers with SSH, to use while testing proxy
charms.
- Add support for using ssh keys with proxy charms
    See Feature 1429. This uses the per-proxy charm/unit ssh keypair

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoFix bug #502 79/6379/1
Adam Israel [Mon, 23 Jul 2018 19:39:57 +0000 (15:39 -0400)]
Fix bug #502

This patch, in addition to change #6341 (Extend data-type to
initial-config-primitive), enables type casting of primitive parameters.
This enables primitives with non-string parameters from being executed.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoMerge "Bug 502 improvements" v4.0 BUILD_v4.0.1_1
Adam Israel [Tue, 17 Jul 2018 16:37:31 +0000 (18:37 +0200)]
Merge "Bug 502 improvements"

5 years agoBug 502 improvements 37/6337/1
Adam Israel [Tue, 17 Jul 2018 16:17:06 +0000 (12:17 -0400)]
Bug 502 improvements

While investigating bug 502, I found that the type mismatch is actually
being generated elsewhere (being investigated).

This adds a test that will trigger the exception, and makes sure that
executing a primitive will return the correct type of exception if it
fails.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoFix bug #501 35/6335/1
Adam Israel [Mon, 16 Jul 2018 18:18:41 +0000 (14:18 -0400)]
Fix bug #501

This fixes bug #501, where initial-config-primitive always expected a
parameter to be present.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoFix libjuju install versioning 89/6189/2 v4.0.0 v4.0.1
Adam Israel [Tue, 22 May 2018 14:03:35 +0000 (10:03 -0400)]
Fix libjuju install versioning

This updates the libjuju setup.py with the upstream version that pins
several python module version requirements.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I47a4723d1b3db7ace141dc106e6e781281c0ae61

5 years agoAdd workload message to callback 09/6109/2
Adam Israel [Wed, 9 May 2018 17:55:28 +0000 (13:55 -0400)]
Add workload message to callback

Add the charm's workload status message to the callback so more detailed
information can be provided to the user.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I1bcd502a2470dd5a527bc88cf24f2e3e6753da91

5 years agoDocumentation update 69/6069/2
Adam Israel [Thu, 3 May 2018 18:49:56 +0000 (14:49 -0400)]
Documentation update

 - Updates of the pydoc and README.md
 - Rebase
Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: I9da9c2fd4432af00f7c655ce4789ce6dac629bc9

5 years agoMerge "Return the uuid of the executed primitive" v3.1
Adam Israel [Mon, 7 May 2018 16:28:11 +0000 (18:28 +0200)]
Merge "Return the uuid of the executed primitive"

5 years agoBug fixes + Metrics 56/6056/1
Adam Israel [Thu, 3 May 2018 14:00:04 +0000 (10:00 -0400)]
Bug fixes + Metrics

- Fix bugs with setting Day 2 config
- Initial implementation of GetMetrics

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoImprove event monitoring/callbacks 21/6021/1
Adam Israel [Mon, 23 Apr 2018 20:04:54 +0000 (16:04 -0400)]
Improve event monitoring/callbacks

Improve the way we monitor changes within the Juju model, by maintaining
a single observer with an Application filter. This reduces the number of
duplicate callbacks being fired, and decreases the chatter between the
controller and client.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
5 years agoadd python-all for build 94/5994/1
Mike Marchetti [Wed, 18 Apr 2018 15:17:45 +0000 (11:17 -0400)]
add python-all for build

Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
5 years agoadd devops stages for pipeline 92/5992/1
Mike Marchetti [Wed, 18 Apr 2018 14:52:18 +0000 (10:52 -0400)]
add devops stages for pipeline

Signed-off-by: Mike Marchetti <mmarchetti@sandvine.com>
6 years agoReturn the uuid of the executed primitive 70/5970/1
Adam Israel [Fri, 13 Apr 2018 14:41:43 +0000 (08:41 -0600)]
Return the uuid of the executed primitive

Return the uuid of the queued primitive from ExecutePrimitive, the first
step in allowing the orchestrator check the status and output of the primitive.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
6 years agoImprove N2VC performance/functionality 60/5960/2
Adam Israel [Tue, 10 Apr 2018 19:04:57 +0000 (13:04 -0600)]
Improve N2VC performance/functionality

- Refactor test to support multi-vdu charms.
- Add support for deploying multi-vdu charms.
- Execute the initial-config-primitives

This is the first commit to add support for executing the
initial-config-primitive(s). There are some decisions that still need to
be made: how do we report primitive execution back to the
caller/callback in a meaningful way.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: Icc0ce41d256930b337c9097af9edcae2694207e8

6 years agoNew N2VC interface + updated libjuju
Adam Israel [Thu, 1 Mar 2018 14:31:50 +0000 (09:31 -0500)]
New N2VC interface + updated libjuju

This commit introduces the Python3 N2VC module, which acts as a standard
interface to the VCA.

The goal of this is to provide a common way for modules to interface
with the VCA.

- Updated libjuju from 0.6.1 to 0.7.3

Signed-off-by: Adam Israel <adam.israel@canonical.com>
Change-Id: Ide70fb5ae5797eb6486de24653dc09a23f9c009e

6 years agoUpdate libjuju
Adam Israel [Mon, 23 Oct 2017 16:00:49 +0000 (12:00 -0400)]
Update libjuju

- fix licensing quirks
- refresh against libjuju master

Signed-off-by: Adam Israel <adam.israel@canonical.com>
6 years agoInitial import of N2VC
Adam Israel [Mon, 23 Oct 2017 09:41:44 +0000 (11:41 +0200)]
Initial import of N2VC

This import kicks off the N2VC module.

Signed-off-by: Adam Israel <adam.israel@canonical.com>
6 years agoSquashed 'modules/libjuju/' content from commit c50c361
Adam Israel [Tue, 15 Aug 2017 19:26:43 +0000 (15:26 -0400)]
Squashed 'modules/libjuju/' content from commit c50c361

git-subtree-dir: modules/libjuju
git-subtree-split: c50c361a8b9a3bbf1a33f5659e492b481f065cd2

6 years agoMerge commit '19031b24b523c872c1ac367821dc60c950a09755' as 'modules/libjuju'
Adam Israel [Tue, 15 Aug 2017 19:26:43 +0000 (15:26 -0400)]
Merge commit '19031b24b523c872c1ac367821dc60c950a09755' as 'modules/libjuju'

6 years agoInitial empty repository
almagia [Fri, 12 May 2017 08:06:20 +0000 (10:06 +0200)]
Initial empty repository