Closed abitrolly closed 2 years ago
Hi and thanks for asking this. So, as I can see from TOSCA's documentation a lot of examples are not complete and quite some of them use older TOSCA versions (e.g., 1.0).
I think that your example above is missing operations
keyword for TOSCA interface you defined.
You can probably try this:
tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
node_templates:
db_server:
type: tosca.nodes.Compute
interfaces:
Standard:
operations:
configure: scripts/my_own_configure.sh
And also note that xOpera currently supports only Ansible for running interface operations and we have a plan for adding other executors (e.g., bash, python) in the future.
@anzoman are you sure that the example about interface definition can be applied here? Above this example, standard refers to sub-classing behavior, which I believe I am doing.
If this example is invalid, why nobody from consortia is interested in updating the invalid spec?
Perhaps @lauwers can answer the last question.
Hi Anatoli, the TOSCA TC is hard at work on TOSCA v2.0. We realize that some of the examples in the v1.3 specification have errors, but getting corrections approved through the OASIS standardization process is fairly cumbersome and we decided our efforts would be better spent by focusing on the quality of the v2.0 spec. As part of this process, we plan on managing all examples in the TOSCA git repo at https://github.com/oasis-open/tosca-community-contributions so they can be run through various parsers and validators. We have just started this effort. As you can imagine there is a fair bit of work involved and we welcome and encourage anyone to contribute and participate if possible, ideally by joining the TOSCA TC. Thanks, Chris
@lauwers thanks for the proposal. TOSCA TC list holds addresses from major IT company domains. It looks like both OASIS and TC members are all sponsored by one entity or another, and the thought of doing this job sacrificing my time for free feels very miserable. So unless there is some serious funding involved, I have to refuse.
@anzoman this doesn't work.
tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
node_templates:
db_server:
type: tosca.nodes.Compute
interfaces:
Standard:
operations:
configure: scripts/my_own_configure.sh
First is fails with this.
opera.error.ParseError: [Path] Path scripts/my_own_configure.sh does not exist.
[[Command exited with 1]]
And then the file is created, with this.
opera.error.ParseError: [NodeTemplate] Undeclared operations: configure.
[[Command exited with 1]]
Hi Anatoli,
Assuming the file ‘scripts/my_own_configure.sh’ exists, your example shows valid TOSCA.
Chris
From: Anatoli Babenia @.> Sent: Thursday, February 3, 2022 1:00 PM To: xlab-si/xopera-opera @.> Cc: Chris Lauwers @.>; Mention @.> Subject: Re: [xlab-si/xopera-opera] Attach playbook to Compute node without defining a new type (Issue #237)
@anzomanhttps://github.com/anzoman this doesn't work.
tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
node_templates:
db_server:
type: tosca.nodes.Compute
interfaces:
Standard:
operations:
configure: scripts/my_own_configure.sh
First is fails with this.
opera.error.ParseError: [Path] Path scripts/my_own_configure.sh does not exist.
[[Command exited with 1]]
And then the file is created, with this.
opera.error.ParseError: [NodeTemplate] Undeclared operations: configure.
[[Command exited with 1]]
— Reply to this email directly, view it on GitHubhttps://github.com/xlab-si/xopera-opera/issues/237#issuecomment-1029396244, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AASPLILRIDLU3ZV7IHE5QULUZLUFHANCNFSM5MV4HUUQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.**@.>>
Thanks. So it is a bug in xOpera then.
Hi @abitrolly, I believe that you're looking at section 2.3 Overriding behavior of predefined node types and AFAIK you get the error because your db_server
derives from tosca.nodes.Compute
node type, which does not have any predefined interfaces that you could override and use them to run some operation.
The TOSCA Compute node represents one or more real or virtual processors of software applications or services along with other essential local resources. Collectively, the resources the compute node represents can logically be viewed as a (real or virtual) “server”.
If you want to run your scripts/my_own_configure.sh
script you should probably derive from some other TOSCA type (e.g., tosca.nodes.Root
, tosca.nodes.SoftwareComponent
or create your DB server node such as tosca.nodes.DBMS.MySQL
).
tosca.nodes.Compute
derives from tosca.nodes.Root
https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/csprd01/TOSCA-Simple-Profile-YAML-v1.3-csprd01.html#DEFN_TYPE_NODES_ROOT which includes tosca.interfaces.node.lifecycle.Standard
.
Anatoli is correct.
From: Anatoli Babenia @.> Sent: Wednesday, February 9, 2022 12:39 AM To: xlab-si/xopera-opera @.> Cc: Chris Lauwers @.>; Mention @.> Subject: Re: [xlab-si/xopera-opera] Attach playbook to Compute node without defining a new type (Issue #237)
tosca.nodes.Compute derives from tosca.nodes.Root https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/csprd01/TOSCA-Simple-Profile-YAML-v1.3-csprd01.html#DEFN_TYPE_NODES_ROOT`https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/csprd01/TOSCA-Simple-Profile-YAML-v1.3-csprd01.html#DEFN_TYPE_NODES_ROOT%60 which includes tosca.interfaces.node.lifecycle.Standard.
— Reply to this email directly, view it on GitHubhttps://github.com/xlab-si/xopera-opera/issues/237#issuecomment-1033494126, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AASPLIJ5NT4LEDMUAN6VX2TU2IRZPANCNFSM5MV4HUUQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.**@.>>
Oh, after some testing I see now that opera has a minor bug for this. I have located it already and will supply the PR that will fix this ASAP.
Is it possible to execute playbook when
tosca.nodes.Compute
node template is deployed, without defining a new type?Using modified example from https://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.3/os/TOSCA-Simple-Profile-YAML-v1.3-os.html#_Toc26969423
opera validate
errors out with this.