-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Build OpenAPI Definitions per group instead of per resource #68576
Build OpenAPI Definitions per group instead of per resource #68576
Conversation
f4d8867
to
404476d
Compare
/sig api-machinery |
e07cd2b
to
e4041c0
Compare
/retest |
/assign @mbohlool |
return gvkToSchema, nil | ||
} | ||
|
||
func getCanonicalTypeName(model interface{}) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy from somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is copied from https://github.com/kubernetes/kube-openapi/blob/master/pkg/builder/openapi.go#L138-L151
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you reuse this please? these two copy can get out of sync. move them to somewhere common if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can, but it is in the kube-openapi repo, so it would mean changing it there first, and then vendoring it back in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I just put a TODO for this, and also make the PR to kube-openapi repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding todo and sending PR to kube-openapu repo looks good to me. Send a followup PR after the openapi PR got merged. Thanks.
I just ran some pprof analysis on startup of a basic API server with no extensions, before and after this change. Before this change, a total of ~16.7 million objects were allocated within the first 50 seconds of startup. |
Hrm, was hoping for a more dramatic reduction. Where were the bulk of the remaining allocations coming from under a cumulative sort? |
@smarterclayton About 5.5 million were coming from the openapi endpoint handler, which creates just one full openapi spec and serves it, and this change doesn't touch that code. I think the openapi spec might just take that many objects to create.
|
Ok, we can dig further after this. Can you grab a top30 and add it to the
original issue so we know what’s next on the hitlist? Thanks
On Sep 20, 2018, at 7:34 PM, Jenny Buckley <notifications@github.com> wrote:
@smarterclayton <https://github.com/smarterclayton> About 5.5 million were
coming from the openapi endpoint handler, which creates just one full
openapi spec and serves it, and this change doesn't touch that code. I
think the openapi spec might just take that many objects to create.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68576 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p91UWxL-sFVjKJGLHlf79Euii8yFks5uc9GfgaJpZM4WmGPy>
.
|
5017bae
to
dcf7bfb
Compare
Going to hold off on this until #69316 merges, since it also vendors in some unrelated kube-openapi changes |
dcf7bfb
to
c41bf34
Compare
/retest |
if err != nil { | ||
return gvkToSchema, err | ||
} | ||
sampleObject := reflect.Indirect(reflect.ValueOf(sampleObjectPtr)).Interface() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you probably don't need this. it should work if you pass sampleObjectPtr.
only one nit comment. otherwise look good. /lgtm |
51765bb
to
6d5f79f
Compare
6d5f79f
to
3c31b04
Compare
Rebased |
3c31b04
to
9fe1605
Compare
9fe1605
to
d02a543
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jennybuckley, lavalamp 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 |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
What this PR does / why we need it:
Addresses inefficiencies in the implementation of #63893
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of fixing #66368
Not sure where the 40 seconds comes from in the referenced bug, but this PR reduced startup time of kube apiserver by ~20% on my computer
Release note: