-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically-generated (declarative) workflows for arbitrary interface types #91
Comments
In order to automatically create workflows, we need to define:
The syntax for interleaving can get fairly convoluted. The following code snippet is a possible example of such syntax:
|
The example above shows code that is not very reusable. TOSCA v1.3 addresses this by advertising the
This gets us most of the way there, since it defines how interface operations on relationships depend on the state of the |
Perhaps we need to add a |
At our last language group meeting I was asked to write a proposal or outline for "declarative workflows". Firstly, I need to mention that HPE has a patent on this, and so a lot of the information that you ask for is in the patent text: USPTO US-20190312794-A1 The link is not very stable - it helps if you refresh the browser after opening. Alternatively use patents.justia While an event-based model of course can do everything, my main objection is that this is even less abstract than a classical workflow engine like those for BPEL. "More abstract" means "more freedom for the orchestrator to decide how to do the workflow".
It may look very generic, but by writing the event model for all the state transitions on interface states like in #153 and #147 effectively, we are making the TOSCA template designer code a workflow engine from scratch. This is extremely complex work, something, I believe should be left to the orchestrator implementation, particularly when you factor in error handling. The way TOSCA is structured, you can think of node/relationship-level and interface-level workflows, and obviously, the two levels need to fit together, which is not trivial if a node has multiple interfaces. For "declarative workflows" we should focus on the lifecycle interface, connecting the lifecycles of nodes to other nodes through relationships. A typical interface has the following "state-components":
Notice, that Considering day 2 and teardown cases, tearing down should somehow follow the "opposite" dependencies of setup. This is all very complicated to handle correctly, and that was just one interface, now consider the above in conjunction with multiple other nodes and relationships impacting the state-transitions and potential modifications of the My point above was, that TOSCA template designers really shouldn't be given the task of coding that logic, including error-handling, state-transition-directions, etc. from scratch using an event-model. It is clearly doable, but just so hard to get right, that it is not helpful. Remember, our TOSCA Charter - it says, we want to make the life of the TOSCA Template Designers easy. So my approach in the HPE product is as follows:
Getting cyclic dependencies is quite "easy", so the more degrees of freedom the orchestrator has for sequencing things, the better. With the above way of doing things:
Now all this being patented, means that TOSCA cannot really adopt it, I suppose. This is one of the reasons I have been holding back a bit. Also, of course this way is not entirely aligned with the TOSCA philosophy - that is another reason. I have discussed with our HPE Legal team on allowing some of this to be released into OpenSource or perhaps at a nominal license fee, but that has not been successful. So for now, HPE holds and retains all rights to this and other patents, including the one on automatic creation of what TOSCA would call "dangling requirements". |
Yes, getting the state machine right is complicated, and we shouldn't burden template designers with this task. On the other hand, if our goal is to make TOSCA domain-independent, then we also can't really hard-code a state machine into the orchestrator. Luckily, we have a third option: we can define the state machine in domain-specific profiles. While this doesn't eliminate the complexity, it only needs to be done once for each application domain. Template designers will just pick up whatever state machine was defined in the profile they use. |
I agree that it makes sense to delegate the state machine to a profile. A principle, I have discovered over the years is: "Freedom is not always good". Sometimes, unnecessary freedom - like many different ways of doing the same thing - just adds confusion and detracts from usability. What is problematic is that each node can have a different state machine for its lifecycle interface, even in profiles. I have tried this in practice, and unless all lifecycle interfaces have the same state model within a single TOSCA template. Things get extremely difficult to handle consistently when you want to automatically (declarative) generate a workflow that spans nodes with different lifecycle models. A lifecycle state model has a setup-direction and a teardown-direction. Some state models have only two states (active/deleted), but usually we have more. Of course the state machine may decide to have different transitions for setup and teardown. It only complicates the work of assigning functionality (scripts etc.) to the state transitions, because the template designer cannot rely on teardown being the reverse of setup. For day 2 scenarios reversibility of state transitions is critical. A solution would be to insist that:
Some templates, like those that work in a fully cloud-native environment on top of lower-level declarative orchestrators like Kubernetes may only need n to be 1. Other templates, like those working in a TMF context or with bare-metal provisioning may need additional states. Another aspect is error-states. These are clearly orthogonal to the lifecycle states, because any state transition that invokes some script or action may fail. An error state consists of the pair of state-numbers that corresponds to the failed state transition - the representation of that is of course up to the orchestrator. Such a representation leaves up to orchestrators, profiles and template designers to define policies for retrying or reverting the transaction. But as a fundamental model, I don't see that there are other ways of dealing with errors if you want declarative workflows as a general possibility of TOSCA and not only as a possibility for some profiles. |
I like the idea of enforcing linear state machines, but that might be difficult to enforce in a parser/validator, especially since an interface might have multiple state variables (e.g., one for the actual state and a second one for an error condition). |
No description provided.
The text was updated successfully, but these errors were encountered: