Skip to content

Refactor of Allocator classes #9074

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

BryanMLima
Copy link
Contributor

@BryanMLima BryanMLima commented May 10, 2024

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

I tested the allocation process in my personal lab, using both the RandomAllocator and FirstFitAllocator 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?

Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 80.89431% with 47 lines in your changes missing coverage. Please review.

Project coverage is 16.61%. Comparing base (41b4f0a) to head (a98abd2).

Files with missing lines Patch % Lines
...gent/manager/allocator/impl/FirstFitAllocator.java 79.71% 24 Missing and 4 partials ⚠️
.../agent/manager/allocator/impl/RandomAllocator.java 89.09% 6 Missing ⚠️
...agent/manager/allocator/impl/TestingAllocator.java 0.00% 3 Missing ⚠️
...om/cloud/deploy/DeploymentPlanningManagerImpl.java 62.50% 2 Missing and 1 partial ⚠️
...in/java/com/cloud/server/ManagementServerImpl.java 0.00% 3 Missing ⚠️
.../src/main/java/com/cloud/host/dao/HostDaoImpl.java 0.00% 2 Missing ⚠️
...i/command/admin/host/FindHostsForMigrationCmd.java 0.00% 1 Missing ⚠️
...loudstack/api/command/admin/host/ListHostsCmd.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9074      +/-   ##
============================================
+ Coverage     16.57%   16.61%   +0.03%     
- Complexity    13870    13915      +45     
============================================
  Files          5719     5720       +1     
  Lines        507200   507124      -76     
  Branches      61574    61522      -52     
============================================
+ Hits          84093    84268     +175     
+ Misses       413688   413446     -242     
+ Partials       9419     9410       -9     
Flag Coverage Δ
uitests 3.96% <ø> (ø)
unittests 17.49% <80.89%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@BryanMLima BryanMLima force-pushed the refactor-allocate-to-method branch from 537c10f to 952c273 Compare July 15, 2024 13:26
@BryanMLima BryanMLima changed the title Refactoring FirstFitAllocator class Refactoring Allocator classes Jul 15, 2024
@BryanMLima BryanMLima marked this pull request as ready for review July 15, 2024 13:44
@BryanMLima BryanMLima changed the title Refactoring Allocator classes Refactor of Allocator classes Jul 15, 2024
@BryanMLima BryanMLima requested review from JoaoJandre and DaanHoogland and removed request for JoaoJandre July 15, 2024 13:45
Copy link
Contributor

@JoaoJandre JoaoJandre left a 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.

@BryanMLima BryanMLima force-pushed the refactor-allocate-to-method branch 2 times, most recently from dd1eb14 to 952c273 Compare July 24, 2024 14:28
@BryanMLima BryanMLima force-pushed the refactor-allocate-to-method branch from 952c273 to b7cc66f Compare August 23, 2024 19:11
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10801

@DaanHoogland
Copy link
Contributor

@blueorangutan LLtest

@BryanMLima
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12226

@DaanHoogland DaanHoogland requested review from DaanHoogland and removed request for DaanHoogland February 15, 2025 14:56
Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@winterhazel
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@winterhazel 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.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13650

@winterhazel
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@winterhazel 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.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13651

@winterhazel
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@winterhazel 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

5 participants