Commit Graph

20 Commits

Author SHA1 Message Date
Alexander Tivelkov d698116869 Configuration is now properly applied to new nodes
If the configuration of software component has not been changed, but a
set of nodes in the server group has been modified, the component's
default checkClusterIsConfigured method will now properly return true,
thus the configuration will be applied on newly added nodes.

This is achieved by storing instance ids as part of component's
'configuration' attributed stored for its server group.

Change-Id: Ic8bbddc577518071d90a6e33518156047a1d2e2e
Closes-bug: #1634206
2016-11-17 00:48:11 +00:00
npraveen35 bbc3b20a3a Added LICENSE to application development library
Change-Id: Ib9c936c15c86284a2194b2d28ba254aeece8105f
Closes-Bug: #1633546
2016-10-17 13:19:46 +05:30
Tetiana Lashchova 4a53732501 Fix indentation in ReplicationGroup class
Change-Id: I5dba69da4a1488ad3f0c6e745fa39174e34a85cd
Closes-Bug: #1629853
2016-10-03 18:30:56 +03:00
Stan Lagun b7c2cb4898 Fixes invalid expression in app dev framework
Change-Id: Icb298e6a5fb044b02ec13c05e0d7f918f0ad14d8
Closes-Bug: #1618797
2016-09-05 08:45:11 +00:00
Stan Lagun ac7940a5bb MasterSlave* classes were deleted
Classes were removed for the following reasons:

1) They doesn't bring any significant value. Especially for complex
    apps where the are supposed to be used
2) The naming is not appropriate
3) There are no appropriate names exist because those classes can
   be equally good used for scenarios where there is a primary/secondary
   nodes, when there are 2 types of nodes with different relations or
   even for just 2-components apps
4) Thus property names like master and slave limit inheritors in
   giving them better names that better reflect component roles
   within the application

Change-Id: Ia47f0ee42e03706223e73eaced44fda8f22fe814
Closes-Bug: #1617363
2016-08-29 14:18:03 -07:00
Stan Lagun 077a3c364b Update app dev framework with multi-region support
When security rules were applied they were were
applied to the environment's Heat stack. Now they
are applied to each region's stack application
instances belong in.

Change-Id: Ia94cf24bcf517af7db57117f86c7b802423f81df
2016-08-29 11:40:34 -07:00
Stan Lagun 1e16a4e3e3 OpenstackSecurityConfigurable was renamed
The new name is OpenStackSecurityConfigurable
which differs in one latter casing.

Change-Id: Ifb2e29701de694d9365e08da086477b40452d6ba
2016-08-26 02:37:59 +00:00
Stan Lagun 6395787409 Adds more replica provider primitives
This commit introduces several basic building blocks
for replication providers:

* PoolReplicaProvider returns replica from the prepopulated pool (that
  can become empty over time). Released replicas are returned to the pool.

* RoundrobinReplicaProvider returns items from the prepopulated
  list. When the list is exhausted it returns them again thus reusing
  the items. This is usually needed to spread the load between
  fixed number of servers or other cloud resources.

 * CompositeReplicaProvider allows to combine several replica
   providers into one. When new replica is requested it tries to
   obtain it from the underlay providers one by so if the first
   replica provider goes out of resources the second is used
   for further allocations.

 Also refactor replica release interface to better handle
 down-scaling by more than 1 item

Change-Id: I923b2c6d0cd3a881be323399b7b13481e9a4a459
2016-08-23 16:26:49 +00:00
Stan Lagun 0a379e58e7 Migration of replication to the template() contract
With introduction of template() contract method
most of the functionality of the replication code
is now built in into murano.

This commit removes unneeded classes, simplifies
replication and fixes bugs from previous commits

Change-Id: I4b2c7c9faa5b0773f2b398e4265f456010766fd9
2016-08-23 15:43:28 +00:00
Alexander Tivelkov 7f8ee1be26 Base Application classes for App Development Framework
Added 6 base classes which may be inherited by app developers to
utilize the benefits of Application Development Framework:

* SingleServerApplication - an app which is a software component of
  its own and expects a single server as an input. Deploys itself on
  this server.

* MultiServerApplication - an app which is a software component of its
  own. Expects a ServerGroup as an input. Deploys itself on all
  servers of this group.

* MultiServerApplicationWithScaling - same as MultiServerApplication
  but also capable of scaling in and out.

* MasterSlaveApplication - a composite application which consists of a
  'Master' and 'Slave' software comonents and two ServerGroup's (the
  second one being optional). First installs the 'Master' component on
  the first group, then - the 'Slave' component on the second (or the
  first, if the second group is not specified)

* MasterSlaveApplicationWithMasterScaling - same as
  MasterSlaveApplication but also capable of scaling its 'master'
  group in and out.

* MasterSlaveApplicationWithSlaveScaling - same as
  MasterSlaveApplication but also capable of scaling its 'slave' group
  in and out.

Both MasterSlaveApplicationWithMasterScaling and
MasterSlaveApplicationWithSlaveScaling can be inherited by a single
class to achieve both master and slave scaling capabilities.

Targets-blueprint: application-development-framework

Change-Id: I153c6865d8295b44254c50535c61edca44553ca8
2016-08-22 03:47:02 +00:00
Alexander Tivelkov 5da4efd9bb Extracted replication capabilities from ServerGroup
ServerGroup is now split into ServerGroupList and ServerReplicationGroup.
The ServerGroup class is now the base interface for both.

ServerGroupList (previously just ServerGroup) class no longer
inherits ReplicationGroup, thus just being a collection of servers,
without the mandatory provider property.

Replication functionality extracted to ServerReplicationGroup, being a
subclass of both ServerGroup and ReplicationGroup. Apps requiring
autoscaling may narrow down their contracts to ServerReplicationGroup.
Others may stay with a base class.

Also introduces CompositeServerGroup which is a convenient
way to join several ServerGroups into one.

Change-Id: Ia15659c43422551785a762b4dce3bde312a7915f
2016-08-22 03:46:40 +00:00
Alexander Tivelkov f965e10705 SoftwareComponent hierarchy refactoring
Introduced a number of changes to classes of SoftwareComponent
hierarchy:

* BaseSoftwareComponent class removed, Installable and Configurable have
  no base anymore.

* Allowed number of failures may now be configured independently for
  different workflows.

* Allowed number of failures extended with 'two' and 'three'.

* Attribute usage for state persistence is simplified: attributes are
  now saved on appropriate servers and server groups.

* Inverted the names and semantics of status checking methods: they now
  return true if the needed status is already applied and no further
  action is needed.

* on%something% methods no longer trigger events, they have no default
  bodies at all, so it's easier to override them; events are triggered
  by the caller method.

* Handler methods got more arguments: besides the primary argument (a
  servergroup or a server) they get a list of pending servers, failed
  servers et.

* Some methods and method arguments renamed for consistency.

Change-Id: Ic52e66014d18e7fe640b79dd161286a1a9ebe15e
2016-08-18 11:21:22 +00:00
Alexander Tivelkov 58d92abb16 Improved Server naming and provisioning reporting
Changed the pattern of component name for servers created with
ServerProviders (now they always have names like 'Server-X' where X is
the index of server, followed by a name of an owning ServerGroup if
one exists), as well as the reporting of Server's provisioning (it now
happens even if the server of server group do not have their component
names)

Change-Id: I6a92b7951606069e576824a0ba4135275b959776
2016-08-18 03:13:23 +00:00
Alexander Tivelkov f30906848a Renamed Instance* to Server*
The naming of the classes which were working with servers was
inconsistent: at some places they were referenced as "instances", at
some others as "servers". This is inconsistent, also the word
'instance' is too generic.

So a refactoring was made: InstanceGroup and InstanceProvider were
renamed to ServerGroup and ServerProvider. Some other properties and
variable names were renamed accordingly.

Change-Id: I4ce2d09ae890aec4eb61d9719932c65457fb6dba
2016-08-18 03:13:17 +00:00
Alexander Tivelkov 1995f044d6 AppDevFramework: Server Replication reporting
Added a reporting if more then one server is being added/removed
to/from InstanceGroup

Change-Id: Id72afb4dfd56f293e022e39e35c5c1bd3bb29ed2
2016-08-18 02:04:33 +00:00
Alexander Tivelkov a75c16e153 Fixed reporting in app development framework
Fixed several reporting-related bugs in io.murano.applications
framework:

* when reporting was relying on the presence of possibly uninitialized
  property of Environment

* when environment for reporting was not accessible due to property
  protection level

* when reporting was done for an instance object name instead of
  hostname

Closes-bug: #1610997

Change-Id: Id517a511937fa1f65b5fec6bcd0ff5dbe1b33812
2016-08-08 17:04:01 +00:00
Alexander Tivelkov ef85e7ead9 SoftwareComponent implementation
Added two classed to implement two basic application workflows:
installation and software configuration, with appropriate error
handling, reporting, event-based notifications and so on. A class
called 'SoftwareComponent' inherits both these classes and is able to
run these two workflows sequentially to install and configure software
on given Instance Groups.

Change-Id: Ic0c1bbad1f0e3ae71b339c56db245075bcc420ac
Targets-blueprint: application-development-framework
2016-07-29 16:56:20 +03:00
Alexander Tivelkov 79dcbb3685 InstanceGroup and InstanceProvider hierarchy
Added 'InstanceGroup' - an Instance-based implementation of
'ReplicationGroup' class, and a 'LmiProvider' - a factory class capable
of producing objects of LinuxMuranoInstance class for the
InstanceGroup by cloning a given 'source' instance.

Change-Id: If3e450d8261a8a5510a2b43f8842fa4023efd15a
Targets-blueprint: application-development-framework
2016-07-28 19:24:42 +03:00
Alexander Tivelkov e853cf861b Event Notification pattern implemented
This patch adds an 'Event' class which may be used to issue various
notifications to other MuranoPl classes in an Event-driven manner.

Any object which is going to emit the notifications should declare the
instances of this new class as its public Runtime properties. The
objects going to subscribe for the notifications should pass
themselves into the 'subscribe' method of the Event along with the
names of their methods which will be used to handle the notification.

The specified handler methods must be present in the subscriber class
(if the method name is missing it will be defaulted to the
'handle%Eventname%') and has at least one standard (i.e. non-vararg
or kwarg) argument.

The class going to emit the notification should call the 'notify'
method of the event and pass itself as the first argument. All the
optional parameters of the event may be passed as varargs/kwargs of
the 'notify' call and will be passed all the way to the handler
methods.

Since this approach relies on the reflection this patch also fixes a
bug #1596647 since its fix is required for the argument reflection to
work properly. It also documents new reflection capabilities which
were added as part of the bugfix.

Targets-blueprint: application-development-framework
Closes-Bug: #1596647
Change-Id: Ifa7053e4c7b8456030e8df743f57ed812104b064
2016-07-28 18:50:04 +03:00
Alexander Tivelkov d9f0addfa0 Replication classes of Application Development Framework library
This is a first commit for a library package for Application
Development Library (earlier known as "Scalable Framework") called
io.murano.applications

This patch includes the base classes for node Replication
(ReplicaProvider and ReplicationGroup) and their Test-Runner-based
tests, as well as two reference implementations of ReplicaProvider -
one based on the templating (TemplateReplicaProvider) and another one
based on the cloning of passed objects (CloneReplicaProvider).

Both reference provider implementations are covered with their own
tests.

Targets-blueprint: application-development-framework
Change-Id: Ia6a48d51f41693fbb85d2b6c2851c1c286c6aa23
2016-07-28 18:49:59 +03:00