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

Introduce event clocks based on k8s.io/utils/clock #103830

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

MikeSpreitzer
Copy link
Member

@MikeSpreitzer MikeSpreitzer commented Jul 21, 2021

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR makes an alternate version of the event clock stuff from staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/testing/clock that is better in two ways:

  1. it is based on k8s.io/utils/clock rather than the apimachinery clock package, and
  2. it exports the EventClock interface and implementations.

The latter is helpful so that we can make the queueset implementation take an action after a time (for duration padding).

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 21, 2021
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 21, 2021
@MikeSpreitzer
Copy link
Member Author

/cc @wojtek-t
/cc @tkashem

@MikeSpreitzer
Copy link
Member Author

@lavalamp

@k8s-ci-robot k8s-ci-robot added area/dependency Issues or PRs related to dependency changes and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 22, 2021
@MikeSpreitzer
Copy link
Member Author

MikeSpreitzer commented Jul 22, 2021

What is wrong with this thing? I keep getting complaints about package k8s.io/utils/clock/testing not being found. But it is there! BTW, I got those same complaints without the commit that adds that to the vendor modules.txt (see #103840).

Here, for example, is the complaint from the pull-kubernetes-verify job:

Errors from staticcheck:
vendor/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/clock/fake.go:29:2: cannot find package "k8s.io/utils/clock/testing" in any of:
/home/prow/go/src/k8s.io/kubernetes/vendor/k8s.io/utils/clock/testing (vendor tree)
/usr/local/go/src/k8s.io/utils/clock/testing (from $GOROOT)
/home/prow/go/src/k8s.io/utils/clock/testing (from $GOPATH) (compile)
\```

@fedebongio
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 22, 2021
@fedebongio
Copy link
Contributor

/cc @apelisse (you seem to have commented on similar PRs) Thanks!

@k8s-ci-robot k8s-ci-robot 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 Jul 22, 2021
@MikeSpreitzer MikeSpreitzer force-pushed the new-event-clock branch 2 times, most recently from fe5d6cd to 2341f3d Compare July 26, 2021 15:55
@MikeSpreitzer
Copy link
Member Author

The recent force-pushes add comments as discussed and squash.

@wojtek-t
Copy link
Member

/lgtm
/approve

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 28, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 28, 2021
@@ -1,5 +1,5 @@
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2021 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

nit: feel free to ignore, but we shouldn't be changing dates in case of moving files around

Copy link
Member Author

Choose a reason for hiding this comment

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

This one is not just a move, there are substantial edits here.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2021
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2021
@MikeSpreitzer
Copy link
Member Author

The force-push to 17f9c51ff85 updated the comments on EventFunc, EventClock to remove information that is specific to FakeEventClock, and added information to the comment on FakeEventClock.

@MikeSpreitzer
Copy link
Member Author

And the force-push to c177aff5be1 made another revision to the comment on FakeEventClock.

@wojtek-t
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2021
@wojtek-t
Copy link
Member

wojtek-t commented Aug 5, 2021

@MikeSpreitzer - can you please rebase?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 5, 2021
@dims
Copy link
Member

dims commented Aug 5, 2021

@MikeSpreitzer needs rebase

So we can move off of the apimachinery clock package.

Switch queueset to new clocks.

Removed event clocks based on apimachinery clocks,
because this PR introduces ones based on k8s.io/utils/clock .

Removed interface that is implemented by only one interesting type.

Simplify RealEventClock::EventAfterTime.
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 5, 2021
@MikeSpreitzer
Copy link
Member Author

The force-push to dcb298c is a rebase onto master.
@dims , @wojtek-t

@wojtek-t
Copy link
Member

wojtek-t commented Aug 5, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MikeSpreitzer, wojtek-t

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

@k8s-ci-robot k8s-ci-robot merged commit 5a92b78 into kubernetes:master Aug 5, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Aug 5, 2021
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. area/apiserver area/dependency Issues or PRs related to dependency changes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants