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 22 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 81.14754% with 46 lines in your changes missing coverage. Please review.

Project coverage is 16.61%. Comparing base (53eb2c5) to head (821992e).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...gent/manager/allocator/impl/FirstFitAllocator.java 80.14% 23 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    14055    14106      +51     
============================================
  Files          5771     5773       +2     
  Lines        512829   512864      +35     
  Branches      62291    62252      -39     
============================================
+ Hits          85013    85205     +192     
+ Misses       418329   418187     -142     
+ Partials       9487     9472      -15     
Flag Coverage Δ
uitests 3.89% <ø> (-0.02%) ⬇️
unittests 17.51% <81.14%> (+0.04%) ⬆️

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

@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache CloudStack 4.21.0 Jul 9, 2025
@DaanHoogland DaanHoogland reopened this Jul 9, 2025
@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.

@DaanHoogland
Copy link
Contributor

@winterhazel does the code looks good to you?

@JoaoJandre it does, but I want to test before approving.

@winterhazel , I do understand that your request for changes is honoured to satisfaction?

@sureshanaparti sureshanaparti moved this from Done to In Progress in Apache CloudStack 4.21.0 Jul 9, 2025
@blueorangutan
Copy link

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

@winterhazel
Copy link
Member

@winterhazel does the code looks good to you?

@JoaoJandre it does, but I want to test before approving.

@winterhazel , I do understand that your request for changes is honoured to satisfaction?

@DaanHoogland yes

@BryanMLima BryanMLima force-pushed the refactor-allocate-to-method branch from eae724a to e9ea442 Compare July 9, 2025 14:38
@BryanMLima
Copy link
Contributor Author

Hey @winterhazel @JoaoJandre @DaanHoogland, this should be good for testing now.

@DaanHoogland DaanHoogland dismissed winterhazel’s stale review July 13, 2025 18:28

requests for changes satisfied

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

@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-13769)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 52846 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9074-t13769-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

Copy link

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

Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
Copy link

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

…method

# Conflicts:
#	server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy