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

feat: start timeout for host runs #1782

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

lkingland
Copy link
Member

@lkingland lkingland commented Jun 6, 2023

  • 🎁 adds run options
  • 🎁 start timeout for host runs

Host-runs now support a Start Timeout option. The setting is added to the function as f.Run.StartTimeout.

Related: #1760

/kind enhancement

@knative-prow
Copy link

knative-prow bot commented Jun 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot requested review from maximilien and nainaz June 6, 2023 03:10
@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 6, 2023
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Patch coverage: 82.75% and project coverage change: +1.18 🎉

Comparison is base (f6c11c9) 62.37% compared to head (99bd945) 63.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1782      +/-   ##
==========================================
+ Coverage   62.37%   63.55%   +1.18%     
==========================================
  Files         106      106              
  Lines       13500    13553      +53     
==========================================
+ Hits         8420     8614     +194     
+ Misses       4285     4118     -167     
- Partials      795      821      +26     
Flag Coverage Δ
e2e-test 37.60% <24.13%> (-0.06%) ⬇️
e2e-test-oncluster 33.29% <10.34%> (+0.04%) ⬆️
e2e-test-oncluster-runtime 28.39% <10.34%> (?)
e2e-test-runtime-go 27.27% <10.34%> (?)
e2e-test-runtime-node 28.28% <10.34%> (?)
e2e-test-runtime-python 28.28% <10.34%> (?)
e2e-test-runtime-quarkus 28.41% <10.34%> (?)
e2e-test-runtime-springboot 27.33% <10.34%> (?)
e2e-test-runtime-typescript 28.41% <10.34%> (?)
integration-tests 51.88% <20.68%> (+3.51%) ⬆️
unit-tests-macos-latest 50.06% <82.75%> (+0.21%) ⬆️
unit-tests-ubuntu-latest 50.77% <82.75%> (+0.13%) ⬆️
unit-tests-windows-latest 50.01% <79.31%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/functions/errors.go 30.76% <ø> (ø)
pkg/functions/function.go 85.80% <ø> (ø)
cmd/run.go 73.52% <72.72%> (-0.80%) ⬇️
pkg/functions/runner.go 78.04% <85.71%> (+2.53%) ⬆️
pkg/functions/client.go 65.08% <86.36%> (+1.17%) ⬆️
pkg/docker/runner.go 66.66% <100.00%> (ø)

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lkingland lkingland force-pushed the start-timeout-run-options branch 2 times, most recently from 75d3c88 to 930e8e8 Compare June 7, 2023 01:01
@knative-prow knative-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 7, 2023
@lkingland lkingland marked this pull request as draft June 7, 2023 01:01
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2023
@lkingland lkingland added this to the Release 1.11 milestone Jun 7, 2023
Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

Some minor feedback (nits, really). Looks good so far. There appear to be modifications from some of your other PRs in here which presumably will make this PR smaller when the others are merged

cmd/run.go Outdated Show resolved Hide resolved
docs/reference/func_config_git_set.md Outdated Show resolved Hide resolved
pkg/docker/runner.go Show resolved Hide resolved
pkg/functions/client_test.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2023
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2023
@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 12, 2023
pkg/functions/runner.go Outdated Show resolved Hide resolved
@lkingland lkingland marked this pull request as ready for review June 12, 2023 14:40
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 12, 2023
@lkingland lkingland requested review from lance and removed request for maximilien, rhuss, jrangelramos and nainaz June 12, 2023 14:58
@lkingland lkingland force-pushed the start-timeout-run-options branch 3 times, most recently from 654e454 to 57f4e76 Compare June 12, 2023 15:45
pkg/functions/runner.go Outdated Show resolved Hide resolved
pkg/functions/runner.go Outdated Show resolved Hide resolved
@lkingland lkingland force-pushed the start-timeout-run-options branch 2 times, most recently from 706afbe to 04d2e68 Compare June 12, 2023 17:19
@lkingland
Copy link
Member Author

Thanks for helping make sure the logic was correct @matejvasek .

@lance do you think the suggestion above will work: allowing this PR through, which implements the start-timeout for host-based runs, and then opening separate issues to track implementing the option for containerized runs and on deployed services?

Copy link
Member

@aslom aslom left a comment

Choose a reason for hiding this comment

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

Could we use feature flag (simple environment variable?) to hide options until they are fully working?

@lance
Copy link
Member

lance commented Jun 13, 2023

Thanks for helping make sure the logic was correct @matejvasek .

@lance do you think the suggestion above will work: allowing this PR through, which implements the start-timeout for host-based runs, and then opening separate issues to track implementing the option for containerized runs and on deployed services?

That seems like a reasonable approach to me

@lkingland
Copy link
Member Author

lkingland commented Jun 16, 2023

Could we use feature flag (simple environment variable?) to hide options until they are fully working?

Sure, I set this flag as hidden (if used, it will yield an informative error that it's not supported for containerized runs), and will add a feature flag to the next PR, #1748 (which enables the Host builder) until such time as a few other PRs are merged (~7 pending. you can check out my develop branch for the latest) which should add the minimum necessary base functionality.

@aslom
Copy link
Member

aslom commented Jun 16, 2023

@lkingland with feature flag we should have more freedom to experiment without worrying that new options in CLI may confuse users? Also make it easier to test if previous behavior is not affected if the code changing it is behind feature flag? I am ok either way.

@aslom
Copy link
Member

aslom commented Jun 16, 2023

I have verified that make test works and did basic func run and deploy and everything looks good. Great to see run timeout addition. Hopefully soon exposed:

../func/func run --start-timeout 10m
Error: the ability to specify the startup timeout for containerized runs is coming soon

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2023
@knative-prow knative-prow bot merged commit cabba3f into knative:main Jun 16, 2023
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants