-
Notifications
You must be signed in to change notification settings - Fork 136
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
ytt execution can be interrupted (via a Go Context) #593
Comments
This is a very reasonable feature request. The implementation implies some complexity:
To perform time-based termination, The version of Starlark that |
This project is moving towards being more in-process integration-friendly: priority = unprioritized backlog. At this time, this item is not on the roadmap, but a PR would be fully supported. |
@pivotaljohn If we were to submit a PR for this, what would it take to verify there are no breaking changes when we update the starlark library? Is running all of the tests sufficient? Is there something more we should try to do? |
@pivotaljohn just looking through the commits, I notice that this commit is breaking. If y'all are trying to avoid introducing breaking changes, would you be open to a PR to vmware-tanzu/starlark-go that just adds the cancellation behavior without the rest of the commits from google/starlark-go, or would you not want to further diverge from them? |
Apologies for the long delay in replying, @martyspiewak. Yes, we are generally confident in the coverage of our test suite.
Yeah, we are pretty aggressive about avoiding breaking changes. I need a minute to remind myself of the history here. Is it possible to cherry-pick the cancel functionality... or in someway skip that breaking change? |
It looks like y'all are really using the ytt-1-jul-2020 branch in starlark-go (the commit referenced the go.mod file here only exists on that branch). I was able to cherry-pick the commit that adds this functionality to that branch on a fork (of starlark-go) and it doesn't seem to break anything. I used that in a fork of ytt and the tests seem to pass there as well. So, I guess the first step is to open a PR with this cherry-picked commit in starlark-go. Do you want me to open that PR against the "ytt-1-jul-2020" branch? |
Opened a PR against the ytt-1-jul-2020 branch. happy to change to a different branch if you want me to |
Reviewed the PR, yesterday w/ @cppforlife. We also spoke in depth about what approach would meet our goals, here: that is what API would ytt expose to afford users and integrators to terminate the invocation. While Starlark (with the PR you've cherry-picked, thank you) provides the ability to set a maximum "step execution", the way that So, this issue's request — to plumb Context through to the Starlark integration — is really the only feasible way we see this working. Also, we've (Carvel maintainers) prioritized this additional work as it seems of reasonably manageable scope and this is a particularly generally useful feature. |
The contents of carvel-dev/starlark-go#3 are likely GTG, but tests on that branch are not running successfully. That work needs be complete before this can proceed. |
Describe the problem/challenge you have
We would like to use the ytt Go module but we'd like to protect against bad templates that may take down the system (e.g. a template that defines an infinite loop). If we shell out to the executable, we can pass a context with a timeout to protect against this. With the go module, though, there is no way to pass such a context.
Describe the solution you'd like
Allow the ytt Go module to accept a context so we can get a timeout.
Additional Information
Related Slack conversation: https://kubernetes.slack.com/archives/CH8KCCKA5/p1642715223106300
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: