<div dir="ltr"><div><div><div><div><div><div><div><div>One way to think of petitecloud is nothing more then a brillian script generator.  Namely it does all the precondtion checks on it's own and then generates a serialized script (no loops or conditionals) to the task it needs to do this.<br>
<br></div>Currently some of this done by doing one shot commands straight from the business logic (and the underlying drivers).   This makes stuff fast and easy for typical cases but some of the flexibility that we are talking about it breaks it very fast.<br>
<br></div>An example of such a design dilemma is hyperv support spread across muiltiple host OS's.   Namely the actual syntax (and sometimes the semantics) for how a given hyperv is called on one OS is different then on a different host OS.  Also sometimes the semantics even differ between the same hyperv on the same OS.  For example the only difference between "bhyve-freebsd" and "bhyve-linux" is the name of the bhyveload and how it is called (namely you need to also make/populate the device map dir).   <br>
<br></div>We realized a few weeks ago that this created a "N time M" problem in how many classes we have (i.e. we would need to subclass each hyperv for each supported OS).   This gets really hard to manage very quickly and is due to it's complexity likely to be the source of many bugs (i.e. bugs not in the scripts generated but the wrong script be generated [and within the context it was generated it is correct]).<br>
<br></div>An other solution is we just do a partial externalization of the scripts themselves.   This way we just do the mixing and matching at runtime and not compile time and the lack of a script template indicates lack of support (one major issue we had under the above design was how to handle unsupported operations).    <br>
<br></div>In order to do this right we would need to do the following:<br><br></div>1. Come up with a universal script templating system (i.e. tell PC where the blanks to be filled in are)<br><br></div>2. Refactor PC so all calls to OSCommand (except trivial ones that are only generation prep calls) they all go through some form of script<br>
<br></div>3. Redesign most of the sub-business logic architecture to be nothing but smart script callers (they internalize far too much right now)<br clear="all"><div><div><div><div><div><div><div><div><div><br>-- <br><div dir="ltr">
Aryeh M. Friedman, Lead Developer, <a href="http://www.PetiteCloud.org" target="_blank">http://www.PetiteCloud.org</a><br></div>
</div></div></div></div></div></div></div></div></div></div>