Hi Joshua,

Thank you very much for you feedback!
This is really a great question, and it was the first question we've asked
ourselves when we started thinking about this new design.
We've considered both options: to have our own syntax (python-like,
java-like, something-else-like) or to use YAML. We've chosen the latest,
and here are the reasons.

The most important moment: this is not a general-purpose language, but a
domain-specific one. And Murano's domain is manipulating with complex
nested data-structures, which are usually represented by YAML. Murano's
environments are in YAML. Murano's VM-side commands are wrapped into YAML.
The primary building blocks of Murano - Heat templates - are written on
YAML. Actually, at a simplified level murano's workflows can be thought of
as algorithms that just generate yaml fragments. So, it would be beneficial
for Murano to manipulate with YAML-constructs at the DSL level. If we use
YAML notation, yaml-blocks become first-class citizens in the language,
while in a regular python-like language they would be just
formatted-strings. For example, look at this code snippet which generates a
heat template to deploy an instance: http://paste.openstack.org/show/65725/
As you may see, the code on lines 7-11 is a Heat-template, seamlessly
embedded inside Murano's workflow code. It has the variables right inside
the template, and the Murano engine will substitute them with a
user-specified (or workflow-computed) data

Another reason for YAML: the notation is very easy to extend: you'll just
have to add some new predefined key and a handler for its value: the format
will not be broken, so older code will run out of the box, and even the
newer code will most probably run fine on the older parser (the unknown
sections will simply be ignored). This will allow us to extend the language
without making any breaking-changes. The regular languages do not provide
this flexibility: they will have problems if detecting unrecognised lexems
or constructs.

Last but not least: the perception. You are absolutely right when you say
that this is actually a full programming language. However, we don't want
to rush all its capabilities to unprepared developers. If some developer
does not want any complexity, they may think about it as about some fancy
configuration markup language: a declarative, heat-template-like header
followed by a sequence of simple actions. And only if needed the power
comes at your service: variable assignments, flow control, flexible data
contracts, complex compositions, inheritance trees.. I can imagine a lot of
scary stuff here J
But at the same time, YAML's indent-based syntax will look familiar to
python developers.

Yes, everything comes at cost, and yaml may seem a bit bulky at the first
glance. But I believe that people will get used to it soon enough, and the
benefits are really important.


I hope this answers your concern. We'll come up with more examples and
ideas: this thing has just emerged, nothing is set in stone yet, I am
actively seeking for feedback and ideas.  So thanks a loot for your
question, I really appreciate it.



--
Regards,
Alexander Tivelkov


On Fri, Feb 14, 2014 at 6:41 PM, Joshua Harlow <harlo...@yahoo-inc.com>wrote:

>  An honest question,
>
>  U are mentioning what appears to be the basis for a full programming
> language (variables, calling other workflows - similar to functions) but
> then u mention this is being stuffed into yaml.
>
>  Why?
>
>  It appears like u might as well spend the effort and define a grammar
> and simplistic language that is not stuffed inside yaml. Shoving one into
> yaml syntax seems like it gets u none of the benefits of syntax checking,
> parsing, validation (highlighting...) and all the pain of yaml.
>
>  Something doesn't seem right about the approach of creating languages
> inside the yaml format (in a way it becomes like xsl, yet xsl at least has
> a spec and is well defined).
>
>  My 2 cents....
>
> Sent from my really tiny device...
>
> On Feb 14, 2014, at 7:22 PM, "Alexander Tivelkov" <ativel...@mirantis.com>
> wrote:
>
>    Hi folks,
>
>  Murano matures, and we are getting more and more feedback from our early
> adopters. The overall reception is very positive, but at the same time
> there are some complaints as well. By now the most significant complaint is
> is hard to write workflows for application deployment and maintenance.
>
> Current version of workflow definition markup really have some design
> drawbacks which limit its potential adoption. They are caused by the fact
> that it was never intended for use for Application Catalog use-cases.
>
>  I'll briefly touch these drawbacks first:
>
>
>    1. Murano's workflow engine is actually a state machine, however the
>    workflow markup does not explicitly define the states and transitions.
>    2. There is no data isolation within any environment, which causes
>    both potential security vulnerabilities and unpredictable workflow
>    behaviours.
>    3. There is no easy way to reuse the workflows and their related
>    procedures between several applications.
>    4. The markup uses JSONPath, which relies on Python's 'eval' function.
>    This is insecure and has to be avoided.
>    5. 5. The workflow markup is XML-based, which is not a common practice
>    in the OpenStack community.
>
>   So, it turns out that we have to design and implement a new workflow
> definition notation, which will not have any of the issues mentioned above.
>
> At the same time, it should still allow to fully specify the configuration
> of any third-party Application, its dependencies with other Applications
> and define specific actions which are required for Application deployment,
> configuration and life cycle management.
>
> This new notation should allow to do the following:
>
>
>    -
>
>    List all the required configuration parameters and dependencies for a
>    given application
>    -
>
>    Validate user input and match it to the defined parameters
>    -
>
>    Define specific deployment actions and their execution order
>    -
>
>    Define behaviors to handle the events of changes in application's
>    environment
>
>
>  Also, it should satisfy the following requirements:
>
>
>    -
>
>    Minimize the amount of configuration for common application parts,
>    i.e. reuse existing configuration parts and add only difference specific to
>    the application.
>    -
>
>    Allow to use different deployment tools with using the same markup
>    constructs. i.e. provide a high-level abstraction on the underlying tools
>    (heat, shell, chef, puppet etc)
>    -
>
>    For security reasons it should NOT allow to execute arbitrary
>    operations - i.e. should allow to run only predefined set of meaningful
>    configuration actions.
>
>
>
>  So, I would suggest to introduce a simple and domain specific notation
> which would satisfy these needs:
>
>    -
>
>    Application dependencies and configuration properties are defined
>    declaratively, in a way similar to how it is done in Heat templates.
>    -
>
>    Each property has special constraints and rules, allowing to validate
>    the input and applications relationship within the environment.
>    -
>
>    The workflows are defined in imperative way: as a sequence of actions
>    or method calls. This may include assigning data variables or calling the
>    workflows of other applications.
>    -
>
>    All of these may be packaged in a YAML format. The example may look
>    something like this [1]
>
>
>  The final version may become a bit more complicated, but as the starting
> point this should look fine. I suggest to cover this in more details on our
> next IRC meeting on Tuesday.
>
>  Any feedback or suggestions are appreciated.
>
>
>  [1] https://etherpad.openstack.org/p/murano-new-dsl-example
>
>  --
>  Regards,
> Alexander Tivelkov
>
>  _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to