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

Change RunOnce duration plugin to act as a limit instead of override #8304

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Mar 30, 2016

Makes the following changes to the RunOnceDuration plugin:

  • Intercepts only Creates instead of Create and Update
  • Renames the config field to 'Limit' instead of 'Override'
  • Prevents overwriting a set value on the pod if it is less than the configured limit

@csrwng
Copy link
Contributor Author

csrwng commented Mar 30, 2016

@liggitt @smarterclayton ptal

// seconds that a run-once pod can be active in that project
const ActiveDeadlineSecondsOverrideAnnotation = "openshift.io/active-deadline-seconds-override"
const ActiveDeadlineSecondsLimitAnnotation = "openshift.io/active-deadline-seconds-limit"
Copy link
Contributor

Choose a reason for hiding this comment

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

any doc need to be changed for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this will require a follow-up doc PR

@csrwng
Copy link
Contributor Author

csrwng commented Mar 30, 2016

@smarterclayton given that the existing config has been in since v1.1.2, is it acceptable to change the name of the config field?

@smarterclayton
Copy link
Contributor

Generally no.

On Wed, Mar 30, 2016 at 2:45 PM, Cesar Wong [email protected]
wrote:

@smarterclayton https://github.com/smarterclayton given that the
existing config has been in since v1.1.2, is it acceptable to change the
name of the config field?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8304 (comment)

@csrwng
Copy link
Contributor Author

csrwng commented Mar 30, 2016

So... would it be ok to still call it override, even though it's more like a max now?

@smarterclayton
Copy link
Contributor

Add a TODO that we want to rename it in the future. We can't rename
without updating the config version.

On Wed, Mar 30, 2016 at 3:34 PM, Cesar Wong [email protected]
wrote:

So... would it be ok to still call it override, even though it's more like
a max now?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#8304 (comment)

@csrwng
Copy link
Contributor Author

csrwng commented Mar 30, 2016

Added a commit to keep existing external names.
[test]

@csrwng csrwng force-pushed the runonce_limit_fix branch 2 times, most recently from 68ab166 to f12de06 Compare March 31, 2016 00:38
@csrwng
Copy link
Contributor Author

csrwng commented Mar 31, 2016

[test]

return true, nil
}

func minInt64(a, b *int64) *int64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

@csrwng
Copy link
Contributor Author

csrwng commented Apr 4, 2016

@Kargakis thx, using the kube function now.

@smarterclayton should this be considered for 3.2?

@smarterclayton
Copy link
Contributor

What's the risk to online? @bparees can you weigh in?

@csrwng
Copy link
Contributor Author

csrwng commented Apr 4, 2016

This is more @abhgupta's area

@abhgupta
Copy link
Member

abhgupta commented Apr 5, 2016

@csrwng Online is fine with the current limit of 1 hour for runonce pods. If a user cannot set it any lower, that is fine for now. The only impacted use case is that users are trying to optimize their resource usage and want to restrict their runonce pod(s) to a smaller duration so that they can do early reclamation pod/cpu/memory quota for other purposes. I am not too concerned about this use case for Online on day 1 and if users really want to terminate their pods, they still have the ability to do so to reclaim their quota/resources.

@abhgupta
Copy link
Member

abhgupta commented Apr 5, 2016

@csrwng @smarterclayton Just realized that deployment cancellations are handled by explicitly setting the ActiveDeadlineSeconds on the deployer/hook pods to 0. Since this is prevented by the plugin, the functionality is broken and users won't be able to cancel a wedged deployment and be stuck with it for the full hour, preventing new deployments from being triggered.

I believe this is a blocker.

@smarterclayton
Copy link
Contributor

Approved for 1.2

@smarterclayton smarterclayton added this to the 1.2.0 milestone Apr 5, 2016
@csrwng
Copy link
Contributor Author

csrwng commented Apr 5, 2016

@liggitt or @deads2k can you ptal?

return true, nil
}

func Int64MinP(a, b *int64) *int64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

don't export this

@liggitt
Copy link
Contributor

liggitt commented Apr 5, 2016

just a couple comments, needs rebase, LGTM otherwise

@csrwng
Copy link
Contributor Author

csrwng commented Apr 5, 2016

thx, made review changes

@csrwng
Copy link
Contributor Author

csrwng commented Apr 6, 2016

[test]

@csrwng
Copy link
Contributor Author

csrwng commented Apr 6, 2016

[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 1730b2a

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/2751/)

@csrwng
Copy link
Contributor Author

csrwng commented Apr 7, 2016

[merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/5540/) (Image: devenv-rhel7_3929)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 1730b2a

@openshift-bot openshift-bot merged commit 2621328 into openshift:master Apr 7, 2016
@xingxingxia
Copy link

@csrwng Works. But I must use activeDeadlineSecondsOverride in master config file. If use activeDeadlineSecondsLimit, seems it is not recognized and the setting does not take effect.
You commented Renames the config field to 'Limit' instead of 'Override'. It is more straightforward to keep consistent name in master config file as well, isn't it? Thanks!

@csrwng
Copy link
Contributor Author

csrwng commented Apr 8, 2016

@xingxingxia I only changed it to activeDeadlineSecondsLimit in the internal API but left it the same as before in the external API, which means you still need to use activeDeadlineSecondsOverride in the master-config.yaml. Therefore, existing documentation should still be valid.

@xingxingxia
Copy link

OK, got it

@csrwng csrwng deleted the runonce_limit_fix branch July 19, 2016 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants