Conversation
|
incubator-brooklyn-pull-requests #1847 FAILURE |
|
incubator-brooklyn-pull-requests #1848 SUCCESS |
60ad177 to
0a5b89a
Compare
|
incubator-brooklyn-pull-requests #1861 FAILURE |
0a5b89a to
725e54d
Compare
|
incubator-brooklyn-pull-requests #1862 FAILURE |
|
@kiuby88 Thanks for this, would you mind rebasing and I'll dive into this shortly? |
|
Thanks for your reply. |
725e54d to
5e97762
Compare
There was a problem hiding this comment.
This method fix the type location for this entity, for example ssh or PaaS. So, it is not possible to start (migrate #924) the entity to a new kind of location. I think we could review discuss this point.
ca95a73 to
44f2845
Compare
For adding PaaS support, a CloudFoundryLocation is added which is based on PaasLocation. This new location contains a API client for CloudFoundry Paas Services, (CloudFoundry Java Client), that allows to use the services of this provider. Extracting ssh behaviour from SoftwareProcessImpl: provisioning flags For adding paas support, SoftwareProcess entities should to be agnostics in order to allows to be deployed on SSH and PaaS locations. So, the machine behaviour and management should be decoupled of the entities and it should be moved to an isolate class. SoftwareProcessImpl contained a pair of method for obtaining the needed flags to create and configure a VM. However as it was mentioned previously, this entity shouldn't contain any ssh (machine) behaviour. Then, this code is moved to an external class, MachineProvisioningLocationFlagsSupplier that is managed in SoftwareProcessImpl as a LocationFlagSupplier interface. Moreover, an equivalent class is added to represent this behaviour (obtain flags location) for PaaS. SoftwareProcessImpl will select a behaviour for obtaining the flags depending on the selected location for deploying the entity. Adding BehaviourFactory for selecting PaaS or SSH behaviour in run time. Following the previous commits, SoftwareProcessImpl entities should select PaaS or SSH behaviour in run time, depending on the target location. An entity know the target location when it is started (calling to start effector), then just when this effector is called the entity will able to know the selected location, so in this moment the entity will able to find the required behaviour, SSH or PaaS. The whole behaviour is composed by several classes, then SoftwareProcessImpl uses a factory (BehaviourFactory) which is selected according to the target location. This factory allows to select in run time all behaviour focus in a location. Adding PaaS support to TomcatServer entity. The drivers for CloudFoundry are added to SoftwareProcess entity and JavaWebAppSoftwareProcess implementation entity. The final PaaS support is added to TomcatServer entity using a new driver which is focused on CloudFoundryPaaSLocation. A new hierarchy of drivers is added to Brooklyn, these new drivers is oriented to PaaS but they follow the hierarchy defined for SSH. For example, AbstractSoftwareProcessDriver, AbstractSoftwareProcessSshDriver allow to SoftwareProcess entities use drivers for location based on machines. Then, to enable the PaaS support for SoftwareProcess entities a set of drivers is added such as AbstractSoftwareProcessCloudFoundryDriver and AbstractApplicationCloudFoundryDriver. Fixing dependency convergence
c749726 to
0dfbd91
Compare
Changing getRequiredOpenPorts method visibility Changing RequiredOpenPort visibility LIFECYCLE_EFFECTOR_TASK was modified. If you add a LIfecycleEffectorTask as a entity ConfigKey, then this entity will use this LifecycleEffectorTask and it will not take in account the target location. TestJavaWebAppEntity is modified, too.
6653476 to
007053f
Compare
007053f to
f4395e6
Compare
For adding PaaS support, a
CloudFoundryLocationis added which is based onPaasLocation.This new location contains a API client for CloudFoundry Paas Services, (CloudFoundry Java Client), that allows to use the services of this provider.
Extracting ssh behaviour from
SoftwareProcessImpl: provisioning flagsFor adding paas support,
SoftwareProcessentities should to be agnostics in order to allows to be deployed on SSH and PaaS locations. So, the machine behaviour and management should be decoupled of the entities and it should be moved to an isolate class.SoftwareProcessImplcontained a pair of method for obtaining the needed flags to create and configure a VM. However as it was mentioned previously, this entity shouldn't contain any ssh (machine) behaviour. Then, this code is moved to an external class,MachineProvisioningLocationFlagsSupplierthat is managed inSoftwareProcessImplas aLocationFlagSupplierinterface. Moreover, an equivalent class is added to represent this behaviour (obtain flags location) for PaaS.SoftwareProcessImplwill select a behaviour for obtaining the flags depending on the selected location for deploying the entity.Adding
BehaviourFactoryfor selecting PaaS or SSH behaviour in run time.Following the previous commits,
SoftwareProcessImplentities should select PaaS or SSH behaviour in run time, depending on the target location. An entity know the target location when it is started (calling to start effector), then just when this effector is called the entity will able to know the selected location, so in this moment the entity will able to find the required behaviour, SSH or PaaS.The whole behaviour is composed by several classes, then
SoftwareProcessImpluses a factory (BehaviourFactory) which is selected according to the target location. This factory allows to select in run time all behaviour focus in a location.Adding PaaS support to
TomcatServerentity.The drivers for CloudFoundry are added to
SoftwareProcessentity andJavaWebAppSoftwareProcessimplementation entity.The final PaaS support is added to
TomcatServerentity using a new driver which is focused onCloudFoundryPaaSLocation.A new hierarchy of drivers is added to Brooklyn, these new drivers is oriented to PaaS but they follow the hierarchy defined for SSH. For example,
AbstractSoftwareProcessDriver, 'AbstractSoftwareProcessSshDriverallow to 'SoftwareProcess' entities use drivers for location based on machines. Then, to enable the PaaS support forSoftwareProcessentities a set of drivers is added such asAbstractSoftwareProcessCloudFoundryDriverandAbstractApplicationCloudFoundryDriver`.Fixing dependency convergence.
TODO:
starteffector body inSoftwareProcessImplbecause currently the first target location fixes the behavior of the entity.restarteffector should be defined.Tested Providers
This approach has been tested using: