tliron / puccini

Cloud topology management and deployment tools based on TOSCA
https://puccini.cloud
Apache License 2.0
88 stars 20 forks source link

adding a quirk to ignore "URL not found:" problems #95

Closed philippemerle closed 2 years ago

philippemerle commented 2 years ago

Given the following template

tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
  node_templates:
    n1:
      type: tosca.nodes.Compute
      artifacts:
        a1: an_artifact

since v0.20.0, puccini signals the following problem

$ puccini-tosca compile issue_URL_not_found.yaml 
PROBLEMS (1)
  file:/.../issue_URL_not_found.yaml
    @7,9 topology_template.node_templates["n1"].artifacts["a1"]: URL not found: an_artifact

The problem is correct as the an_artifact file does not exist.

Moreover, could we have a quirk to not check presence of artifact files? This new quirk should be added to the etsinfv quirk.

tliron commented 2 years ago

This requires some discussion.

The issue here is actually not during parsing. The parser will only check that the artifact file (that's what this short notation sets) matches the artifact type's extensions. So if you use puccini-tosca parse there will be no problem.

The problem is in compiling to Clout. The purpose of Clout is to have something that an orchestrator can immediately use, and so what happens during compilation is that the relative file is turned into a canonical path. But, the truth is that I was never comfortable with this implementation. This path would be calculated on the host in which you are compiling, which of course may not be the orchestrator host. So it could make sense to remove this feature entirely.

But ... we can't really remove it entirely. If we are dealing with a CSAR file, then there must be some way to extract the artifacts from CSAR so that the orchestrator can use them together with the Clout.

In short, the whole artifact management system needs to be rethought for Puccini.

For now, I can recommend two things for you, because I think you're mostly interested in validation:

1) Use puccini-tosca parse instead of compile 2) Could your validation tooling create these files? It's enough for them to be empty. For the above: touch an_artifact.

tliron commented 2 years ago

By the way, you seem to have discovered a different bug here. In your example you did not give the artifact a type. Puccini should mark this as a problem. I will fix this separately.

tliron commented 2 years ago

By the way, you seem to have discovered a different bug here. In your example you did not give the artifact a type. Puccini should mark this as a problem. I will fix this separately.

I fixed this issue in the separate commit. So the test case you presented here must be fixed by adding a type to the artifact.

philippemerle commented 2 years ago

Thank @tliron for the explanation.

  1. Replacing puccini-tosca compile by puccini-tosca parse fully adresses my issue.
  2. Sorry I did not see myself that missing the artifact type is an error :-( My own parser signals this problem ;-)