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
OCPCLOUD-2493: Update CAO to add upstream annotations #316
OCPCLOUD-2493: Update CAO to add upstream annotations #316
Conversation
@racheljpg: This pull request references OCPCLOUD-2493 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set. 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 openshift-eng/jira-lifecycle-plugin repository. |
3285a25
to
1b43a09
Compare
/retest |
1b43a09
to
7b7d287
Compare
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.
changes are looking good, we need some cleanup and more tests
annotationsutil.CpuKeyDeprecated: "1", | ||
}, | ||
}, | ||
} |
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 think we need more test cases here to exercise all the code paths in that function
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.
Hey Mike, thank you for the feedback. I've added some more test cases to test the other annotations in the SetAnnotations function
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.
Also added a second commit to make some changes to commits/names for clarity!
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.
these tests are looking great @racheljpg !
7b7d287
to
368e157
Compare
} | ||
|
||
// test checkscalefromzeroannotations on a new machine | ||
func TestScaleFromZeroAnnotations(t *testing.T) { |
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.
@elmiko Do you think it's worth adding this as a test case above to make things neater, or is it fine to leave it out here on it's own?
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 seems like we are testing the same functionality as above, i would add it as a case there.
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.
It actually seems like we are doing what I was trying to test there above on line 389, so I've removed that function entirely :)
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.
apologies for the delay on getting back here, this is looking good to me, just a couple minor nits and we can probably merge this.
expectedNewAnnotation: map[string]string{ | ||
annotationsutil.GpuCountKey: "1", | ||
annotationsutil.GpuCountKeyDeprecated: "1", | ||
annotationsutil.GpuTypeKey: "1", |
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.
just to make this a little more realistic, i would change this value to nvidia.com/gpu
, that is how it will look in a live cluster.
annotationsutil.CpuKeyDeprecated: "1", | ||
}, | ||
}, | ||
} |
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.
these tests are looking great @racheljpg !
} | ||
|
||
// test checkscalefromzeroannotations on a new machine | ||
func TestScaleFromZeroAnnotations(t *testing.T) { |
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 seems like we are testing the same functionality as above, i would add it as a case there.
2de239e
to
77cc8a9
Compare
Hello @elmiko, no worries, and thank you. I've changed the value of the GpuTypeKey and removed a redundant test. Thanks! |
77cc8a9
to
b7cce73
Compare
Hello! apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
annotations:
machine.openshift.io/GPU: '0'
autoscaling.openshift.io/machineautoscaler: openshift-machine-api/worker-us-east-1a
machine.openshift.io/memoryMb: '16384'
capacity.cluster-autoscaler.kubernetes.io/gpu-type: nvidia.com/gpu
capacity.cluster-autoscaler.kubernetes.io/labels: kubernetes.io/arch=amd64
machine.openshift.io/cluster-api-autoscaler-node-group-min-size: '1'
capacity.cluster-autoscaler.kubernetes.io/memory: '17179869184'
capacity.cluster-autoscaler.kubernetes.io/cpu: '4'
capacity.cluster-autoscaler.kubernetes.io/gpu-count: '0'
machine.openshift.io/vCPU: '4'
machine.openshift.io/cluster-api-autoscaler-node-group-max-size: '12' |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elmiko 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 |
@racheljpg: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
[ART PR BUILD NOTIFIER] This PR has been included in build ose-cluster-autoscaler-operator-container-v4.16.0-202403281444.p0.g287595b.assembly.stream.el9 for distgit ose-cluster-autoscaler-operator. |
Hello! This is a PR to update the CAO to add the upstream scale from zero annotations if it's only the old annotations that are there. Thanks!