Skip to content

Conversation

kiuby88
Copy link
Contributor

@kiuby88 kiuby88 commented Sep 22, 2015

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, '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:

  • It should be necessary to define the start effector body in SoftwareProcessImpl because currently the first target location fixes the behavior of the entity.
  • The restart effector should be defined.
  • Some methods could be renamed.

Tested Providers

This approach has been tested using:

@asfbot
Copy link

asfbot commented Sep 22, 2015

incubator-brooklyn-pull-requests #1847 FAILURE
Looks like there's a problem with this pull request

@asfbot
Copy link

asfbot commented Sep 22, 2015

incubator-brooklyn-pull-requests #1848 SUCCESS
This pull request looks good

@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from 60ad177 to 0a5b89a Compare September 25, 2015 10:42
@asfbot
Copy link

asfbot commented Sep 25, 2015

incubator-brooklyn-pull-requests #1861 FAILURE
Looks like there's a problem with this pull request

@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from 0a5b89a to 725e54d Compare September 25, 2015 11:42
@asfbot
Copy link

asfbot commented Sep 25, 2015

incubator-brooklyn-pull-requests #1862 FAILURE
Looks like there's a problem with this pull request

@robertgmoss
Copy link
Contributor

@kiuby88 Thanks for this, would you mind rebasing and I'll dive into this shortly?

@kiuby88
Copy link
Contributor Author

kiuby88 commented Nov 24, 2015

Thanks for your reply.
@robertgmoss, I will rebase asap.

@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from 725e54d to 5e97762 Compare November 24, 2015 20:34
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from ca95a73 to 44f2845 Compare November 25, 2015 17:28
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
@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from c749726 to 0dfbd91 Compare November 25, 2015 17:48
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.
@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch 2 times, most recently from 6653476 to 007053f Compare November 27, 2015 10:13
@kiuby88 kiuby88 force-pushed the feature/paas-cf-support branch from 007053f to f4395e6 Compare November 27, 2015 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants