Skip to content

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?

@codecov
Copy link

codecov bot commented May 10, 2024

Codecov Report

❌ Patch coverage is 79.49791% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.46%. Comparing base (b0c7719) to head (39a6031).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...gent/manager/allocator/impl/FirstFitAllocator.java 77.09% 24 Missing and 6 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     17.38%   17.46%   +0.07%     
- Complexity    15282    15384     +102     
============================================
  Files          5891     5893       +2     
  Lines        526356   526444      +88     
  Branches      64270    64240      -30     
============================================
+ Hits          91526    91942     +416     
+ Misses       424488   424155     -333     
- Partials      10342    10347       +5     
Flag Coverage Δ
uitests 3.61% <ø> (-0.01%) ⬇️
unittests 18.51% <79.49%> (+0.08%) ⬆️

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.

@github-actions
Copy link

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

@github-actions
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 DaanHoogland and JoaoJandre 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

@blueorangutan
Copy link

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

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14009)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57357 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9074-t14009-kvm-ol8.zip
Smoke tests completed. 146 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@github-actions
Copy link

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

@weizhouapache weizhouapache modified the milestones: 4.21.0, 4.22.0 Aug 29, 2025
@DaanHoogland
Copy link
Contributor

@BryanMLima @winterhazel , 4.21 is out, can we try to get this in 4.22? or 4.20.2 as you, see fit?

cc @weizhouapache @harikrishna-patnala

@winterhazel
Copy link
Member

@BryanMLima @winterhazel , 4.21 is out, can we try to get this in 4.22? or 4.20.2 as you, see fit?

Sure, we just need some manual testing. I commented that I wanted to do it before, but I will hardly be able to do it in the upcoming 2 months, so if someone else could give this some attention to fit it in 4.22, that would be great.

@DaanHoogland
Copy link
Contributor

@BryanMLima @winterhazel , 4.21 is out, can we try to get this in 4.22? or 4.20.2 as you, see fit?

Sure, we just need some manual testing. I commented that I wanted to do it before, but I will hardly be able to do it in the upcoming 2 months, so if someone else could give this some attention to fit it in 4.22, that would be great.

Maybe (this is not me volunteering) but there is also conflicts ATM.

…method

# Conflicts:
#	plugins/host-allocators/random/pom.xml
@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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15167

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14448)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 51301 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9074-t14448-kvm-ol8.zip
Smoke tests completed. 147 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland
Copy link
Contributor

move to v23 @winterhazel @JoaoJandre ?

@JoaoJandre JoaoJandre modified the milestones: 4.22.0, 4.23 Oct 10, 2025
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.

6 participants