Skip to content

Instantly share code, notes, and snippets.

@jameswnl
Last active November 15, 2017 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameswnl/09d93da55c78e0edc3439461c9941d62 to your computer and use it in GitHub Desktop.
Save jameswnl/09d93da55c78e0edc3439461c9941d62 to your computer and use it in GitHub Desktop.
Describe pain points with possible enhancements of creating a new MIQ Provider

Based on using existing generator commnd: rails generate provider <AnyCloud>

Difficulties/Problems

  1. Variable not found error for the new cloud manager due to naming convention of class and folder.
  2. UI add-provider page: Validate button not enabled
  3. manageiq-ui-classic/app/views/layouts/angular-bootstrap/_auth_credentials_angular_bootstrap.html.haml
  4. manageiq-ui-classic/app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml
  5. manageiq-ui-classic/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js
  6. manageiq-ui-classic/app/controllers/mixins/ems_common_angular.rb
  7. (?) add column to ExtManagementSystem e.g. https://github.com/ManageIQ/manageiq-schema/commit/d8243c18a95aeb682f7c1955d6a27b29e7bcb9ab
  8. the inventory collect/parse/persist framework is not documented

Things to do:

  1. generate shell CloudManager: e.g. issue with oraclecloud vs oracle_cloud
  2. expose set of fields needed for add-provider screen, along with validation rules so that UI can render accordingly. (like the Ansible credential CRUD screen)
  3. building a dummy provider here. Goal is to have it running some basic operations that people can base on.
  4. Extract provider-specific things in the following back to provider itself
    1. manageiq-ui-classic/app/assets/javascripts/controllers/ems_common/ems_common_form_controller.js
    2. manageiq-ui-classic/app/controllers/mixins/ems_common_angular.rb
    3. manageiq-ui-classic/app/controllers/mixins/ems_common.rb
  5. automate the hook in manageiq:
    1. ManageIQ/manageiq-providers-dummy_provider#8
    2. Gemfile (done, but messed by the newly introduced group)
  6. Add some tests to make sure the provider will be able to plugin to manageiq. So when new provider is being updated, these tests can help guard the integration won't be broken (e.g. would be nice to prevent https://bugzilla.redhat.com/show_bug.cgi?id=1509432)
  7. document the inventory collect/parse/persist pattern with an example so that people can follow

Other notes:

  1. Workers
    1. refresh_worker
    2. event_cachter
    3. inventory_collector_worker
    4. metrics_collector_worker
  2. All workers currently
    1. include PerEmsWorkerMixin (in the parent BaseManager)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment