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

Graph refresh #236

Merged
merged 6 commits into from
Oct 23, 2018
Merged

Graph refresh #236

merged 6 commits into from
Oct 23, 2018

Conversation

slemrmartin
Copy link
Contributor

@slemrmartin slemrmartin commented Oct 5, 2018

Graph refresh collects inventory to InventoryCollection + InventoryObject objects and saves by Persister.

Avoids using nested hashes when collecting data.

Switching Refresher as ManagerRefresh subclass, added collector/parser/persister classes.

Parser components are derived as much as possible from old style refresh.


@slemrmartin
Copy link
Contributor Author

lenovo er

@slemrmartin slemrmartin changed the title [WIP] Graph refresh Graph refresh Oct 8, 2018
@slemrmartin
Copy link
Contributor Author

cc @agrare @Ladas @douglasgabriel

There is one problem with inventories physical_disks and canisters. They didn't have unique key in old refresh and as I see they didn't have even unique key in lenovo REST API doc.
For canisters, there should be called /canisters to get UUID.
I used serial_number instead, because it sounds like (yes :) unique value

@agrare
Copy link
Member

agrare commented Oct 8, 2018

@slemrmartin yeah this is being added by ManageIQ/manageiq-schema#285
If you could review that PR and all of the others that would be a big help

@slemrmartin
Copy link
Contributor Author

cc @EsdrasVP

@EsdrasVP
Copy link
Member

EsdrasVP commented Oct 9, 2018

@slemrmartin As I commented on ManageIQ/manageiq-schema#285 (comment) there are cases in which the serial_number isn't returned by the API we consume, I don't surely know if this happens with Canister, but it happens with the drivers we parse to Physical Disks. But if we do what you suggested on the discussion, we can eliminate this from Canister side.

@slemrmartin
Copy link
Contributor Author

@EsdrasVP okay, I changed it in ManageIQ/manageiq#18063, that unique value is storage id + serial number, which can be nil.
Disk/canister will be badly overwritten only in case of 2 disks/canisters without serial number belonging to the same storage.

Also there are more changes in #235, which must be integrated to this code, right? There are some disk "total space" and multi-enclosures, right?

@EsdrasVP
Copy link
Member

EsdrasVP commented Oct 9, 2018

Disk/canister will be badly overwritten only in case of 2 disks/canisters without serial number belonging to the same storage.

@slemrmartin Yeah, if what I did on #235 it's approved and we use GET /canisters, this problem should not happen.

Also there are more changes in #235, which must be integrated to this code, right? There are some disk "total space" and multi-enclosures, right?

Yes, although the implementation of total_space was made on another, and already approved, PR. Don't know why is there, maybe due to a rebase, I'll check that.

@slemrmartin
Copy link
Contributor Author

slemrmartin commented Oct 9, 2018

@EsdrasVP all parser components are copied to new location here, because there are too many changes to use the same code for current and graph refresh.
So during the time there will be 2 parallel refreshes, code must be written to both places.

@slemrmartin slemrmartin closed this Oct 9, 2018
@slemrmartin slemrmartin reopened this Oct 9, 2018
@miq-bot miq-bot removed the wip label Oct 12, 2018
@slemrmartin
Copy link
Contributor Author

Integration to graph refresh from PR ManageIQ#233
@slemrmartin
Copy link
Contributor Author

#233 integrated

@miq-bot
Copy link
Member

miq-bot commented Oct 16, 2018

Checked commits slemrmartin/manageiq-providers-lenovo@9fc1ab6~...d47706f with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
28 files checked, 3 offenses detected

app/models/manageiq/providers/lenovo/inventory/collector.rb

app/models/manageiq/providers/lenovo/physical_infra_manager/hardware.rb

@CharlleDaniel
Copy link
Member

CharlleDaniel commented Oct 16, 2018

@slemrmartin I will close and reopen only for the travis to perform the specs again.

@slemrmartin
Copy link
Contributor Author

@CharlleDaniel this PR depends on ManageIQ/manageiq#18063, so tests are failing now

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

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

Awesome work @slemrmartin 👍

@Ladas Ladas self-assigned this Oct 23, 2018
@Ladas Ladas merged commit 02f147d into ManageIQ:master Oct 23, 2018
@slemrmartin slemrmartin deleted the graph-refresh branch November 1, 2018 08:49
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.

6 participants