In contrary to most of the TOSCA entities, TOSCA does not differentiate between 'definition' and 'assignment' in the context of operations. There are only "operation definitions" [3.5.13]. Logically, there is a partial differentiation [3.5.13.1], where inputs in node type operations are expected to be property definitions, and inputs in node template operation are expected to be property assignments (which are actual value assignments). Both of these options are listed under "operation definition".
Under [3.5.13.3] it is explicitly stated that "Template authors MAY provide property *assignments* on operation inputs on *templates* that do not necessarily have a property definition defined in its corresponding type." (my emphasis) That is, from this paragraph, I think that it is clear that you can define operation inputs in node templates (level #3) without them being defined in the node template's type. In fact, [2.14.2] is an example of doing just that. And out parser treats such a syntax as valid, see: https://github.com/apache/incubator-ariatosca/blob/master/tests/parser/test_tosca_simple_v1_0/test_end2end.py#L73 Me thinking it was a good idea to construct TOSCA that way is another thing =) On Mon, Sep 11, 2017 at 6:35 PM, Tal Liron <t...@cloudify.co> wrote: > Feel free to change the wiki, Ran, to whatever name you find appropriate. > > I think what Avia discovered is not new to us and actually doesn't solve > the problem, unfortunately. Let me go over what is clearly allowed and not > allowed in TOSCA, confusing because there are a few levels of inheritance > here. > > 1. Interface types. Obviously, you are allowed to inherit an interface type > and add or override inputs. (ARIA insists that overridden input types be > derived from what it is they are overriding, too, to keep the OO contract > intact.) > > 2. Node types. In the "interfaces" section you can define several > interfaces of various types. Here, again, TOSCA lets you add/override > inputs. Though note here that the line of inheritance is quite complex: you > can override inputs from the interface type, but *also* from the parent > node type. (ARIA here has to do some work to make sure that you are doing > it all OK and not breaking the OO contract, it's a rather complex part of > the parser code.) > > I think the above is what Avia discovered. However, the third level is > locked to us: > > 3. Node templates. Unfortunately, here we can not add inputs ad hoc. The > "interfaces" section here is not the same DSL format as those above: it is > operation *assignments* rather than operation *definitions*. When you > assign input values here, they are validated against the defined types. It > would make no sense in TOSCA to just assign values without a type. > > So, because we can't add inputs at level #3, we still have a problem: we > would have to derive new node types for every type of execution. SSH would > require its own node types, Juju would require its own node types, Puppet > would require its own node types, etc. And that's for *all* your node > types. This seems extremely un-scalable. > > But also, as I try to explain in the wiki page, I insist that these kinds > of configuration parameters are essentially not the same as operation > inputs. They are not meant to be used by the operation itself (script, > charm, recipe, etc.), rather by the mechanism that executes the operation > (SSH, Juju, Puppet, etc.). Especially I point out the security hole: you > don't want an SSH password exposed and sent over the wire to the script > itself. It is simply not an input. > > By the way, it seems that there's some acknowledgement by other folk in > OASIS about this gap in TOSCA, and there's an interest to use artifact > types in TOSCA 1.2 as a way to solve this problem. I don't think it's a bit > awkward, but at least there will be a standard solution. > > > On Sun, Sep 10, 2017 at 2:13 AM, Ran Ziv <r...@cloudify.co> wrote: > > > Avia's mentioned at one point that we might have misunderstood the spec > at > > this section, and that in fact it can be possible to pass arbitrary > inputs > > into operations regardless of the interface definition - which would mean > > this notion of "configuration" might be unnecessary. > > > > Also, note that the doc page is talking about "executors", which is > > confusing as that's a different concept in ARIA (see the base executor > > class); Supposedly up until now we've simply called these "operation > > plugins". > > > > > > On Sat, Sep 9, 2017 at 1:43 AM, Tal Liron <t...@cloudify.co> wrote: > > > > > Yes: > > > https://cwiki.apache.org/confluence/display/ARIATOSCA/ > > > Execution+Configuration > > > > > > On Fri, Sep 8, 2017 at 4:45 PM, DeWayne Filppi <dewa...@cloudify.co> > > > wrote: > > > > > > > I see in the examples a list of dependencies for scripts in > operations, > > > for > > > > example: > > > > > > > > implementation: > > > > primary: scripts/configure.sh > > > > dependencies: > > > > - "ssh.user > { get_input: ssh_username }" > > > > - "ssh.key_filename > { get_input: private_key_path > }" > > > > - "ssh.address > { get_attribute: [ virtual_ip, > > > > floating_ip_address ] }" > > > > > > > > The spec seems to indicate that the dependency list is for resources > > that > > > > need to be made available so the main script can be run. Clearly > that > > > > isn't the case in the example. Is this '>' syntax documented > anywhere? > > > > > > > > > >