SINTEF-9012/cloudml

Question about resource ordering

paxti opened this issue · 3 comments

Hi again,

I have a question regarding ordering resource execution. For example I have few resources in InternalComponent and few in Relationship (which are set with .setClientResource()). Right now for some reason resource in Relationship executing first, Is there is way to set what is the order should be? Or at least how to execute all resources in InternalComponent before resources in Relationship.

Exaple :

InternalComponent client = new InternalComponent("client", platform);
client.getProvidedPorts().add(clientProvided);

Relationship connection = new Relationship("connection", cleintRequired, serverProvided);
connection.setClientResource(connectionRes);

Best regards, Iurii

Hi,

The deployment order is defined on the basis of the dependencies between the components.
It is not an ordering between the resources but between the commands in the resources.
The process can be simplified as follows:

  1. Provision and prepare all VMs and PaaS services
  2. For each internal component
    2.1. Execute the upload and download commands
    2.2. Install all its dependencies (in term of component)
    2.3. Execute the install command
  3. Execute the commands associated to the relationships
  4. Execute all start command

Best regards,
Nicolas

Thank you far an answer, but what if i absolutely need to have some software to be installed in all instances before executing any command for actually Resources. Is there is a way to use RequiredExecutionPlatform for this somehow? And can you elaborate a bit more on "2.2. Install all its dependencies (in term of component) "

About 2.2, if a component instance requires another component instance meaning it has a requiredPort instance linked with a relationship instance to a provided Port from another component, and if this requiredPort is defined as mandatory, then the required component will be installed first. Similarly, if a component require an execution platform, the component offering the execution platform will be installed first. In both cases, by install I mean: the download, configure and install commands are executed. Components are installed only once.

Thus, if you want a component to be installed before the others there are several options:

  • you can for instance specify that all the other components will require it as execution platform
  • you can use relationships with the mandatory property set to true in the required port.

Regarding your question about the possibility to define the order in which the commands are executed, this is an ongoing work which is not yet available.

Also, if you just want to log the order in which the commands will be performed you can activate the debug mode in the facade: https://github.com/SINTEF-9012/cloudml/tree/master/facade/src/main/java/org/cloudml/facade/commands