xlab-si / xopera-opera

xOpera orchestrator compliant with TOSCA YAML v1.3 in the making
https://xlab-si.github.io/xopera-docs/
Apache License 2.0
35 stars 14 forks source link

Deployment of extracted CSAR fails with `Type is missing derived_from key` #79

Closed duelle closed 3 years ago

duelle commented 4 years ago

Version: opera 0.5.8

When trying to deploy the CSAR sut.zip after extraction (opera deploy _definitions/radonblueprints__SockShopTestingExample.tosca), it fails with

% opera deploy _definitions/radonblueprints__SockShopTestingExample.tosca 
_definitions/radonpoliciestesting__Test.tosca:5:5: [PolicyType] Type is missing derived_from key.

We did not alter the Test policy type, so that's the way it was exported.

anzoman commented 4 years ago

Hi @duelle,

the error occurs because opera expects (and demands) that you use derived_from keyname within your entity defintions (e.g., Node Type, Relationship Type, Artifact Type, Policy Type definitions etc.). So I think that your problem could be solved if you add the line derived_from: tosca.policies.Root to the Policy Type defintion in _definitions/radonpoliciestesting__Test.tosca.

duelle commented 4 years ago

Thanks for the immediate reply. As we didn't write this by hand but exported it from GMT, is this an issue in GMT that this isn't (or wasn't) included in the export to CSAR? Do you happen to know whether this is included in the latest version of GMT?

anzoman commented 4 years ago

Yes this may be an issue. I remember that all the nodes and relationships within the CSARs that were exported from the GMT had derived_from keyname included in their definitions. I'm not sure whether this problem is concerning TOSCA policies only but it seems so. On the other hand, looking into TOSCA standard derived_from keyname (which is an optional parent Entity Type name the Entity Type derives from) is not marked as required - @matejart - do you know something about this? Should we refactor this part of opera so that derived_from will not be required and when user would not set it the policy/node/relationship would just derive from the root TOSCA type definition?

anzoman commented 3 years ago

@duelle is this issue still relevant and present?

anzoman commented 3 years ago

I believe that this was resolved and can be now closed.