Skip to content
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

Add Cloudian HyperStore Object Storage #9748

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tpodowd
Copy link
Contributor

@tpodowd tpodowd commented Sep 30, 2024

Description

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

  • Allow the CloudStack administrator to connect to Cloudian HyperStore object storage.
  • Once connected, CloudStack Accounts can create buckets that are managed by and belong to their own Account.
  • IAM Credentials are available for each bucket such that Accounts can use the buckets either from 3rd party S3 applications or from the CloudStack Bucket Browser UI Feature.
  • The plugin supports all the current CloudStack bucket operations such as Object Lock, Versioning, Encryption and policy settings.
  • The plugin currently does not support setting a bucket quota as HyperStore does not currently support that functionality.
  • Bucket usage is supported.

More Details:

  • See plugins/storage/object/cloudian/README.md for details

UI Changes - Add Object Storage for Cloudian HyperStore:

  • Cloudian HyperStore Object Storage requires more fields than Minio, Ceph and Simulator so when the Cloudian HyperStore provider is selected, the GUI adjusts and offers the extra fields that the provider requires.

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

  • Use a password input field type for object store secret key entry
  • Fix to avoid pre-pending a second '/' to the object name in the Bucket Browser Feature.
  • Fix issue where usage may not be collected if another object store is down.
  • Various fixes and enhancements to CloudianClient

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):

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?

  • As this change altered CloudianClient which is shared code with the other cloudian infrastructure plugin, I also re-tested that plugin after these changes.
  • I also lightly tested with Minio.
  • This plugin feature shouldn't break other areas of the system.

- Added API to return the version of the HyperStore service
- Added API to manage user Root credentials
- Added API to return usage information for buckets owned by a group

Fixes:
- Only disable https certificate validation if using https
- Don't log the admin password on error
- Update to always throw exception on error instead of sometimes
  returning empty data.
- Fixed empty list cases for list users and list groups
- Use an easier to understand exception message for SSL errors
- Updated test cases
If there are multiple object stores configured and one of the stores
is down or has some other issue returning bucket usage, it can
cause usage collection to be skipped on other object stores.
- Previous Behaviour:
  if uploadDirectory was empty, it was set to '/'. When the object
  is uploaded the API adds another '/' between the endpoint url
  and the object name, so an object called 'abc.txt' would be
  uploaded as '/abc.txt'. The bucket listing is done using a
  delimiter of '/' which returns the common prefix '/' of the
  '/abc.txt' object and the object itself is not listed at
  the top level.

- New Behaviour:
  The object is uploaded as 'abc.txt' if uploadDirectory is empty
  as would be expected.
- Allow the CloudStack administrator to connect to Cloudian HyperStore
  object storage.
- Once connected, CloudStack Accounts can create buckets that are
  managed by and belong to their own Account.
- IAM Credentials are available for each bucket such that Accounts
  can use the buckets either from 3rd party S3 applications or
  from the CloudStack Bucket Browser UI Feature.
- The plugin supports all the current CloudStack bucket operations
  such as Object Lock, Versioning, Encryption and policy settings.
- The plugin currently does not support setting a bucket quota
  as HyperStore does not currently support that functionality.
- Bucket usage is supported.

More Details:

- See plugins/storage/object/cloudian/README.md for details

UI Changes - Add Object Storage for Cloudian HyperStore:

- Cloudian HyperStore Object Storage requires more fields than
  Minio, Ceph and Simulator so when the Cloudian HyperStore
  provider is selected, the GUI adjusts and offers the
  extra fields that the provider requires.
@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.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 74.62687% with 204 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
...river/CloudianHyperStoreObjectStoreDriverImpl.java 76.00% 94 Missing and 7 partials ⚠️
...che/cloudstack/cloudian/client/CloudianClient.java 70.96% 29 Missing and 7 partials ⚠️
...le/CloudianHyperStoreObjectStoreLifeCycleImpl.java 61.76% 24 Missing and 2 partials ⚠️
...der/CloudianHyperStoreObjectStoreProviderImpl.java 40.00% 15 Missing ⚠️
...storage/datastore/util/CloudianHyperStoreUtil.java 86.41% 8 Missing and 3 partials ⚠️
...loudstack/storage/object/BucketApiServiceImpl.java 0.00% 8 Missing ⚠️
...cloudstack/cloudian/client/CloudianCredential.java 82.05% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9748      +/-   ##
============================================
+ Coverage     15.78%   15.88%   +0.09%     
- Complexity    12550    12642      +92     
============================================
  Files          5625     5631       +6     
  Lines        491972   492768     +796     
  Branches      60019    62543    +2524     
============================================
+ Hits          77663    78272     +609     
- Misses       405850   406019     +169     
- Partials       8459     8477      +18     
Flag Coverage Δ
uitests 4.03% <ø> (-0.01%) ⬇️
unittests 16.71% <74.62%> (+0.10%) ⬆️

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.

@blueorangutan
Copy link

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

@rohityadavcloud
Copy link
Member

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
Copy link

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

@tpodowd
Copy link
Contributor Author

tpodowd commented Oct 1, 2024

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
Copy link

[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
Copy link
Contributor Author

tpodowd commented Oct 2, 2024

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
Copy link
Contributor Author

tpodowd commented Oct 4, 2024

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.

- The timeout parameter was using the port so instead of timing
  out in 10 seconds, it was using 19443 seconds.
- Added tests to use real connections instead of mocking and
  added line tests to try catch other issues.
- Noticed that HyperStore and AWS IAM services use return
  different errorcodes. This will be fixed in HyperStore so
  handle both errorcodes.
@tpodowd
Copy link
Contributor Author

tpodowd commented Oct 4, 2024

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
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 11283

@tpodowd
Copy link
Contributor Author

tpodowd commented Oct 6, 2024

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
Copy link
Contributor

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.

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.

4 participants