Question about plan

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about plan

Scott
Hello

I have a question about execution plan of console.

In this url(http://pongasoft.github.io/glu/docs/latest/html/tutorial.html)
or In console

I can see some command like 'Deploy' 'Bounce 'Redeploy' 'Undeploy'.
I have no idea what it is. These are not status, command of statemachine.

Could you explain what these are?
Reply | Threaded
Open this post in threaded view
|

Re: Question about plan

frenchyan
Administrator
I am a bit surprised that in your previous message you said you built something on top of glu without understanding those concepts. Before you deep dive into changing the state machine or whatever else, I would strongly advise that you really get comfortable with what glu has to offer out of the box before tweaking it (changing the state machine...). I would also strongly suggest that if there is a requirement you have that does not seem to fit in the stock glu, you should ask on the forum about it because maybe there is a way to do it without changing glu. 

What you are asking for is somewhat explained here: http://pongasoft.github.io/glu/docs/latest/html/console.html#plans 

"Deploy" is the generic term that will bring whatever state your system is into the "desired state" (aka defaultEntryState), which by default is "running". So if you have an entry e1, that is not installed and another one (e2) that is "stopped", then glu will generate a plan to bring both of them to state "running". 

For this it will look for a "path" in the state machine to bring each entry to their desired state. In this example, for e1, it will run install, configure and start. For e2, it will run start only. You can see this in action by simply selecting the plan: the steps will be displayed in the right column (using the tutorial (e1=/sample/i001 and e2=/sample/i002) try to uninstall one of the entry and stop another one, then click deploy and you will see exactly what I am talking about).

Bounce is a shortcut which calls stop and start on all the entries (note that bounce only works with the default state machine) which are in a state that allow them to be called this way.

Undeploy brings all the entries to state NONE: glu will look for a "path" in the state machine to bring each entry to state NONE and execute all the actions involved to get there. After executing this, the entry is fully removed from the host (hence the name undeploy).

Redeploy first brings all the entries to state NONE then all the entries to state "desired state" or in other word, it is a shortcut to execute undeploy/deploy.

Yan
Reply | Threaded
Open this post in threaded view
|

Re: Question about plan

Scott
Right now I fully understand these plan type.
If you add this comment in the doc, it will be very helpful to underatand plan type for newbee.
 
I think I can handle some requirement with 'bounce' type and others can meet with script level.
As your advice I try to find a solution with default state machine.  

In your link 'Defining your own state machine' link is broken. It just see 404 page.

Thanks







Reply | Threaded
Open this post in threaded view
|

Re: Question about plan

frenchyan
Administrator
The documentation link was broken but fixed it yesterday. 

That being said, the section: http://pongasoft.github.io/glu/docs/latest/html/meta-model.html#meta-model-statemachine tells you exactly what to do to define your own state machine (no need to change the source code). 

=> you simply define it in the meta model (this correspond to step 2 of the easy production setup) as explained in the above link like so:

 stateMachine = [
   defaultTransitions: [
     NONE: [[to: 's1', action: 'noneTOs1']],
     s1: [[to: 'NONE', action: 's1TOnone'], [to: 's2', action: 's1TOs2']],
     s2: [[to: 's1', action: 's2TOs1']]
   ],

   defaultEntryState: 's2'
]
and that is all you have to do. Of course you need to define your own state names and transitions but that is all you have to do. I would strongly suggest to start from the state machine that comes with glu and modify it to suit your needs rather than defining a completely new one.

When you then generate the distributions (this corresponds to step 3 of the easy production setup), glu will automatically use your state machine.

Yan