-
Notifications
You must be signed in to change notification settings - Fork 40k
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
ScheduledJob controller proposal #11980
ScheduledJob controller proposal #11980
Conversation
Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist") If this message is too spammy, please complain to ixdy. |
@@ -0,0 +1,132 @@ | |||
# ScheduledJob Controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment still holds on name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with "Cron" is that is technically focused (a particular linux
tool) but is opaque to higher level users who come from different
backgrounds.
Even the Chronos GitHub page describes it with "It allows you to schedule
your jobs using ISO8601 repeating interval notation, which enables more
flexibility in job scheduling". RepeatingJob or CalendarJob or
RecurringJob all seem less clear to an outside user (someone who is not an
expert at these systems) than ScheduledJob.
On Fri, Jul 31, 2015 at 12:41 PM, Timothy St. Clair <
notifications@github.com> wrote:
In docs/proposals/scheduledjob.md
#11980 (comment)
:@@ -0,0 +1,132 @@
+# ScheduledJob ControllerComment still holds on name
—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/11980/files#r35991090
.
Clayton Coleman | Lead Engineer, OpenShift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal was around (diurnal, periodic, etc.) There may be a couple more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Periodic suffers some of the same usability concerns. I do think API
objects should be precise in their meaning, but designed for end users, not
systems researchers.
On Fri, Jul 31, 2015 at 1:02 PM, Timothy St. Clair <notifications@github.com
wrote:
In docs/proposals/scheduledjob.md
#11980 (comment)
:@@ -0,0 +1,132 @@
+# ScheduledJob ControllerProposal was around (diurnal, periodic, etc.) There may be a couple more.
—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/pull/11980/files#r35992880
.
Clayton Coleman | Lead Engineer, OpenShift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with ScheduledJob. It's similar to ScheduledExecutorService in Java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also call it CalendaredJob
When you implement this please put in expapi. (#12001). |
@erictune gotcha. |
type ScheduledJobStatus struct { | ||
|
||
// PendingExecutions are the job runs pending for execution | ||
PendingExecutions []Job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much of the same feedback applies to this API as to Job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'll address them as soon as we have consensus on Job API, which I'm hoping will happen withing next couple of days :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My feedback re: Job API and overall status applies here too.
463be2b
to
15a69e4
Compare
@bgrant0607 @erictune I've updated the proposal, cutting the status structure significantly. I've only left there a list of currently executing jobs, which is needed to track these executions and fulfill the defined ConcurrentPolicy. |
@derekwaynecarr @smarterclayton ptal as well |
type ScheduledJobStatus struct { | ||
|
||
// Jobs are the currently running instances of a ScheduledJob. | ||
Jobs []Job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not a selector query? (you'd have to add a selector to ScheduledJobSpec)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you differentiate concurrent runs? We'd have to generate some random uuid for that selector in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The selector should select all Jobs created by the ScheduledJob. We can sort them by CreationTimestamp. What do you mean differentiate? How does having an array help you differentiate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I haven't thought about sorting them by CreationTimestamp, which generally speaking allows me to distinguish (that's the word I've meant to use, sorry :/) different ScheduledJob executions/runs needed to properly handle ConcurrentPolicy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting by CreationTimestamp seems exactly what the user would want, since ScheduledJobs are launched based on time.
Please no array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array removed, added selector to ScheduledJobSpec
.
Jobs []Job | ||
|
||
// Successful tracks the overall amount of successful completions of this job. | ||
Successful int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these accumulate indefinitely, they should probably be int64.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
15a69e4
to
e234d1f
Compare
@mikedanese @bgrant0607 addressed your comments, appreciate another round of reviews. |
GCE e2e build/test passed for commit e234d1f91b25a3bb16d4412459cd761416a2b248. |
Labelling this PR as size/L |
Let's continue this review targeting v1.2 |
@bgrant0607 wonder if you have an opinion on the |
@erictune I'd prefer unique label/selector generation to be part of Job. |
b00be17
to
10de4c2
Compare
@erictune as requested:
I've also:
It's all squashed and waiting your sing-off. |
GCE e2e test build/test passed for commit 10de4c2. |
This looks great. LGTM. |
Thanks for your help! |
@k8s-bot unit test this |
@erictune any chance on having this one merged? |
Merging because this is just a new doc. Build failure is known flaky test. |
ScheduledJob controller proposal
@soltysh merged. |
@erictune thank you! |
Is this being implemented anywhere? |
Not yet. I'm planning to start working on it after 1.2 is released.
|
Jobs guide says that "cron is expected in the next minor release". Do you plan this for 1.3 or 1.2.x? |
1.3 |
What is the projected release date for v1.3? |
Looks like documentation on http://kubernetes.io/docs/user-guide/jobs/#future-work didn't get updated (still pointing here). Should probably contain some of http://kubernetes.io/docs/user-guide/scheduled-jobs/ Also the reference documentation seems outdated http://kubernetes.io/docs/api-reference/batch/v1/definitions/ Last, but not least, the example on http://kubernetes.io/docs/user-guide/scheduled-jobs/#writing-a-scheduled-job-spec uses two non-standard notations: |
…ler_proposal ScheduledJob controller proposal
Diverged from #11746.
// cc @smarterclayton @timothysc @pmorie @bgrant0607 @davidopp @nwendling @derekwaynecarr @erictune @mikedanese @thockin