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

Job resource - controller logic #13259

Merged
merged 2 commits into from
Sep 17, 2015

Conversation

soltysh
Copy link
Contributor

@soltysh soltysh commented Aug 27, 2015

This is 3rd part of the job resource trilogy. Depends on #12910 and #13254.

@sdminonne @akram this is providing basic running mechanism for jobs, I'm still working on it, but it's getting better 😉
@smarterclayton @derekwaynecarr fyi

@k8s-bot
Copy link

k8s-bot commented Aug 27, 2015

GCE e2e build/test passed for commit 0a2f62e0cfcb78f5e361b681fbdab2f3cd7b6e84.

@erictune erictune mentioned this pull request Aug 27, 2015
@k8s-github-robot k8s-github-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 1, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/XXL

@eparis eparis assigned erictune and unassigned eparis Sep 2, 2015
@soltysh soltysh force-pushed the job_controller_logic branch from 0a2f62e to 001c9c5 Compare September 3, 2015 14:39
@k8s-bot
Copy link

k8s-bot commented Sep 3, 2015

GCE e2e build/test passed for commit 001c9c56e6736f3bf63a68d76c8ce7b983d7f6b8.

@soltysh soltysh force-pushed the job_controller_logic branch from 001c9c5 to 0224b7e Compare September 8, 2015 14:07
@soltysh
Copy link
Contributor Author

soltysh commented Sep 8, 2015

Rebased against latest master to pick up the client changes, esp. the experimental part needed for testing.

@k8s-bot
Copy link

k8s-bot commented Sep 8, 2015

GCE e2e build/test passed for commit 0224b7e1257bd701414b6cec2d946c887cb2531d.

@soltysh soltysh force-pushed the job_controller_logic branch from 0224b7e to 6c8eb65 Compare September 9, 2015 15:19
@soltysh
Copy link
Contributor Author

soltysh commented Sep 9, 2015

The logic itself, looks finished. All is left is integration tests for the controller.

@k8s-bot
Copy link

k8s-bot commented Sep 9, 2015

GCE e2e build/test passed for commit 6c8eb655bf77375078e003be433cf331ae66f937.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 11, 2015
@erictune
Copy link
Member

@bgrant0607 told me that he likes how you are computing successes and failures by listing pods. So that can stay.

@erictune
Copy link
Member

@soltysh
To have a complete Job resource for our v1.1 release, I think we need:

  1. this PR
  2. e2e tests
  3. user docs
  4. examples
  5. reaper and scaler support in kubectl

Anything else you can think of?
Do you already have work in progress for all those items? If not, I'd be happy to pick up one of those items and work on it. Maybe docs?

@soltysh
Copy link
Contributor Author

soltysh commented Sep 15, 2015

I currently working on:

  • e2e tests
  • reaper and scaler support in kubectl

It would be great if you could write the user docs, I do have some examples, so I can create a separate PR with that.

@erictune
Copy link
Member

Okay, will work on user docs.

@soltysh soltysh force-pushed the job_controller_logic branch from 6c8eb65 to 137ba8f Compare September 16, 2015 12:07
@soltysh
Copy link
Contributor Author

soltysh commented Sep 16, 2015

@erictune this is rebased controller part (I've also added new testclient action to simplify testing client, the other commit in this PR). I'm currently working on e2e tests, reaper and scaler and examples. I'll create separate PRs for those, to make the review easier, unless you want me to include them in here?

@soltysh soltysh force-pushed the job_controller_logic branch from 137ba8f to 5e522b7 Compare September 16, 2015 12:12
@soltysh soltysh changed the title [WIP] Job resource - controller logic Job resource - controller logic Sep 16, 2015
@k8s-bot
Copy link

k8s-bot commented Sep 16, 2015

GCE e2e build/test failed for commit 137ba8f3f924ec860be60387576e42f2359b9362.

@k8s-bot
Copy link

k8s-bot commented Sep 16, 2015

GCE e2e build/test failed for commit 5e522b7be264046bd9dcd69eadd9e8da5d177624.

@soltysh soltysh closed this Sep 16, 2015
@soltysh soltysh reopened this Sep 16, 2015

func (jm *JobManager) manageJob(activePods []*api.Pod, successful, unsuccessful int, job *experimental.Job) int {
active := len(activePods)
parallelism := *job.Spec.Parallelism
Copy link
Contributor

Choose a reason for hiding this comment

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

Dereferencing without a nil check worries me. Is everyone else satisfied with knowing that if the object is created via conversion from a serialized type and if no one ever clears the field, this works? It worries me that this code depends on a particular path of building its objects.

Copy link
Member

Choose a reason for hiding this comment

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

seems okay to me to skip nil checks in private methods.

@erictune
Copy link
Member

do the e2e pass when you run them yourself, e.g. on vagrant?

},
&experimental.Job{},
replicationcontroller.FullControllerResyncPeriod,
framework.ResourceEventHandlerFuncs{
Copy link
Member

Choose a reason for hiding this comment

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

In a follow-up PR, consider factoring below inline function to a named function.

@erictune
Copy link
Member

LGTM.

@erictune erictune added lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-merge labels Sep 17, 2015
@erictune
Copy link
Member

the separation of commits is fine.

diff := *job.Spec.Completions - successful
// for RestartPolicyNever we need to count unsuccessful pods as well
if job.Spec.Template.Spec.RestartPolicy == api.RestartPolicyNever {
diff -= unsuccessful
Copy link
Member

Choose a reason for hiding this comment

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

I think this differs from the API docs. Fix the API docs in a separate PR?

Copy link
Member

Choose a reason for hiding this comment

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

Or make this match the doc and the design, and we can revisit adding failed completion after further design discussion.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Sep 17, 2015

GCE e2e build/test passed for commit 8cefa2e.

@k8s-github-robot
Copy link

Automatic merge from SubmitQueue

k8s-github-robot pushed a commit that referenced this pull request Sep 17, 2015
@k8s-github-robot k8s-github-robot merged commit 36eb737 into kubernetes:master Sep 17, 2015
"k8s.io/kubernetes/pkg/watch"
)

type JobManager struct {
Copy link
Member

Choose a reason for hiding this comment

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

This should be called JobController

@soltysh soltysh deleted the job_controller_logic branch September 18, 2015 09:04
@soltysh
Copy link
Contributor Author

soltysh commented Sep 18, 2015

@mikedanese I'll be addressing your and @erictune's comments next week in a followup PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants