Skip to content

Workflows for Dependent Resource - Umbrella Issue #1097

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

Closed
6 tasks done
csviri opened this issue Mar 28, 2022 · 5 comments
Closed
6 tasks done

Workflows for Dependent Resource - Umbrella Issue #1097

csviri opened this issue Mar 28, 2022 · 5 comments

Comments

@csviri
Copy link
Collaborator

csviri commented Mar 28, 2022

DependentResource serves as a building block of workflows of reconciling resources. Currently the managed dependent resources provides a limited way of expressing workflows - it's a list of resources what gets reconciled in defined order. Using standalone dependent resource in a reconciliation gives developers possibilities to use any java language constructs to describe arbitrary workflows (Think only conditionally create resource based in input resource values, or wait with API calls on a service until the deployment is not ready and things like that).

TODO:

@csviri
Copy link
Collaborator Author

csviri commented Apr 1, 2022

to discuss: workflows should handle explicit delete if a condition not hold ?

This is actually a case to differentiate cleaner and deleter for the dependent resources, since it might make sense to explicitly delete a resource like for Kubernetes but not handle the cleanup explicitly. However this might be a special case, since only k8s handles gabrbage collection no other external resources.

cc @metacosm

@csviri
Copy link
Collaborator Author

csviri commented Apr 3, 2022

Regarding workflows, I think this issue should fully cover it: #850

Will be simple enough, can be nicely describe by annotation,
will be familiar for people working with Terraform or Cloudformation.

@csviri
Copy link
Collaborator Author

csviri commented Apr 3, 2022

Added the topic of error handling, there was a discussion if in dependent resources reconciliation (reconcile(...) method call) should throw Exception or in the resource there should be and Error status in the result enum. Probably this part deserves it's own issue (will create one).

@csviri csviri changed the title Designing for describing workflows for Dependent Resource Workflows for Dependent Resource - Umbrella Issue May 19, 2022
@cmoulliard
Copy link

That should be great to have part of the description an example. If the idea is to express like a from-to-to route, the flow of the dependent resources to be processed and their order, then adopting a DSL language could be a better idea than using Java annotations

Example: https://camel.apache.org/manual/java-dsl.html

WDYT ?@csviri

@csviri
Copy link
Collaborator Author

csviri commented May 30, 2022

That should be great to have part of the description an example. If the idea is to express like a from-to-to route, the flow of the dependent resources to be processed and their order, then adopting a DSL language could be a better idea than using Java annotations

Example: https://camel.apache.org/manual/java-dsl.html

WDYT ?@csviri

yes, that is a very good point, luckily we have actually both, see here in tests:
https://github.com/java-operator-sdk/java-operator-sdk/blob/4762be50af11fc0d085a3da635201b0074ea568f/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowReconcileExecutorTest.java#L244-L252

or in a sample:
https://github.com/java-operator-sdk/java-operator-sdk/blob/4762be50af11fc0d085a3da635201b0074ea568f/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageDependentsWorkflowReconciler.java#L46-L51

(it's actually a builder both in this context those are very similar concepts)

so the annotation is just a wrapper on an inner java dsl / builder. In other words in the backround the annoations will be transformed to the target model using this DSL. But both can be used at the end in an operator.

@metacosm metacosm added this to the 3.1 milestone May 31, 2022
@csviri csviri closed this as completed Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants