-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refactor of Allocator classes #9074
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9074 +/- ##
============================================
+ Coverage 15.81% 15.85% +0.04%
- Complexity 12554 12601 +47
============================================
Files 5629 5630 +1
Lines 492029 491963 -66
Branches 62293 63884 +1591
============================================
+ Hits 77811 77999 +188
+ Misses 405894 405642 -252
+ Partials 8324 8322 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
1ff8f4a
to
42d16d9
Compare
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
537c10f
to
952c273
Compare
import com.cloud.utils.component.AdapterBase; | ||
import com.cloud.vm.VirtualMachine; | ||
import com.cloud.vm.VirtualMachineProfile; | ||
|
||
public class TestingAllocator extends AdapterBase implements HostAllocator { |
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.
why is this not a BaseAllocator-child, @BryanMLima ?
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.
@DaanHoogland, because TestingAllocator
does not have any methods in common with BaseAllocator
. Is there a reason that it should extend it?
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.
No, but it seems an outlier and the name also suggests it is intended to be a mock version for testing what would make less sense if it is not based on the same. I'd have to study it's use to give a definite answer.
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.
LGTM, I did some basic testing, changed the allocator to FirstFit and created some VMs, the VM allocation worked fine with and without tags. However, my tests were limited, further testing would be good.
dd1eb14
to
952c273
Compare
952c273
to
b7cc66f
Compare
@blueorangutan package |
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10801 |
@blueorangutan LLtest |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11039 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11424)
|
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.
clgtm
@blueorangutan package |
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@DaanHoogland, could you trigger the smoke tests again? The failed tests in |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11082 |
@blueorangutan test |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-11448)
|
2368371
to
b93e998
Compare
@blueorangutan package |
@BryanMLima a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11121 |
Description
This PR refactors some
*Allocator
classes, improving modularity and code legibility. This PR also made some changes to logs across these classes.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
I tested the allocation process in my personal lab, using both the
RandomAllocator
andFirstFitAllocator
allocators. I tried some variation of tags and offerings, and everything looks good. Furthermore, I also added a lot of unit tests for the methods that I refactored.How did you try to break this feature and the system with this change?