cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Allow uploading of ISO for creating kubernetes supported versions

Open vishesh92 opened this issue 1 year ago • 17 comments

Description

This PR fixes https://github.com/apache/cloudstack/issues/8417 by allowing the user to register an ISO by uploading from local.

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)
  • [x] 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
  • [x] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

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

vishesh92 avatar Aug 21 '24 08:08 vishesh92

Codecov Report

:x: Patch coverage is 9.77444% with 120 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 17.35%. Comparing base (3d6ec29) to head (1abe54e). :warning: Report is 129 commits behind head on main.

Files with missing lines Patch % Lines
...bernetes/version/KubernetesVersionManagerImpl.java 23.63% 41 Missing and 1 partial :warning:
...tUploadParamsForKubernetesSupportedVersionCmd.java 0.00% 36 Missing :warning:
...che/cloudstack/api/AbstractGetUploadParamsCmd.java 0.00% 21 Missing :warning:
...api/command/user/iso/GetUploadParamsForIsoCmd.java 0.00% 18 Missing :warning:
...oudstack/api/response/GetUploadParamsResponse.java 0.00% 3 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9561      +/-   ##
============================================
- Coverage     17.36%   17.35%   -0.01%     
- Complexity    15237    15238       +1     
============================================
  Files          5888     5889       +1     
  Lines        525741   525898     +157     
  Branches      64164    64174      +10     
============================================
+ Hits          91274    91277       +3     
- Misses       424167   424320     +153     
- Partials      10300    10301       +1     
Flag Coverage Δ
uitests 3.62% <ø> (-0.01%) :arrow_down:
unittests 18.39% <9.77%> (-0.01%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Aug 21 '24 09:08 codecov[bot]

@blueorangutan package

vishesh92 avatar Aug 21 '24 09:08 vishesh92

@vishesh92 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 avatar Aug 21 '24 10:08 blueorangutan

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

blueorangutan avatar Aug 21 '24 11:08 blueorangutan

@vishesh92 would you mind adding some images to the description?

FelipeM525 avatar Aug 21 '24 11:08 FelipeM525

@vishesh92 will this create access issues? Currently, k8s ISOs are registered as public and are accessible to all. But now will it allow linking any existing ISO which can be seen by root admin. Also, earlier such ISOs were owned by system account to prevent direct deletion. Is there a check to prevent deletion if it is linked to a k8s version?

shwstppr avatar Aug 21 '24 12:08 shwstppr

@vishesh92 will this create access issues? Currently, k8s ISOs are registered as public and are accessible to all. But now will it allow linking any existing ISO which can be seen by root admin. Also, earlier such ISOs were owned by system account to prevent direct deletion. Is there a check to prevent deletion if it is linked to a k8s version?

I can add checks on the backend to ensure that the ISO has the required configuration settings. But it might be confusing for the end user.

Let me revisit the approach and directly allow uploading of ISO for k8s.

vishesh92 avatar Aug 22 '24 06:08 vishesh92

@blueorangutan package

vishesh92 avatar Aug 22 '24 10:08 vishesh92

@vishesh92 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 avatar Aug 22 '24 10:08 blueorangutan

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

blueorangutan avatar Aug 22 '24 11:08 blueorangutan

@blueorangutan package

vishesh92 avatar Aug 23 '24 06:08 vishesh92

@vishesh92 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 avatar Aug 23 '24 06:08 blueorangutan

@vishesh92 To be frank, I think this is too complicated. We could add an API to transform a regular ISO (registered or uploaded from local) to a CKS ISO, it will be simple and cover mose cases (e.g. Update an existing ISO to support CKS)

weizhouapache avatar Aug 23 '24 06:08 weizhouapache

@vishesh92 To be frank, I think this is too complicated. We could add an API to transform a regular ISO (registered or uploaded from local) to a CKS ISO, it will be simple and cover mose cases (e.g. Update an existing ISO to support CKS)

@weizhouapache My initial PR was for linking an existing ISO with a CKS Supported version (https://github.com/apache/cloudstack/compare/main...shapeblue:cloudstack:k8s-version-add-iso-id-backup). @shwstppr had some concerns regarding the iso's permissions. So, I made the implementation similar to how it is there right now for templates & ISOs.

vishesh92 avatar Aug 23 '24 06:08 vishesh92

@vishesh92 To be frank, I think this is too complicated. We could add an API to transform a regular ISO (registered or uploaded from local) to a CKS ISO, it will be simple and cover mose cases (e.g. Update an existing ISO to support CKS)

@weizhouapache My initial PR was for linking an existing ISO with a CKS Supported version (main...shapeblue:cloudstack:k8s-version-add-iso-id-backup). @shwstppr had some concerns regarding the iso's permissions. So, I made the implementation similar to how it is there right now for templates & ISOs.

we can add some restrictions

  • only root admin can do (same as add k8s version API)
  • the ISO will be changed to the same properties as k8s ISO (e.g. owner is system account, all users can access)

I had a quick look at your initial PR, it looks ok to me

weizhouapache avatar Aug 23 '24 07:08 weizhouapache

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

blueorangutan avatar Aug 23 '24 07:08 blueorangutan

@vishesh92 To be frank, I think this is too complicated. We could add an API to transform a regular ISO (registered or uploaded from local) to a CKS ISO, it will be simple and cover mose cases (e.g. Update an existing ISO to support CKS)

@weizhouapache My initial PR was for linking an existing ISO with a CKS Supported version (main...shapeblue:cloudstack:k8s-version-add-iso-id-backup). @shwstppr had some concerns regarding the iso's permissions. So, I made the implementation similar to how it is there right now for templates & ISOs.

we can add some restrictions

* only root admin can do (same as add k8s version API)

* the ISO will be changed to the same properties as k8s ISO (e.g. owner is system account, all users can access)

I had a quick look at your initial PR, it looks ok to me

@weizhouapache I am not sure about changing the properties of the existing ISO. I can maybe create a copy of the ISO with required ownership and properties. Do you think that would be a better approach?

vishesh92 avatar Aug 23 '24 08:08 vishesh92

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

github-actions[bot] avatar Sep 06 '24 06:09 github-actions[bot]

@vishesh92 could you please fix the merge conflicts. Thank you.

Pearl1594 avatar Feb 12 '25 18:02 Pearl1594

@vishesh92 could you please fix the merge conflicts. Thank you.

@vishesh92 , please also look at target branch and release, these do not match.

DaanHoogland avatar Feb 13 '25 09:02 DaanHoogland

@blueorangutan package

vishesh92 avatar Feb 13 '25 12:02 vishesh92

@vishesh92 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 avatar Feb 13 '25 12:02 blueorangutan

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

blueorangutan avatar Feb 13 '25 13:02 blueorangutan

@blueorangutan package

Pearl1594 avatar Feb 18 '25 15:02 Pearl1594

@Pearl1594 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 avatar Feb 18 '25 15:02 blueorangutan

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

blueorangutan avatar Feb 18 '25 16:02 blueorangutan

@blueorangutan test

vishesh92 avatar Feb 26 '25 10:02 vishesh92

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

blueorangutan avatar Feb 26 '25 10:02 blueorangutan

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

Test Result Time (s) Test File
test_06_purge_expunged_vm_background_task Failure 405.75 test_purge_expunged_vms.py

blueorangutan avatar Feb 27 '25 02:02 blueorangutan

@blueorangutan package

vishesh92 avatar Mar 12 '25 08:03 vishesh92