ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tal Liron <...@gigaspaces.com>
Subject Re: Query related to substitution mapping
Date Fri, 26 May 2017 16:09:51 GMT
Thanks, DJ. Much clearer now. Also it seems that the Apache mailing list
throws away attachments, so we will have to paste things in email.

I will clarify my meaning: I did not mean to say that you need to import
types, just that those types must be *available*. Indeed you'll see that
the examples given in the TOSCA spec don't use imports all. However, those
examples use standard simple profile types. In your example you are using a
custom type.

How substitution mapping actually happens depends on the orchestrator,
TOSCA only specifies the grammar. So, how would the orchestrator know that
types in different services are compatible and can be
chained/proxies/whatever in order to implement service composition? All
TOSCA provides us with here is names: the type name and the mapped
capability names.

That's fine, but ARIA is a validating parser. It doesn't just treat these
names at arbitrary strings, it checks to make sure that the type exists and
that that the mapped capabilities match those in the type. This is critical
for making sure the resulting service is valid and can indeed be composed
by the orchestrator.

So, how would you make sure that db.yaml knows about the
"my.nodes.database" type? My proposed solution is to always define types in
separate files (think: header files in C) which could then be imported by
any other file that needs them.

In this case I would "my.nodes.database" in its own file, let's say
types.yaml. Then db.yaml and web.yaml can both import types.yaml. The
former is a "provider" while the latter is a "consumer", but both work with
the same basic type.

Does this make sense?






On Fri, May 26, 2017 at 4:18 AM, D Jayachandran <d.jayachandran@ericsson.com
> wrote:

> Hi Tal,
>
> Did you get the attachments ?
>
> If not . . please find below templates.
>
> db.yaml
>
> tosca_definitions_version: tosca_simple_yaml_1_0
>
> topology_template:
>
>   substitution_mappings:
> #    node_type: tosca.nodes.Database
>     node_type: my.nodes.database
>     capabilities:
>       database_endpoint: [ db_app, database_endpoint ]
>
>   node_templates:
>
>     db_app:
>       type: tosca.nodes.Database
>       properties:
>         name: sub_map_db
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>       requirements:
>         - host:
>             node: db_server
>
>     db_server:
>       type: tosca.nodes.DBMS
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>       requirements:
>         - host:
>             node: db_host
>
>     db_host:
>       type: tosca.nodes.Compute
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>
>
> web.yaml
>
> tosca_definitions_version: tosca_simple_yaml_1_0
>
> imports:
>   - ./db.yaml
>
> node_types:
>   my.nodes.database:
>     derived_from: tosca.nodes.Database
>
> topology_template:
>
>   node_templates:
>
>     web_app:
>       type: tosca.nodes.WebApplication
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>       requirements:
>         - host:
>             node: web_server
>         - dependency:
>             node: database
>
>     web_server:
>       type: tosca.nodes.WebServer
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>       requirements:
>         - host:
>             node: web_host
>
>     web_host:
>       type: tosca.nodes.Compute
>       interfaces:
>         Standard:
>           create:
>             implementation: test_plugin.test_method
>           delete:
>             implementation: test_plugin.test_method
>
>     database:
> #      type: tosca.nodes.Database
>       type: my.nodes.database
>       properties:
>         name: web_db
>
>
>
> Regards,
> DJ
> -----Original Message-----
> From: D Jayachandran
> Sent: Friday, May 26, 2017 2:30 PM
> To: dev@ariatosca.incubator.apache.org
> Cc: Vaishnavi K.R <vaishnavi.k.r@ericsson.com>; S Shenbaga Rajan <
> s.shenbaga.rajan@ericsson.com>
> Subject: RE: Query related to substitution mapping
>
> Hi Tal,
>
> Please find the attachment for an example of substitution mapping.
> The db.yaml is the substituting template which is imported to web.yaml.
> The web.yaml has an abstract node template "database" which would be
> substituted with db.yaml.
>
> We want to understand is it mandatory to have templates imported for
> substitution to work ? Does TOSCA spec says this ?
> The use-case for us would be to have substitution mapping without
> importing the template but to find the template from the already available
> service-templates in the Database.
>
> You could refer Section 2.10  in TOSCA simple yaml 1.0 for more
> information on substitution mapping.
>
> Regards,
> DJ
>
> -----Original Message-----
> From: Tal Liron [mailto:tal@gigaspaces.com]
> Sent: Thursday, May 25, 2017 10:32 PM
> To: dev@ariatosca.incubator.apache.org
> Subject: Re: Query related to substitution mapping
>
> Hi DJ,
>
> I'm not sure what you mean by "the substituting template". Actually, ARIA
> does almost nothing with substitution templates right now, just parses,
> validates, and stores the info. Indeed, if you refer to a node type there,
> it should be expected that the current template would need to know of that
> type, possibly by importing.
>
> Could you provide a short example to clarify?
>
> On Thu, May 25, 2017 at 5:32 AM, D Jayachandran <
> d.jayachandran@ericsson.com
> > wrote:
>
> > Hi,
> >
> > The substitution mapping works in the latest APACHE ARIA code only if
> > the substituting template is imported in the top-level template.
> >
> > This seems to be contradicting with the TOSCA specification where the
> > substitution is expected to happen without the import (though not
> > explicitly mentioned).
> >
> > We are looking at the possible ways to identify the appropriate node
> > template without importing the substituting template. ( Possibly by
> > going through already available service models for a substitutable
> > entity )
> >
> > Do you have any plans to have substitution mapping work without having
> > the template imported every time ?
> > Do you have any feedback on this and if our understanding is correct ?
> >
> >
> > Regards,
> > DJ
> >
> >
> >
> >
>
>
> --
> Tal Liron
> Senior Engineer
> tal@gigaspaces.com | +1 (773) 828-9339
> Cloudify | http://getcloudify.org
> <http://getcloudify.org?utm_source=signaturesatori&utm_
> medium=email&utm_campaign=general_signature>
>
> <https://twitter.com/CloudifySource>
> <https://www.linkedin.com/groups/8467478>
> <https://github.com/cloudify-cosmo>   <https://github.com/cloudify-cosmo>
> [image: Azure Webinar]
> <http://getcloudify.org/webinars/Azure-plugin-for-
> cloudify-webinar.html?utm_source=signaturesatori&utm_
> medium=email&utm_campaign=general_signature>
>



-- 
Tal Liron
Senior Engineer
tal@gigaspaces.com | +1 (773) 828-9339
Cloudify | http://getcloudify.org
<http://getcloudify.org?utm_source=signaturesatori&utm_medium=email&utm_campaign=general_signature>

<https://twitter.com/CloudifySource>
<https://www.linkedin.com/groups/8467478>
<https://github.com/cloudify-cosmo>   <https://github.com/cloudify-cosmo>
[image: Azure Webinar]
<http://getcloudify.org/webinars/Azure-plugin-for-cloudify-webinar.html?utm_source=signaturesatori&utm_medium=email&utm_campaign=general_signature>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message