-
Notifications
You must be signed in to change notification settings - Fork 64
Quota release e2e testing and Fits
function fix
#398
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
Changes from all commits
69163df
79df8d1
5ef78b6
839f23a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Verify AppWrappers finished successfully | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 120 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: I think that it would be safer to increase this value to at least 180, or remove it all together. |
||
--- | ||
apiVersion: mcad.ibm.com/v1beta1 | ||
kind: AppWrapper | ||
metadata: | ||
name: my-job-1 | ||
namespace: test | ||
status: | ||
state: Completed | ||
--- | ||
apiVersion: mcad.ibm.com/v1beta1 | ||
kind: AppWrapper | ||
metadata: | ||
name: my-job-2 | ||
namespace: test | ||
status: | ||
state: Completed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- command: kubectl -n test delete appwrappers,jobs --all | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick, you should probably add a comment as to why are you deleting all the app wrappers that have previously been installed. |
||
--- | ||
apiVersion: mcad.ibm.com/v1beta1 | ||
kind: AppWrapper | ||
metadata: | ||
name: my-job-1 | ||
namespace: test | ||
labels: | ||
quota_context: bronze | ||
quota_service: service-root | ||
spec: | ||
schedulingSpec: | ||
minAvailable: 1 | ||
resources: | ||
GenericItems: | ||
- replicas: 1 | ||
completionstatus: Complete | ||
custompodresources: | ||
- replicas: 1 | ||
requests: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
limits: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
generictemplate: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: my-job-1 | ||
namespace: test | ||
labels: | ||
appwrapper.mcad.ibm.com: my-job-1 | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
template: | ||
metadata: | ||
name: my-job-1 | ||
namespace: test | ||
labels: | ||
appwrapper.mcad.ibm.com: my-job-1 | ||
spec: | ||
terminationGracePeriodSeconds: 1 | ||
restartPolicy: Never | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
sleep 30 | ||
resources: | ||
requests: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
limits: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
--- | ||
apiVersion: mcad.ibm.com/v1beta1 | ||
kind: AppWrapper | ||
metadata: | ||
name: my-job-2 | ||
namespace: test | ||
labels: | ||
quota_context: bronze | ||
quota_service: service-root | ||
spec: | ||
schedulingSpec: | ||
minAvailable: 1 | ||
resources: | ||
GenericItems: | ||
- replicas: 1 | ||
completionstatus: Complete | ||
custompodresources: | ||
- replicas: 1 | ||
requests: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
limits: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
generictemplate: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: my-job-2 | ||
namespace: test | ||
labels: | ||
appwrapper.mcad.ibm.com: my-job-2 | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
template: | ||
metadata: | ||
name: my-job-2 | ||
namespace: test | ||
labels: | ||
appwrapper.mcad.ibm.com: my-job-2 | ||
spec: | ||
terminationGracePeriodSeconds: 1 | ||
restartPolicy: Never | ||
containers: | ||
- name: ubuntu | ||
image: ubuntu:latest | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
sleep 30 | ||
resources: | ||
requests: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi | ||
limits: | ||
cpu: 900m | ||
nvidia.com/gpu: 0 | ||
memory: 300Mi |
Uh oh!
There was an error while loading. Please reload this page.
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.
@metalcycling I think this change is not necessary, and it decreases the ease of code comprehension.
It is not necessary because the call allocResponse, err := qm.quotaManagerBackend.AllocateForest(QuotaManagerForestName, consumerID) will have the same effect as proposed change implementation (see if forestController.IsConsumerAllocated(consumerID) {)
This change is not helping the code comprehension as:
Overall this change should be reverted as:
The proper fix for the issue highlighted by the test-case would be to replace the code at line 530
The
removeConsumer
helper function code: