-
Notifications
You must be signed in to change notification settings - Fork 168
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(workflow): set the weight of cpu request of custom containers #1518
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to finish a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/caicloud/engineering/blob/master/guidelines/cla.md to complete the CLA. 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 caicloud/tools repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing 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 |
94609ee
to
8a0f9ac
Compare
8a0f9ac
to
1a4d54c
Compare
pkg/server/config/config.go
Outdated
@@ -75,6 +75,8 @@ type CycloneServerConfig struct { | |||
|
|||
// Artifact config for artifacts which are managed by cyclone server | |||
Artifact ArtifactConfig `json:"artifact"` | |||
|
|||
WorkloadCustomContainerCPUWeight int `json:"workload_custom_container_cpu_weight"` |
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.
Please add some comments for the field
pkg/workflow/workload/pod/builder.go
Outdated
@@ -994,8 +1036,8 @@ func (m *Builder) ApplyResourceRequirements() error { | |||
requirements = m.wf.Spec.Resources | |||
} | |||
|
|||
m.pod.Spec.InitContainers = applyResourceRequirements(m.pod.Spec.InitContainers, requirements, false) | |||
m.pod.Spec.Containers = applyResourceRequirements(m.pod.Spec.Containers, requirements, true) | |||
m.pod.Spec.InitContainers = applyResourceRequirements(m.pod.Spec.InitContainers, requirements, false, config.Config.WorkloadCustomContainerCPUWeight) |
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.
Init containers executes one by one, so I think it is not necessary to comply with this rule.
@zhujian7 PTAL |
d72b611
to
4b12d80
Compare
pkg/server/config/config.go
Outdated
|
||
// WorkloadCustomContainerCPUWeight represents the proportion of cpu resource that custom containers would consume(1-100). | ||
// If this field is equal to 0, its value is changed to 100. | ||
WorkloadCustomContainerCPUWeight int `json:"workload_custom_container_cpu_weight"` |
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.
CustomContainerCPUWeight
is simpler?
@knight42 please fix the CI. |
4b12d80
to
0631aa8
Compare
0631aa8
to
1d43617
Compare
/cherrypick cps-2.8 |
@zhujian7: once the present PR merges, I will cherry-pick it on top of cps-2.8 in a new PR and assign it to you. In response to this:
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. |
2d70c89
to
d7e2cdf
Compare
/hold |
d7e2cdf
to
8f9f5fe
Compare
/close b/c this is not the root cause. |
What this PR does / why we need it:
WorkloadCustomContainerCPUWeight
topkg/server/config.CycloneServerConfig
applyResourceRequirements
would adjust the cpu request of the containers according to the above settingWhich issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @zhujian7
Release note: