Skip to content

Add validation and flag to support multi container#7167

Merged
knative-prow-robot merged 7 commits intoknative:masterfrom
savitaashture:multicontainer-part1
Mar 13, 2020
Merged

Add validation and flag to support multi container#7167
knative-prow-robot merged 7 commits intoknative:masterfrom
savitaashture:multicontainer-part1

Conversation

@savitaashture
Copy link
Copy Markdown
Contributor

@savitaashture savitaashture commented Mar 6, 2020

Fixes:
Parts of #5822 #3384

Design Doc: https://docs.google.com/document/d/1XjIRnOGaq9UGllkZgYXQHuTQmhbECNAOk6TT6RNfJMw/edit?ts=5e25d093#

Proposed Changes

  • Divided PR to multiple parts in order to cover all the functionality with sub PR's

Part1:

  • Add flag enable-multi-container in order to allow multi container support
    default value is false
  • Add validation check to support multi container
  • Add default values to support multi container

Release Note

None

/assign @mattmoor @dprotaso @markusthoemmes

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 6, 2020
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 6, 2020
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@savitaashture: 5 warnings.

Details

In response to this:

Fixes:
Parts of #5822 #3384

Proposed Changes

  • Divided PR to multiple parts in order to cover all the functionality with sub PR's

Part1:

  • Add flag enable-multi-container in order to allow multi container support
    default value is false
  • Add validation check to support multi container
  • Add default values to support multi container

Release Note

None

/assign @mattmoor @dprotaso @markusthoemmes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment thread pkg/apis/serving/v1/revision_validation_test.go Outdated
Comment thread pkg/apis/serving/v1beta1/revision_validation_test.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go
Comment thread pkg/apis/serving/k8s_validation_test.go Outdated
Comment thread pkg/apis/serving/v1alpha1/revision_validation_test.go Outdated
@knative-prow-robot knative-prow-robot added the area/API API objects and controllers label Mar 6, 2020
Copy link
Copy Markdown
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

Comment thread pkg/apis/serving/k8s_validation_test.go
Comment thread pkg/apis/serving/k8s_validation_test.go
@savitaashture savitaashture force-pushed the multicontainer-part1 branch from 54c97e6 to d8c2768 Compare March 6, 2020 14:56
Comment thread pkg/apis/config/defaults.go Outdated
Comment thread pkg/apis/config/defaults.go
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation_test.go Outdated
Comment thread pkg/apis/serving/k8s_validation_test.go
Comment thread pkg/apis/serving/v1/revision_defaults.go Outdated
Comment thread pkg/apis/serving/v1alpha1/revision_validation_test.go Outdated
Comment thread pkg/apis/config/defaults.go Outdated
@knative-test-reporter-robot
Copy link
Copy Markdown

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
3/3

Automatically retrying due to test flakiness...
/test pull-knative-serving-integration-tests

mattmoor added a commit to mattmoor/docs that referenced this pull request Mar 9, 2020
I must have missed this because the MD link checked is dying here: knative/serving#7167
knative-prow-robot pushed a commit to knative/docs that referenced this pull request Mar 9, 2020
I must have missed this because the MD link checked is dying here: knative/serving#7167
mattmoor added a commit to mattmoor/docs that referenced this pull request Mar 9, 2020
I must have missed this because the MD link checked is dying here: knative/serving#7167
knative-prow-robot pushed a commit to knative/docs that referenced this pull request Mar 9, 2020
I must have missed this because the MD link checked is dying here: knative/serving#7167
Copy link
Copy Markdown
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

Mostly nits from me.
Generally looks good.
Thanks a lot!

Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/v1/revision_defaults.go Outdated
Comment thread pkg/apis/serving/v1/revision_defaults.go
nc := defaultConfig()

// Process bool field.
nc.EnableMultiContainer = strings.EqualFold(data["enable-multi-container"], "true")
Copy link
Copy Markdown
Member

@dprotaso dprotaso Mar 10, 2020

Choose a reason for hiding this comment

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

nit: If we ever change the default for this property to true this will override it to false if the property is not set in a defaults config map

not important now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that's WAI? Alpha=Opt-In, Beta=Opt-Out, GA=remove the option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alpha=Opt-In, Beta=Opt-Out, GA=remove the option.

Yeah but data["enable-multi-container"] will return an empty string - so there's an explicit change that'll be needed when we swap from alpha to beta

not something that's necessary right now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah for beta this will require explicit code change, but I think that's by design, no? :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah - that's why I just marked it a nit

Comment thread pkg/apis/serving/v1/revision_defaults.go Outdated
Copy link
Copy Markdown
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

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

A few nits. I think it might've been worthwhile to even break the flag handling out into its own PR. Not strictly necessary to do that now though.

Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation.go Outdated
Copy link
Copy Markdown
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

/lgtm
But I'll let Dave or Matt do the final approval (nor I can in practice 😄 )

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2020
Copy link
Copy Markdown
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

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

few minor things

After this PR - I'd prioritize _conversion.go changes between v1alpha1, v1beta1 & v1 - otherwise the conversion webhook will return errors.

Comment thread pkg/apis/serving/k8s_validation.go Outdated
Comment thread pkg/apis/serving/k8s_validation_test.go Outdated
Comment thread pkg/apis/serving/k8s_validation_test.go Outdated
}
if _, ok := container.Resources.Requests[corev1.ResourceMemory]; !ok {
if rm := cfg.Defaults.RevisionMemoryRequest; rm != nil {
container.Resources.Requests[corev1.ResourceMemory] = *rm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does applying this default still make sense?

I'd think RevisionCPURequest & RevisionMemoryRequest would imply totals for all user containers combined?

Now the Pod's requests/limits are a multiple of the number of containers

Copy link
Copy Markdown
Contributor Author

@savitaashture savitaashture Mar 13, 2020

Choose a reason for hiding this comment

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

I assume each user containers also should have Resource information

Copy link
Copy Markdown
Member

@dprotaso dprotaso Mar 13, 2020

Choose a reason for hiding this comment

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

I made an issue for this discussion: #7240

Comment thread pkg/apis/serving/v1/revision_validation_test.go Outdated
Comment thread pkg/apis/serving/v1alpha1/revision_validation_test.go Outdated
Comment thread pkg/apis/serving/v1alpha1/revision_validation_test.go Outdated
Comment thread pkg/apis/serving/v1beta1/revision_validation_test.go Outdated
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 13, 2020
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/defaults.go 97.1% 97.1% 0.1
pkg/apis/serving/k8s_validation.go 99.1% 99.2% 0.1

@dprotaso
Copy link
Copy Markdown
Member

I made an issue for one more minor thing: #7241

@dprotaso
Copy link
Copy Markdown
Member

Can we prioritize landing the conversion changes next?

thanks for PR @savitaashture 🎉
/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 13, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, savitaashture

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

The pull request process is described here

Details 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-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 13, 2020
@savitaashture
Copy link
Copy Markdown
Contributor Author

savitaashture commented Mar 13, 2020

Can we prioritize landing the conversion changes next?

@dprotaso Sure i will send conversion changes

@knative-prow-robot knative-prow-robot merged commit 6194d05 into knative:master Mar 13, 2020
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/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants