Skip to content

Conversation

shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Oct 9, 2025

Description

This change introduces support for synchronizing extension files across management servers in a clustered environment.

  • Adds new syncExtension API to trigger synchronization for a selected extension.
  • Implements service to create .tgz archive of the extension directory or selected files.
  • Generates signed share URL with HMAC signature and expiry.
  • Sends DownloadAndSyncExtensionFilesCommand to peer management servers.
  • Handles archive download, staging, and extraction on receiver side.
  • Adds Sync Extension action in the UI Extensions view.
  • Updates events, logging, and cleanup of temporary share files.

Refactors all filesystem related code to extensions framework layer.
Checksum for extensions is now calculated and compared for all files in
the extension directory.

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
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

image
(localcloud) 🐱 > sync extension id=3cf82f18-89c5-4acc-8f46-8d42da139f30 sourcemanagementserverid=0d8d73fa-9241-49aa-8d7e-7642f143ce66
{
  "success": true
}
(localcloud) 🐱 > sync extension id=3cf82f18-89c5-4acc-8f46-8d42da139f30
💩 Missing required parameters:  sourcemanagementserverid
(localcloud) 🐱 > sync extension -h
syncExtension: To sync the extension files from one management server to other management server(s)
This API is asynchronous.
Required params: id, sourcemanagementserverid, 
API Params               Type     Description
==========               ====     ===========
files                    list     List of files to sync. Specify absolute o
                                  r relative paths. If not provided, all e
                                  xtension files will be synced.
id                       uuid     ID of the extension
sourcemanagementserverid uuid     ID of the management server from which fi
                                  les are to be synced
targetmanagementserverids list     the IDs of the management servers to whic
                                  h the extension files are to be synced. 
                                  If not specified, the files will be sync
                                  ed to all management servers

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 63.72549% with 370 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.62%. Comparing base (b99a030) to head (ecbdcd6).

Files with missing lines Patch % Lines
...extensions/manager/ExtensionsShareManagerImpl.java 67.54% 73 Missing and 26 partials ⚠️
...sions/manager/ExtensionsFilesystemManagerImpl.java 66.31% 65 Missing and 32 partials ⚠️
.../main/java/org/apache/cloudstack/ServerDaemon.java 0.00% 63 Missing ⚠️
...work/extensions/manager/ExtensionsManagerImpl.java 66.87% 29 Missing and 25 partials ⚠️
.../cloudstack/utils/server/ServerPropertiesUtil.java 32.65% 31 Missing and 2 partials ⚠️
...va/org/apache/cloudstack/ShareSignedUrlFilter.java 79.48% 3 Missing and 5 partials ⚠️
...nsions/command/StartSyncExtensionFilesCommand.java 36.36% 6 Missing and 1 partial ⚠️
...ework/extensions/command/ExtensionBaseCommand.java 25.00% 3 Missing ⚠️
...ack/framework/extensions/api/SyncExtensionCmd.java 94.59% 0 Missing and 2 partials ⚠️
.../command/DownloadAndSyncExtensionFilesCommand.java 96.00% 0 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11814      +/-   ##
============================================
+ Coverage     17.56%   17.62%   +0.06%     
- Complexity    15500    15629     +129     
============================================
  Files          5899     5910      +11     
  Lines        527793   528802    +1009     
  Branches      64479    64571      +92     
============================================
+ Hits          92714    93224     +510     
- Misses       424653   425077     +424     
- Partials      10426    10501      +75     
Flag Coverage Δ
uitests 3.59% <ø> (-0.01%) ⬇️
unittests 18.69% <63.72%> (+0.06%) ⬆️

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.

This change introduces support for synchronizing extension files across management servers in a clustered environment.

- Adds new syncExtension API to trigger synchronization for a selected extension.
- Implements service to create .tgz archive of the extension directory or selected files.
- Generates signed share URL with HMAC signature and expiry.
- Sends DownloadAndSyncExtensionFilesCommand to peer management servers.
- Handles archive download, staging, and extraction on receiver side.
- Adds Sync Extension action in the UI Extensions view.
- Updates events, logging, and cleanup of temporary share files.

Refactors all filesystem related code to extensions framework layer.
Checksum for extensions is now calculated and compared for all files in
the extension directory.

Signed-off-by: Abhishek Kumar <[email protected]>
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@shwstppr 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 15401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants