Navigation Menu

Skip to content
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

DAG Workflow with Workflow resource #18827

Merged
merged 3 commits into from Jan 31, 2016

Conversation

sdminonne
Copy link
Contributor

@erictune, @soltysh As discussed here. Here it is the workflow proposal with the Workflow resource. It should improve composability and scheduling. It's heavily based on @derekwaynecarr Initializers #17305 (for dependency resource).
@bgrant0607, @mikedanese
@EricMountain-1A, @pmorie if you've some bandwidth

@k8s-github-robot
Copy link

Labelling this PR as size/L

@k8s-github-robot k8s-github-robot added kind/design Categorizes issue or PR as related to design. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 17, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 17, 2015

GCE e2e test build/test passed for commit b6921209df7d370cc4102f3568fd2eb0d79bdd05.

@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

@erictune
Copy link
Member

Note to myself: when I review this I need to first review the comments on #17787

@erictune
Copy link
Member

The ExistenceDependencies of #17305 would check that an object exists. But for a workflow, you need to check that it has also reach a certain state, such as a job being complete.

// If this value is nil, the default grace period will be used instead.
// Set this value longer than the expected cleanup time for your workflow.
// If downstream resources (job, pod, etc.) define their TerminationGracePeriodSeconds
// the biggest is taken.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "the biggest is taken" mean? Are you saying this value is defaulted from the max value of TerminationGracePeriodSeconds of all contained objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About ExistenceDependencies (more generally about ObjectDependencies). Sure #17305 is about existence but the specific behavior is going to be customized via the controller ControllerRef (if I'm not wrong).

I would simply modify field name in ObjectDependencies

type ObjectDependencies {
   ...
   DependenciesRef []ObjectReference `json:"dependenciesRef,omitempty"` // modified
   ControllerRef *ObjectReference `json:"controllerRef,omitempty"`
   ...
}

and the ControllerRef is going to be assigned to a controller that check termination of the resources in Dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About "the biggest is taken", yes, I'm going to rephrase it.

@sdminonne
Copy link
Contributor Author

@erictune thanks for the review, I'm waiting for other feedbacks (if any) and then I'll modify this according to your comments.

@soltysh
Copy link
Contributor

soltysh commented Dec 21, 2015

I did quick review, I'm planning to go through it once again later today. Sorry @sdminonne it's taking this long, my hands are pretty full already :/

@sdminonne
Copy link
Contributor Author

@soltysh no problem :) thanks for the review.

* As a user I want to be able to define a workflow.
* As a user I want to compose workflows.
* As a user I want to delete a workflow (eventually cascading to running _tasks_).
* As a user I want to debug a workflow (ability to track failure).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about more concrete examples such as: I want to create a Job B that should depend on Job A, etc. instead of giving these high level ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@soltysh
Copy link
Contributor

soltysh commented Dec 21, 2015

One more question, how one checks current state of a workflow, iow. which deps have been met already and which not?

@soltysh
Copy link
Contributor

soltysh commented Jan 13, 2016

I'm missing in the proposal what happens when modification of a Workflow happens after it started, we've had a discussion on the topic on IRC. It would be beneficial for the proposal.

@soltysh
Copy link
Contributor

soltysh commented Jan 13, 2016

Are you planning to extend kubectl in any way to simplify workflow management - if so please put it in the proposal as well. If none - state it as well.

@erictune
Copy link
Member

I assume you plan to implement a Workflow Controller in e.g. pkg/controller/workflow. But I don't see the word controller anywhere in the doc. If you intend there to be a controller, I suggest you have a section about it, including some pseudo-code explaining what the controller does. If you don't intend such a controller, then please say so.

At the time of writing, to defer execution there are two discussions in the community:
[#17305](https://github.com/kubernetes/kubernetes/pull/17305): an
_initializer_ is a dynamically registered object which permits to select a custom controller
to be applied to a resource. The controller verifies the dependencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot tell if you are just pointing out the similarity to #17305 or if you are saying that Workflow will be implemented entirely via #17305, or that it will partly use #17305.

The WorkflowSpec has a nested JobSpec. Creating a nested object is not the same as creating a bare object. I don't see anything in #17305 about handling nested objects. Therefore, at a minimum, I think that there would need to be a Workflow Controller that extracts the nested objects and creates them as top-level objects. You could either have the Workflow Controller create them all immediately, and then use #17305 to sequence their start. Or you could just use the Workflow Controller to create each nested object (step) only when it is ready. I had assumed that you would do the latter, but rereading this section I'm not not sure what you intend to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erictune: I'm going to supply will contain the description of the controller. The controller won't use #17305 (even if mechanism could be similar, I argue), at the beginning I thought I could re-use the same mechanism or at least share some code. Unluckily I won't be able to work on both and apparently #17305 is taking longer. I'll remove any reference to #17305.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Sounds good. Happy to revisit it when #17305 is done.

@sdminonne
Copy link
Contributor Author

@erictune @soltysh thanks for the reviews and sorry for the silence on this.
I've worked on your feedback and in the next hours I'll supply a new version of the proposal.

@sdminonne
Copy link
Contributor Author

@soltysh

  1. About Workflow update and discussion we had on IRC: I'm going to add to the proposal.
  2. About the modification for kubectl: I'll modify kubectl to include usual CRUD plus describe command: but the modification is going to be quite basic due to the limiation of an ASCII interface. Obviously workflow tools tends to have fancy UI (to represent the graph) but this will be out of the proposal (I'll clarify this point).

@sdminonne
Copy link
Contributor Author

@erictune @soltysh I'm posting a new version. Several modifications:

  1. Postponing execution paragraph is removed. In the Controller paragraph I describe how the detection of a Job or of a Workflow is detected. Reference to WIP: Initializers proposal #17305 has been removed.
  2. Detecting run to completion paragraph is removed but more details are given discussing API and controller
  3. Controller section is added.
  4. Added some info Workflow updating
  5. kubectl section is added
  6. Code formatting removed

@k8s-bot
Copy link

k8s-bot commented Jan 29, 2016

GCE e2e test build/test passed for commit e8cf1dc.

@k8s-bot
Copy link

k8s-bot commented Jan 30, 2016

GCE e2e test build/test passed for commit e8cf1dc.

@erictune
Copy link
Member

lgtm. minor comments that you can address later.

@erictune erictune added lgtm "Looks good to me", indicates that a PR is ready to be merged. e2e-not-required and removed needs-ok-to-merge labels Jan 31, 2016
@k8s-github-robot
Copy link

Automatic merge from submit-queue

k8s-github-robot pushed a commit that referenced this pull request Jan 31, 2016
@k8s-github-robot k8s-github-robot merged commit a81fa2f into kubernetes:master Jan 31, 2016
@sdminonne
Copy link
Contributor Author

@erictune thanks!

@sdminonne sdminonne deleted the workflow_resource branch February 1, 2016 12:08
@sdminonne sdminonne restored the workflow_resource branch February 1, 2016 12:40
@ravilr
Copy link
Contributor

ravilr commented Oct 16, 2016

@sdminonne @erictune @soltysh the proposal in this merged PR isn't found in the repo now. Is the thinking that this could be implemented outside of the core api using ThirdPartyResources? Thanks.

@sdminonne
Copy link
Contributor Author

@ravilr right. I'm implementing the controller using ThirdPartyResources as an external controller.

xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants