Repository navigation
About actual portability of the core type profile #365
Replies: 4 comments 3 replies
|
I add another bit. I did not try any of the options above, so I'm not completely sure that they actually work |
|
Thanks Roberto, this is the right problem to raise before the An implementation is optional, and its absence has a defined meaning.
So a profile that declares signatures and no implementations is not an incomplete profile. It says what the community means: here is the contract, every processor provides the function. Two profiles may not define the same function name.
An import under a namespace makes the call A function definition may carry several signatures, tested in order, where "the first matching implementation is used" — but matching is on the arguments, not on what the processor can execute. What that means for the three options
What I would propose for the
|
|
I would like to revisit this discussion in light of the related exchange in Discussion #384, because I think the problem can now be stated more precisely and, perhaps more importantly, addressed at two different levels: what we can practically do today with TOSCA 2.0, and what could eventually be improved in a future version of the language. I believe there is useful common ground around the following principle:
@tliron used an analogy that I find particularly useful: TOSCA can play the role of a C This is essentially the problem I originally wanted to address in this discussion. Consider the current community core profile, which defines generally useful functions such as
Conceptually: For example, the Puccini/Floria variant could provide the relevant functionality through WASM plugins, while another processor could use Python artifacts, native/built-in functionality, or a completely different mechanism. With the current TOSCA 2.0 grammar, I don't see a clean way for a second profile to take the definitions from the portable core profile and simply add or replace their implementations at profile level. Therefore, leaving possible future language improvements aside for a moment, a pragmatic solution available today might simply be to split what is currently represented by a single core profile into separate profile files: one explicitly portable profile containing only the common definitions, and separate processor-specific variants containing the corresponding implementations. This is admittedly less elegant than having a language mechanism to associate alternative implementations with a shared definition. It may also introduce some duplication between the portable and processor-specific variants. However, it has the advantage of requiring no change to TOSCA 2.0 while making the portability boundary explicit. It would also fit naturally with a possible reorganization of the community repository, where users could clearly distinguish portable profiles from profiles or implementations targeting a specific processor. So, for the current standard, the practical question I would like to discuss is: Would splitting the current core profile into a portable definition-only profile and separate processor-specific variants be a reasonable way to maximize portability without imposing any artifact execution model on TOSCA processors? Separately, and as a potential future improvement to TOSCA, I still think it would be useful to explore whether the language should eventually provide a cleaner mechanism for defining a contract in one profile and associating alternative implementations with it in other profiles. But I would keep that as a separate, longer-term language-design question. For now, I am primarily interested in finding the cleanest solution that works with TOSCA 2.0 as it exists today. |
Uh oh!
There was an error while loading. Please reload this page.
I want to share an issue I'm currently facing concerning the core profile currently defined in the community repository.
As known, this profile defines general-purpose TOSCA types that are intended to be shared by all other profiles, at all levels of abstractions. The current version provides several type definitions that are inherently portable among different orchestrators (e.g. data types). On the other hand, some other definitions depends on the characteristics of the orchestrator. This is especially true for custom functions (and more generally for artifact types, which are tightly related to artifact processors implemented by orchestrators).
Concerning specifically functions, here is an excerpt from the current core profile:
This definition works for sure on Ubicity orchestrator, which includes a python artifact processor able to serve the purpose. On puccini, the profile is properly compiled (because it is syntactically correct), but the function cannot be used at run time, because the suite on which puccini is based natively supports a different mechanism for implementing custom functions (i.e. wasm plugins). This makes this profile not completely portable among different platforms.
One possible approach to cope with this problem could be to split the profile definition into a set of "portable" definitions and "orchestrator-dependent" definitions.
The
portable-core-types.yamlwould be something like:while the rest of the definitions, which depend strictly on the orchestrator and on the type of artifacts it is able to support, should be defined in dedicated files. For example, for Ubicity
ubicity-specific-types.yamlwould appear as follows:On the other hand,
khutulun-specific-types.yamlmay be characterized by different implementations:Another option, slightly different, consists in removing at all implementations from community profiles. The core profile should be as it appears today, but without implementations in the function signatures. Since the standard allows function definition refinement in the service templates (sec. 10.4 of the TOSCA 2.0 specification), a set of specific profiles detailing all orchestrator dependent implementations should be provided by each orchestrator platform at each release of community profiles.
For example, when the community releases TOSCA
community.tosca.*:x.y.zprofiles, each orchestrator platform in turn releases one or more associated profiles that refine community types by adding proper implementations (e.g.com.ubicity.implementation:x.y.zorcloud.puccini.implementation:x.y.z, arbitrary names just to explain the concept). A service template would appear as follows:The 2 alternatives above are feasible with the current standard. Another option, that I write here just as a suggestion, may consist in adding support for "conditional" compilation, as in several programming languages. For example in C/C++ you can write:
and the actual code that is compiled depends on the macros. Following this concept, we may imagine to extend the language so that a TOSCA parser/compiler includes/excludes part of the TOSCA file depending on some specific comments in it. According to this approach, the profile may appear as follows:
I don't know if other approaches are possible, so far I do not have further ideas. Any comment/opinion on that?
All reactions