{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/46035316","id":46035316,"diff_hunk":"@@ -0,0 +1,134 @@\n+<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->\n+\n+<!-- BEGIN STRIP_FOR_RELEASE -->\n+\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+\n+<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>\n+\n+If you are using a released version of Kubernetes, you should\n+refer to the docs that go with that version.\n+\n+<strong>\n+The latest release of this document can be found\n+[here](http://releases.k8s.io/release-1.1/docs/proposals/workflow.md).\n+\n+Documentation for other releases can be found at\n+[releases.k8s.io](http://releases.k8s.io).\n+</strong>\n+--\n+\n+<!-- END STRIP_FOR_RELEASE -->\n+\n+<!-- END MUNGE: UNVERSIONED_WARNING -->\n+\n+## Abstract\n+\n+A proposal to modify [`Job` resource](../../docs/user-guide/jobs.md) to implement a minimal [Workflow managment system](https://en.wikipedia.org/wiki/Workflow_management_system) in kubernetes.\n+Workflows (aka DAG workflows since jobs are organized in a Direct Acyclic Graph) are ubiquitous in modern [job schedulers](https://en.wikipedia.org/wiki/Job_scheduler), see for example:\n+    - [luigi](https://github.com/spotify/luigi)\n+    - [ozie](http://oozie.apache.org/)\n+    - [azkaban](https://azkaban.github.io/)\n+\n+Most of the [job schedulers](https://en.wikipedia.org/wiki/List_of_job_scheduler_software) offer workflow functionality to some extent.\n+\n+## Use Cases\n+\n+    * As a user I want to be able to define job chains such that the completion of a given job will trigger other jobs.\n+\n+## Implementation\n+\n+The basic idea consists in adding a label selector to the current Job API object. The new selector will determine the parent jobs.  The parent jobs are the jobs current job will depend on. The current job will be scheduled once all the parent jobs will run to completion.\n+The strongest point in favor of this approach is the ability to re-use the current `job` implementation. Using a label selector the current `job` will simply become a `graph` of jobs: all the features/controllers that will be built on top of `job` like for example [#11980](https://github.com/kubernetes/kubernetes/issues/11980) and [#17242](https://github.com/kubernetes/kubernetes/issues/17242) will be automatically extended to support workflows. Not sure about https://github.com/kubernetes/kubernetes/issues/16845 and https://github.com/kubernetes/kubernetes/issues/14188.\n+A similar approach is implemented in Chronos for [dependent jobs](https://mesos.github.io/chronos/docs/api.html#adding-a-dependent-job).\n+\n+### API Object\n+\n+To implement _workflows_ the `Job` API should be modified:\n+\n+```go\n+// JobsSelector it's just an alias for PodSelector\n+type JobSelector PodSelector\n+\n+// Job represents the configuration of a single job.\n+type Job struct {\n+    unversioned.TypeMeta `json:\",inline\"`\n+    // Standard object's metadata.\n+\n+    // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata\n+    api.ObjectMeta `json:\"metadata,omitempty\"`\n+\n+    // Spec is a structure defining the expected behavior of a job.\n+    // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status\n+    Spec JobSpec `json:\"spec,omitempty\"`\n+\n+    // Status is a structure describing current status of a job.\n+    // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status\n+    Status JobStatus `json:\"status,omitempty\"`\n+\n+    // JobSelector to detect parents jobs\n+    ParentSelector *JobSelector `json:\"parentSelector, omitempty\"`\n+}\n+```\n+\n+#### JobSpec and JobStatus\n+\n+No modifications\n+\n+#### Parent JobSelector\n+\n+The `.job.parentselector` is a label query over a set of jobs.\n+If all selected jobs are completed the `job` will be started immediately.\n+If `.job.parentselector` is absent the `job` will be started immediately.\n+Since labels are forwarded directly from `job` to pods, users should not create pods whose labels match this selector, either directly,\n+via another Job, or via another controller (for example Replication controller), [see](https://github.com/kubernetes/kubernetes/issues/14961).\n+\n+#### Some special cases\n+\n+Jobs terminated via [#17244](https://github.com/kubernetes/kubernetes/issues/17244)  (if implemented) will be considered _completed_ so will trigger the _child_ jobs. Since it's very unlikely that the user would keep the _child_ jobs alive we may add a field to cascade termination to _child_ jobs if any to the current proposals made by @pmorie and @bgrant0607.\n+\n+For example","path":"docs/proposals/workflow.md","position":99,"original_position":99,"commit_id":"2480ed60d8306a93ae64959dfbd09ea27ad6055d","original_commit_id":"2480ed60d8306a93ae64959dfbd09ea27ad6055d","user":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"body":"I'd drop the example here, it's not relevant to the proposal.","created_at":"2015-11-27T10:39:25Z","updated_at":"2015-11-27T10:39:25Z","html_url":"https://github.com/kubernetes/kubernetes/pull/17787#discussion_r46035316","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/46035316"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/17787#discussion_r46035316"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787","id":51819822,"html_url":"https://github.com/kubernetes/kubernetes/pull/17787","diff_url":"https://github.com/kubernetes/kubernetes/pull/17787.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/17787.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17787","number":17787,"state":"open","locked":false,"title":"job DAG workflow proposal","user":{"login":"sdminonne","id":9527409,"avatar_url":"https://avatars.githubusercontent.com/u/9527409?v=3","gravatar_id":"","url":"https://api.github.com/users/sdminonne","html_url":"https://github.com/sdminonne","followers_url":"https://api.github.com/users/sdminonne/followers","following_url":"https://api.github.com/users/sdminonne/following{/other_user}","gists_url":"https://api.github.com/users/sdminonne/gists{/gist_id}","starred_url":"https://api.github.com/users/sdminonne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdminonne/subscriptions","organizations_url":"https://api.github.com/users/sdminonne/orgs","repos_url":"https://api.github.com/users/sdminonne/repos","events_url":"https://api.github.com/users/sdminonne/events{/privacy}","received_events_url":"https://api.github.com/users/sdminonne/received_events","type":"User","site_admin":false},"body":"As mentioned in https://github.com/kubernetes/kubernetes/pull/11980\r\n@pmorie @soltysh @erictune @bgrant0607 @mikedanese ","created_at":"2015-11-25T16:55:00Z","updated_at":"2015-11-27T10:39:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6523b592b67fe073e39cfbae47911573d986e34e","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/17787/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2480ed60d8306a93ae64959dfbd09ea27ad6055d","head":{"label":"sdminonne:dag_workflow","ref":"dag_workflow","sha":"2480ed60d8306a93ae64959dfbd09ea27ad6055d","user":{"login":"sdminonne","id":9527409,"avatar_url":"https://avatars.githubusercontent.com/u/9527409?v=3","gravatar_id":"","url":"https://api.github.com/users/sdminonne","html_url":"https://github.com/sdminonne","followers_url":"https://api.github.com/users/sdminonne/followers","following_url":"https://api.github.com/users/sdminonne/following{/other_user}","gists_url":"https://api.github.com/users/sdminonne/gists{/gist_id}","starred_url":"https://api.github.com/users/sdminonne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdminonne/subscriptions","organizations_url":"https://api.github.com/users/sdminonne/orgs","repos_url":"https://api.github.com/users/sdminonne/repos","events_url":"https://api.github.com/users/sdminonne/events{/privacy}","received_events_url":"https://api.github.com/users/sdminonne/received_events","type":"User","site_admin":false},"repo":{"id":27047169,"name":"kubernetes","full_name":"sdminonne/kubernetes","owner":{"login":"sdminonne","id":9527409,"avatar_url":"https://avatars.githubusercontent.com/u/9527409?v=3","gravatar_id":"","url":"https://api.github.com/users/sdminonne","html_url":"https://github.com/sdminonne","followers_url":"https://api.github.com/users/sdminonne/followers","following_url":"https://api.github.com/users/sdminonne/following{/other_user}","gists_url":"https://api.github.com/users/sdminonne/gists{/gist_id}","starred_url":"https://api.github.com/users/sdminonne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdminonne/subscriptions","organizations_url":"https://api.github.com/users/sdminonne/orgs","repos_url":"https://api.github.com/users/sdminonne/repos","events_url":"https://api.github.com/users/sdminonne/events{/privacy}","received_events_url":"https://api.github.com/users/sdminonne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdminonne/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/sdminonne/kubernetes","forks_url":"https://api.github.com/repos/sdminonne/kubernetes/forks","keys_url":"https://api.github.com/repos/sdminonne/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdminonne/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdminonne/kubernetes/teams","hooks_url":"https://api.github.com/repos/sdminonne/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/sdminonne/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/sdminonne/kubernetes/events","assignees_url":"https://api.github.com/repos/sdminonne/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/sdminonne/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/sdminonne/kubernetes/tags","blobs_url":"https://api.github.com/repos/sdminonne/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdminonne/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdminonne/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdminonne/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdminonne/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/sdminonne/kubernetes/languages","stargazers_url":"https://api.github.com/repos/sdminonne/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/sdminonne/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/sdminonne/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/sdminonne/kubernetes/subscription","commits_url":"https://api.github.com/repos/sdminonne/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdminonne/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdminonne/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdminonne/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdminonne/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/sdminonne/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdminonne/kubernetes/merges","archive_url":"https://api.github.com/repos/sdminonne/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdminonne/kubernetes/downloads","issues_url":"https://api.github.com/repos/sdminonne/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/sdminonne/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/sdminonne/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/sdminonne/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdminonne/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/sdminonne/kubernetes/releases{/id}","created_at":"2014-11-23T20:52:45Z","updated_at":"2015-05-06T22:08:25Z","pushed_at":"2015-11-26T21:41:11Z","git_url":"git://github.com/sdminonne/kubernetes.git","ssh_url":"git@github.com:sdminonne/kubernetes.git","clone_url":"https://github.com/sdminonne/kubernetes.git","svn_url":"https://github.com/sdminonne/kubernetes","homepage":null,"size":134747,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"a873a43f8bda0b5b9b50b1041e80d6a945f5c98d","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-11-27T10:29:32Z","pushed_at":"2015-11-27T10:31:03Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":291089,"stargazers_count":11491,"watchers_count":11491,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3075,"mirror_url":null,"open_issues_count":2425,"forks":3075,"open_issues":2425,"watchers":11491,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/17787"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/17787"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/17787/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/17787/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2480ed60d8306a93ae64959dfbd09ea27ad6055d"}}}}