RE: Please help me on Parallel deployment

"Guijarro, Julio" <[email protected]>
Newsgroups gmane.comp.java.smartfrog.user
Message-ID <8D5B24B83C6A2E4B9E7EE5FA82627DC960178D@sdcexcea01.emea.cpqcorp.net>
Hi,

I think the problem could be a misunderstanding of the workflow
components Run and Parallel.

From the workflow manual:
---
- Run
Run is a component that, during its start phase locates the action
attribute - which must be a component description provided as a LAZY
component - and deploys it as a separately running application. Once
this is done, the run component terminates asynchronously. It fails if
the application has not been started correctly. 

The launched application would normally name itself on some host so that
it may later be found - normally using the sfProcessComponentName
attribute.

Alternatively, it is possible to provide a link to a parent compound and
the name the component should have in that compound. This is done using
the attributes parent and asName as defined in the prototype above.

- Sequence
A Sequence takes each component through its entire lifecycle, one at a
time. As the first terminates, the second is created and starts. The
templates for these components are found in the actions component
description, and they are created, initialised and started in the order
given in the component description.

The first component is created, initialised and started during the
sfStart of the sequence. It is then left to run to completion, at which
point the next template is taken and a component created and started.
This continues until one of the components terminates abnormally or all
the components have completed their lifecycles.

- Parallel

Secondly, the sub-components are only created, initialised and started
during the sfStart phase of the parallel, rather than during its
equivalent phase. Again, this is to conform to the general structure of
SmartFlow.

Thirdly, the parallel waits until each of the sub-components terminates
before terminating itself. This is true, at least, for normal
termination. Any abnormal termination is considered fatal and the whole
parallel and its remaining sub-components will be terminated. This is
also true of any forced termination by a non-child component.

Note that the parallel components have their lifecycle phased with
respect with each other, so during their initialisation they may
reference each other, locate each other, and so on. Note also, that once
created they sub-components are children of the Parallel component
itself, and are named using the names given in the actions component
description. LAZY references from elsewhere should therefore take
cognisance of this rather than assuming the sub-components will be
within the actions component description.

---

In short: 
- Parallel only differs from Compound in its termination lifecycle:
waits until each of the sub-components terminates before terminating
itself. 
- Run: Spawns its action and once this is done, the run component
terminates asynchronously (like & in Unix). It is possible to provide a
link to a parent compound and the name the component should have in that
compound.

In your description you have:

Sequence
  - Run
 	Parallel -> I have the impression you wanted a Sequence here.
Correct me if I am wrong.
  - Run
	Parallel

I can see some possible problems in this description:

1- In this way, your sequence will launch your two parallels and
terminate as soon as the last Run terminates. It could be that this is
your desired behavior but it is not clear to me from your email.

2- I think that you consider that Parallel will deploy your other
descriptions in true parallelism and it is not. It will drive them
through their normal lifecycle. To have a real parallel deployment
(component lifecycle) you could make every action inside parallel be a
Run and each Run to register its action with the parent Parallel. The
alternative is that we modify Parallel so that it could also deploy the
actions asynchronously in separate threads.


I don't know if this helps. Could you be more precise about the workflow
that you want to have?

Regards, 
		Julio Guijarro



> -----Original Message-----
> From: smartfrog-support-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:smartfrog-
> [email protected]] On Behalf Of
helcyon1-ss4n/[email protected]
> Sent: 14 January 2005 04:56
> To: smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Subject: [Smartfrog-support] Please help me on Parallel deployment
> 
> Hi,
> 
>  I'm a Phd student in Georgia Tech who is researching automatic
deployment
> using Smartfrog system.
> Currently, I try to deploy 3-tier system composed of MySQL, Tomcat,
> Apache, and JPetstore using Smartfrog version 3.04.008_beta.
> In this project, I need to control the workflow of the deployment.
That
> is,
> When installing MySQL, Tomcat, and Apache, they must be parallelly
> installed to target machines. But when configuring them, it must be
> controlled by the order defined in the workflow.
> Now, the installation of 3-tier is not parallelly.
> Can you tell me the reason?
> The below is the simplified sf file I made for the deployment.
> 
> Thanks,
> ----------------------------------------------------------------
> sfConfig extends Sequence{
>    actions extends LAZY{
> 
>       do_qq extends Run{
>          action extends LAZY Parallel{
>             sfProcessComponentName "eventQueue";
>             queue_Apache_Installation extends EventQueue;
>             queue_Apache_Configuration extends EventQueue;
>             queue_Apache_Ignition extends EventQueue;
>             queue_Tomcat_Installation extends EventQueue;
>             queue_Tomcat_Ignition extends EventQueue;
>             queue_MySQL_Installation extends EventQueue;
>             queue_MySQL_Configuration extends EventQueue;
>             queue_MySQL_Ignition extends EventQueue;
> 	 }
>       }
> 
>       do_ww extends Run{
>          action extends LAZY Parallel{   //This part must be parallel
>             actions extends LAZY{
>                // the below components are written at the above
sfCofig.
>                // they are omitted in this simplified code.
>                // they contain the event machanism using queues
defined
>                // above to install, config, and run.
>                mymysql_ins extends mysql_ins;
>                mytomcat_ins extends tomcat_ins;
>                myapache_ins extends apache_ins;
>                myapache_conf extends apache_conf;
>                mymysql_conf extends mysql_conf;
>                mymysql_ig extends mysql_ig;
>                mytomcat_ig extends tomcat_ig;
>                myapache_ig extends apache_ig;
>             }
>          }
>       }
>    }
> }
>
-----------------------------------------------------------------------
> 
> 
> 
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Smartfrog-support mailing list
> Smartfrog-support-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/smartfrog-support


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.