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

Adding new IBM Cloud-Object-Storage provider #159

Merged
merged 15 commits into from
Jun 23, 2021

Conversation

iv1111
Copy link
Contributor

@iv1111 iv1111 commented Mar 19, 2021

  • this manager will implement a connection to the
    IBM Cloud-Object-Storage, for information see:
    https://www.ibm.com/cloud/object-storage

  • adding skeleton code, currently working on
    the 'parse' and related methods

Depends on: ManageIQ/manageiq-ui-classic#7675

@iv1111 iv1111 requested review from jaywcarman and agrare March 19, 2021 16:52
@iv1111 iv1111 requested review from blancett and Fryguy as code owners March 19, 2021 16:52
@iv1111
Copy link
Contributor Author

iv1111 commented Mar 19, 2021

@agrare Hey, Adam. We're starting our work on the IBM Cloud-Object-Storage provider, which will display cloud-buckets and objects in those cloud-buckets within MIQ. Only thing is, the registration of standalone Object-Providers in MIQ is disabled in UI as of now.

@chessbyte chessbyte added the enhancement New feature or request label Mar 19, 2021
@iv1111
Copy link
Contributor Author

iv1111 commented Mar 22, 2021

Here the build seems to fail due to a ruby version.

@agrare
Copy link
Member

agrare commented Mar 22, 2021

That should have been fixed by #160

@iv1111 iv1111 requested a review from agrare March 23, 2021 09:52
@iv1111
Copy link
Contributor Author

iv1111 commented Mar 23, 2021

@agrare I incorporated your suggestions.

@agrare
Copy link
Member

agrare commented Mar 23, 2021

This is looking good, just needs params_for_create, verify_credentials, and raw_connect at the class level, and verify_credentials, connect at the instance level.

We don't need to do refresh for the first PR as long as we can add the provider and it verifies credentials properly

@iv1111 iv1111 changed the title adding new IBM Cloud-Object-Storage provider [WIP] adding new IBM Cloud-Object-Storage provider Mar 23, 2021
@iv1111
Copy link
Contributor Author

iv1111 commented Mar 23, 2021

This is looking good, just needs params_for_create, verify_credentials, and raw_connect at the class level, and verify_credentials, connect at the instance level.

We don't need to do refresh for the first PR as long as we can add the provider and it verifies credentials properly

@jaywcarman Do you know if COS has an OpenAPI description so that we can generate the corresp. SDK/API gem for this an future tasks?

@miq-bot miq-bot added the wip label Mar 23, 2021
@jaywcarman
Copy link
Member

@jaywcarman Do you know if COS has an OpenAPI description so that we can generate the corresp. SDK/API gem for this an future tasks?

Yes, the download button on the COS API docs page is not easy to find:
image

Direct link to the openapi def json:
https://cloud.ibm.com/apidocs/cos/cos-compatibility.json

We'll need to work with the IBM SDK generation team.

@iv1111
Copy link
Contributor Author

iv1111 commented Mar 24, 2021

@jaywcarman Thanks! That's really cool. I guess we'd have to first do that before we implement connect and other methods. We'll discuss further in Slack.

@iv1111
Copy link
Contributor Author

iv1111 commented Mar 24, 2021

I added the same structure for COS provider as for VPC and PVS wrt. to the inventory. I've also added the params_for_create implementation.

@iv1111
Copy link
Contributor Author

iv1111 commented Apr 8, 2021

I've added the connect and verify_credentials methods, using IAM and S3 API for that. Validation of GUID pending.
This PR is still blocked by ManageIQ/manageiq-ui-classic#7675 as the rest of the image import workflow.

@iv1111
Copy link
Contributor Author

iv1111 commented Apr 8, 2021

@agrare Is this a legit build error? I can't understand from the logs.

@iv1111
Copy link
Contributor Author

iv1111 commented Apr 8, 2021

@agrare oh, probably missing value in the settings.yaml

def self.verify_bearer(region, endpoint, access_key, secret_key)
begin
raw_connect(region, endpoint, access_key, secret_key).list_buckets({}, :params => {:max_keys => 1})
rescue Aws::Errors::ServiceError, Seahorse::Client::NetworkingError => err
Copy link
Member

@chessbyte chessbyte Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really expecting AWS exceptions here?

Copy link
Member

@agrare agrare Jun 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agrare agrare force-pushed the cloud_object_storage branch from 31fc428 to e6f030f Compare June 11, 2021 15:12
iv1111 and others added 15 commits June 11, 2021 11:47
- this manager implements connection to the
  IBM Cloud-Object-Storage, for information see:
  https://www.ibm.com/cloud/object-storage

- implemented 'buckets' and 'object' listing in th the collector

- added 'connect' and 'verify_credentials' implementation

- added corresp. systemd files

- parser showing buckets: name, size, obj. count

- parser showing objects: name, size, date
The systemd unit files and contents need to use 'object_manager' for
'ManageIQ::Providers::IbmCloud::ObjectStorage::ObjectManager'.
Add secrets/credential configuration in preparation for refresh specs.
Secrets config should be kept local and not committed.
A default 'Endpoint' object is created in the COS ems 'endpoints'
attribute when the ems object is created. The '<<' operator will append
an _additional_ endpoint to the 'endpoints' list. Setting the url in the
default endpoint should be done through the 'FactorBot.create()' call to
create the COS ems object, so there is only one default endpoint with
the url set in this commit.
@agrare agrare force-pushed the cloud_object_storage branch from e6f030f to 4ac8b10 Compare June 11, 2021 15:48
@miq-bot
Copy link
Member

miq-bot commented Jun 11, 2021

Checked commits iv1111/manageiq-providers-ibm_cloud@c72b1b4~...4ac8b10 with ruby 2.6.3, rubocop 1.13.0, haml-lint 0.35.0, and yamllint
17 files checked, 0 offenses detected
Everything looks fine. 🍰

@agrare
Copy link
Member

agrare commented Jun 21, 2021

ManageIQ/manageiq-ui-classic#7675 is now implemented, allowing the addition of standalone object storage managers

@agrare
Copy link
Member

agrare commented Jun 21, 2021

We can fix any of these remaining issues in follow-up PRs, I'm going to assign to @jaywcarman for final review / merge since I have some commits in this branch

Copy link
Member

@jaywcarman jaywcarman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and everything is functional. I agree with @agrare's suggestion we address the remaining issues as follow-up PRs.

@jaywcarman jaywcarman merged commit 6481243 into ManageIQ:master Jun 23, 2021
@iv1111 iv1111 deleted the cloud_object_storage branch July 26, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request morphy/no
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants