Hi Chris,
Responses inline below...
thanks,
Adam
On Tue, Feb 18, 2020 at 3:40 PM Chris Lauwers <
lauwers@ubicity.com> wrote:
> Hi Adam
>
>
>
> Thanks again for the very helpful feedback. Some comments inline.
>
>
>
> Here are some comments and questions that came up as I was implementing
> the specification, I hope you find them useful:
>
>
>
> # Normative questions and comments:
>
>
>
> * Unless I missed something, it appears that tosca identifiers (e.g.
> template names, property names etc.) are only defined as YAML strings. I
> assume this is under-specified? Given TOSCA's XML heritage and that
> namespace prefixes are still used, should they be constrained to XML's
> NCName production (XML names without colons)?
>
> I believe that in most (if not all) cases, the context makes it clear
> where the names are valid. For example, template names are only valid
> within the context of a single topology template (and by implication a
> single service template). Property names are only valid within a specific
> type definition, etc. The only place where namespace prefixes are supported
> (and useful) is for the type definitions themselves, since type definitions
> can be imported from other templates, which means that name collisions are
> possible. Do you have examples where the current naming scheme can create
> problems?
>
>
>
I was referring to the syntax of TOSCA names and identifiers in general --
unless I'm missing something, it appears that a name can be any valid YAML
string, including ones containing whitespace, line feeds, non-normalized
Unicode sequences, etc. This makes it harder to build interoperable and
secure implementations (think SQL injection attacks). For
compatibility with XML you might want to consider constraining as I suggest
above. Or maybe they should limited to be more like identifiers in a
programming language or to the syntax of DNS hostnames, as Kubernetes does.
On the other hand, maybe it would be useful to allow a more liberal syntax
so that any valid URI could be used as an identifier.
* The lists of node states in section 3.4.1 (p74) doesn't include
> "available" but it is used elsewhere in the spec. For example in the
> diagram on p.226. (That diagram also show the "delete" operation moving the
> node state from "configured" to "configured" -- I assume that is an error
> and it should be "stopped" and "deleted" respectively?). The example in
> section 7.3.3.1 (p260) also references an "available" state.
>
> Yes, good catch. Clearly the text got out of sync with the diagrams. This
> needs to be corrected.
>
> That said, this observation points to an issue we’ve been working on in
> Version 2.0: the list of valid node states is defined as part of “TOSCA the
> language”, but the specific states are modeled after the “Standard”
> lifecycle management interface, which is part of “the TOSCA type system”
> (i.e. the Simple Profile types). There are a number of instances in the
> specification where assumptions about the Simple Profile types bleed over
> into the language itself. This makes it difficult to use TOSCA (the
> language) without also using the Simple Profile types. We’re trying to
> remove such “bleed-over” and create a cleaner separation between the
> language and the types. This could mean that the “state” concept might need
> to be removed from the language, and instead be moved to an attribute of an
> Interface, for example (which would be defined in the type system, not in
> the language).
>
>
>
> * metadata is allowed on property and attribute definitions but not on
> parameters (inputs and outputs) or on artifacts. Is this inconsistency an
> oversite? I have found it necessary to add metadata to input and artifact
> definitions.
>
> Yes, metadata should be allowed pretty much everywhere (except possibly in
> property and attribute assignments). We’ll try to eliminate such
> inconsistencies.
>
>
>
> * requirement assignments can specify the capability and relationship
> types but capability assignments can not. Is this an oversite? I found
> declaring the type in capability assignment necessary, for example, to
> specify that the "endpoint" capability of a node template is a subtype of
> the generic "endpoint" capability.
>
> Would you mind sharing a specific example? If I understand correctly, what
> you’re trying to do sounds like an “on-the-fly” creation of a node sub-type
> within a topology template. I’d like to understand your use case better
> before commenting on this.
>
>
Sure... consider:
capability_types:
mytypes.capabilities.Endpoint.SSH:
derived_from: tosca.capabilities.Endpoint.Admin
description: Capability to connect to the host via SSH
properties:
protocol:
type: string
value: ssh
port:
type: tosca:PortDef
default: 22
node_templates:
myServer:
type: tosca.nodes.Compute
capabilities:
endpoint: # declared in tosca.nodes.Compute as
a tosca.capabilities.Endpoint.Admin
type: mytypes.capabilities.Endpoint.SSH
If I can't declare the capabiliy's type in the capability assignment, I'd
be forced to declare a subtype of tosca.nodes.Compute that overrides
tosca.nodes.Compute's "endpoint" and have the template use this new
subtype. This is particularly cumbersome because TOSCA doesn't support
multiple inheritance or mixins, so this could lead to a combinatorial
explosion of subtypes. More abstractly, TOSCA has a nominal type system and
"requirements" and "capabilities" are essentially references to other nodes
-- and I can't think of a practical example of a nominal type system that
doesn't allow covariant object references like ths.
>
>
> * I have had to make other extensions to spec, some of which you may want
> to consider for a future version of TOSCA -- the list of changes are
> documented here:
https://www.onecommons.org/unfurl/tosca.html>
> Thanks, very helpful. By the way, I’d like to repeat my invitation for you
> to join the TOSCA TC so we can discuss these during our regular meetings.
>
Thank you, I plan to.
>
>
> # Editorial comments:
>
>
>
> * The discussion in 13.4.1 Shell Scripts (p.360) about
> implementation outputs is confusing because it seems to imply that
> exporting an environment variable in shell script makes it available to the
> parent process when in fact doesn't (instead it makes it available to child
> processes). To implement something like this the orchestrator would have to
> wrap or rewrite the shell script (that's what Yorc does) or place other
> requirements on the script -- for example, Cloudinary requires shell
> scripts to call a helper child process to pass outputs back to the
> orchestrator.
>
> Yes, this is actually more than an “editorial” error. What’s currently
> described won’t work