Skip to content
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

Track number of active running workloads per queue #295

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

alculquicondor
Copy link
Contributor

@alculquicondor alculquicondor commented Jul 11, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR doesn't have any user visible changes. The information can be used to populate the information into a Queue status, to improve observability of kueue.

This is a spin off from #291

Which issue(s) this PR fixes:

Part of #259

Special notes for your reviewer:

Change-Id: Iac98b009808de37b70b93ccf7f1b77fcd03a21fc
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 11, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 11, 2022
@alculquicondor
Copy link
Contributor Author

Part of #259

Workloads: map[string]*workload.Info{},
Name: cq.Name,
Workloads: map[string]*workload.Info{},
wlCountPerQueue: make(map[string]int),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we unify the way we allocate the two maps, no preference on my side.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// The following fields are not populated in a snapshot.

// The number of admitted workloads per queue.
wlCountPerQueue map[string]int
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps admittedWorkloadsPerQueue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

utiltesting.MakeWorkload("job1", "ns1").Queue("alpha").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(),
utiltesting.MakeWorkload("job2", "ns2").Queue("beta").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(),
utiltesting.MakeWorkload("job3", "ns1").Queue("gamma").Admit(utiltesting.MakeAdmission("bar").Obj()).Obj(),
utiltesting.MakeWorkload("job4", "ns2").Queue("beta").Admit(utiltesting.MakeAdmission("foo").Obj()).Obj(),
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps add an unadmitted workload? I know a workload that is not yet admitted shouldn't be in the cash, but perhaps worth adding one anyways just to make sure we don't crash if there is such a bug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in the tests for workloads instead.

Change-Id: If91541b4b91defff2ac1ff1699ca6537b798e6db
@ahg-g
Copy link
Contributor

ahg-g commented Jul 11, 2022

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 11, 2022
@ahg-g
Copy link
Contributor

ahg-g commented Jul 11, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 11, 2022
@k8s-ci-robot k8s-ci-robot merged commit 326d623 into kubernetes-sigs:main Jul 11, 2022
ahg-g pushed a commit to ahg-g/kueue that referenced this pull request Aug 10, 2022
* Track number of active running workloads per queue

Change-Id: Iac98b009808de37b70b93ccf7f1b77fcd03a21fc

* Address review comments

Change-Id: If91541b4b91defff2ac1ff1699ca6537b798e6db
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants