apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

Add Cloudian HyperStore Object Storage #9748

Open tpodowd opened 1 month ago

tpodowd commented 1 month ago

Description

This PR Adds A New Object Storage Provider Plugin for Cloudian HyperStore

More Details:

UI Changes - Add Object Storage for Cloudian HyperStore:

Other Bug fixes and improvements as part of this fix I kept in separate commits.

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Bug Severity

Screenshots (if appropriate):

Screenshot 2024-09-30 at 13 02 20

How Has This Been Tested?

  1. Unit Testing
  2. Testing against the Cloudian HyperStore system. Tested bad configurations and credentials, system down.
  3. Monitored log entries and sniffed network connections.
  4. Tested the various UI compontents such as Add Object Storage, Edit and Delete Object Storage. Adding buckets with various Accounts and Projects, editing bucket configurations, verifying configurations were set using different S3 exploration tools.
  5. Tested the bucket browser UI component against HyperStore.

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

DaanHoogland commented 1 month ago

@blueorangutan package

blueorangutan commented 1 month ago

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

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 74.67700% with 196 lines in your changes missing coverage. Please review.

Project coverage is 15.88%. Comparing base (2fa1761) to head (f239762). Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
...river/CloudianHyperStoreObjectStoreDriverImpl.java 76.84% 90 Missing and 7 partials :warning:
...che/cloudstack/cloudian/client/CloudianClient.java 73.84% 28 Missing and 6 partials :warning:
...le/CloudianHyperStoreObjectStoreLifeCycleImpl.java 58.06% 24 Missing and 2 partials :warning:
...der/CloudianHyperStoreObjectStoreProviderImpl.java 40.00% 15 Missing :warning:
...storage/datastore/util/CloudianHyperStoreUtil.java 83.01% 6 Missing and 3 partials :warning:
...loudstack/storage/object/BucketApiServiceImpl.java 0.00% 8 Missing :warning:
...cloudstack/cloudian/client/CloudianCredential.java 82.05% 6 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9748 +/- ## ============================================ + Coverage 15.78% 15.88% +0.09% - Complexity 12550 12661 +111 ============================================ Files 5625 5633 +8 Lines 491972 492995 +1023 Branches 60019 61256 +1237 ============================================ + Hits 77663 78296 +633 - Misses 405850 406208 +358 - Partials 8459 8491 +32 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9748/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9748/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.04% <ø> (+<0.01%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9748/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.70% <74.67%> (+0.10%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

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

blueorangutan commented 1 month ago

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

rohityadavcloud commented 1 month ago

Thanks for the PR @tpodowd since we don't have the cloudian system to test against, we'll help with regression testing.

@blueorangutan test

blueorangutan commented 1 month ago

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

tpodowd commented 1 month ago

Hi @rohityadavcloud - I updated the PR to fix the README.md lint issue and also added a bit more unit test coverage in the main driver code.

You mentioned the following:

since we don't have the cloudian system to test against, we'll help with regression testing.

Thanks, let me know what information you need and I'll do my best to get back to you.

blueorangutan commented 1 month ago

[SF] Trillian test result (tid-11583) Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8 Total time taken: 56540 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9748-t11583-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
tpodowd commented 1 month ago

Hi @DaanHoogland - I think I have got the pre-commit stuff nailed now. I ran pre-commit locally and it fixed the end of files for me. Then I reviewed that and pushed commit 40c0366

tpodowd commented 1 month ago

Sorry. I was reviewing the beautiful code coverage report and reviewing code I had not tested when I noticed a bad typo that means CloudianClient won't timeout. I have a fix locally and have added unit tests. I am doing a full build and a bit more testing and then I'll push another commit.

tpodowd commented 1 month ago

Ok. Hopefully that is it. I have pre-commit hooked in now also so I know that is clean. Code coverage should be a little better again also.

DaanHoogland commented 1 month ago

@blueorangutan package

blueorangutan commented 1 month ago

@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 commented 1 month ago

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

tpodowd commented 1 month ago

Hi @DaanHoogland / @rohityadavcloud - There seems to be an error in one of the checks. I'm not sure that it is related to my changes though. Let me know if I need to do anything about it. Thanks!

DaanHoogland commented 1 month ago

Hi @DaanHoogland / @rohityadavcloud - There seems to be an error in one of the checks. I'm not sure that it is related to my changes though. Let me know if I need to do anything about it. Thanks!

rerunning, let's see. It doesn't seem related to me either.

tpodowd commented 1 month ago

I realised that I should not change the key names that the Object Store Details use as they may be read/updated outside of the plugin. Thanks!

DaanHoogland commented 1 month ago

@blueorangutan package

blueorangutan commented 1 month ago

@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 commented 1 month ago

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

tpodowd commented 1 month ago

Hi @JoaoJandre - I have pushed another commit to address your review comments. Thanks for your time and let me know if you have any other concerns or questions.

JoaoJandre commented 1 month ago

Hi @JoaoJandre - I have pushed another commit to address your review comments. Thanks for your time and let me know if you have any other concerns or questions.

@tpodowd I did my best with no knowledge of Cloudian :smile: . In any case, overall it looks good to me. There is only one thing (https://github.com/apache/cloudstack/pull/9748#discussion_r1806353907) left that I think should be addressed.

tpodowd commented 1 month ago

@tpodowd I did my best with no knowledge of Cloudian 😄 . In any case, overall it looks good to me. There is only one thing (#9748 (comment)) left that I think should be addressed.

Hi @JoaoJandre - No worries. Thank you so much again for your time on this. I have addressed your last comment and have pushed an update.

abh1sar commented 2 weeks ago

Hi @tpodowd, I understand Cloudian doesn't support per bucket Quota. Does it support per user quota? Is there a way to configure it from within CloudStack?

cc @rohityadavcloud @sureshanaparti

tpodowd commented 2 weeks ago

Hi @abh1sar - Thanks for your comment/question.

I understand Cloudian doesn't support per bucket Quota.

Yes, Cloudian HyperStore does not currently support a bucket storage quota.

Does it support per user quota?

Yes, Cloudian HyperStore does support per user quota. We have a warning level and a hard limit for storage bytes and we also have some other related settings.

Is there a way to configure it from within CloudStack?

Unfortunately not. There are some issues here:

  1. Although the CloudStack APIs for Object Storage allow setting a quota on a bucket, there is no API framework provided to the plugins to set something on the CloudStack Account level.
  2. On HyperStore, setting a quota on an Account/User is usually something that an administrator would do as it is related to QoS settings (ie protecting the system, rather than protecting the user). I guess a user concerned about potential storage costs might also want to impose a limit on themselves. But, if the administrator for example set the QoS limit to one thing, then the user should not be able to raise it higher or disable it for themselves.

Currently, the administrator would have to login to the HyperStore system and either:

  1. Select the HyperStore group (representing the CloudStack Domain) and set a QoS limit that applies to all users in that group.
  2. Select the HyperStore user (representing the CloudStack Account) and set a QoS limit that only applies to that particular user.
abh1sar commented 2 weeks ago

Thanks @tpodowd for your response. If we had to implement the functionality to set Account level Quota in cloudstack, how do you think that could be done? Does the HyperStore plugin has API to do something like that? I am asking because I am working on a PR which adds resource limits to Object Storage space usage.

tpodowd commented 2 weeks ago

Hi @abh1sar. The current plugin does not have any API support itself for setting Account level QoS (as it only implements the provided plugin APIs). The HyperStore Admin API itself does support setting QoS for a user though so that could be made available to CloudStack if it was implemented in CloudianClient (which is easy enough). If I know more about what you are doing, I guess I can also chip in.

FYI. I have another PR pending this one also which adds the ability to edit the Object Store details. https://github.com/tpodowd/cloudstack/tree/edit_object_storage