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

[omdb] Show physical disks in blueprints and inventory #5745

Merged
merged 11 commits into from
May 16, 2024

Conversation

andrewjstone
Copy link
Contributor

This PR changes the construction and display of blueprint diffs significantly. The need for the changes arose out of the tight coupling between zones and sleds. When adding disks to the mix we needed to also take them into account when determininig when a sled was modified. We also want to display physical disks as tables along with the zone tables under the sleds. This turned out to be somewhat trickier than necesary, and so I changed how the tables were constructed and rendered. Hopefully this will also make it easier to add new tables in the future.

One possibly controversial change is that I changed the way zone modifications are rendered. They are no longer three lines long. Currently only disposition is allowed to change, and so I used an arrow from "old" to "new" versions. Additionally, I removed the (added/ modified/removed) suffixes as they seem redundant to me, make the lines longer, and make things harder to read IMO. I'm open to discussion about both of these changes. My guess is that eventually, we'll want to be able to do row filtering, and I plan to also add some colored output, also in this PR most likely.

It should be noted that the output mechanism is decoupled from the representation of the tables, BpSledSubtable. This allows output in other formats if desired in the future.

As for the inventory collection output, I added a requirement when filtering on sled-id, that we also filter on collection-id, because filtering on sled-id does a full table scan and requires a new index. I can add the index instead if we feel it's important.

Fixes #5624

dev-tools/omdb/tests/successes.out Outdated Show resolved Hide resolved
dev-tools/omdb/tests/successes.out Show resolved Hide resolved
nexus/types/src/deployment.rs Outdated Show resolved Hide resolved
nexus/types/src/deployment/blueprint_diff.rs Outdated Show resolved Hide resolved
nexus/types/src/deployment/blueprint_diff.rs Outdated Show resolved Hide resolved
nexus/types/src/deployment/blueprint_display.rs Outdated Show resolved Hide resolved
@@ -39,7 +39,7 @@
}
],
"datum_type": "cumulative_u64",
"created": "2024-05-03T22:37:51.326086935Z"
"created": "2024-05-11T09:41:23.361298682Z"
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this supposed to be committed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, it changed. But maybe I shouldn't have committed it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would vote "don't commit it" along with possibly file an issue? I'm surprised this isn't an issue on main...

Copy link
Collaborator

Choose a reason for hiding this comment

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

This works because we explicitly ignore timestamps when comparing the schema on disk with the current one. It's fine to commit, or not, whatever you'd like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. Thanks @bnaecker. I believe it changed when I ran all the tests with cargo nextest run. I'll leave it out of sheer laziness.

nexus/reconfigurator/planning/src/planner.rs Outdated Show resolved Hide resolved
This PR changes the construction and display of blueprint diffs
significantly. The need for the changes arose out of the tight coupling
between zones and sleds. When adding disks to the mix we needed to also
take them into account when determininig when a sled was modified. We also
want to display physical disks as tables along with the zone tables
under the sleds. This turned out to be somewhat trickier than necesary,
and so I changed how the tables were constructed and rendered. Hopefully
this will also make it easier to add new tables in the future.

One possibly controversial change is that I changed the way zone
modifications are rendered. They are no longer three lines long.
Currently only `disposition` is allowed to change, and so I used an
arrow from "old" to "new" versions. Additionally, I removed the (added/
modified/removed) suffixes as they seem redundant to me, make the lines
longer, and make things harder to read IMO. I'm open to discussion about
both of these changes. My guess is that eventually, we'll want to be
able to do row filtering, and I plan to also add some colored output,
also in this PR most likely.

It should be noted that the output mechanism is decoupled from the
representation of the tables, `BpSledSubtable`. This allows output in
other formats if desired in the future.

As for the inventory collection output, I added a requirement when
filtering on sled-id, that we also filter on collection-id, because
filtering on sled-id does a full table scan and requires a new index. I
can add the index instead if we feel it's important.

Fixes #5624
@andrewjstone andrewjstone force-pushed the omdb-physical-disks-experimental-tables-2 branch from 009bc2c to e076d97 Compare May 15, 2024 22:29
@andrewjstone
Copy link
Contributor Author

There's actually a bug here where we're generating new output on every test run because UUIDs for physical disks aren't fixed.

There's another one, where we want to sort by zone type rather than uuid, but we don't.

I'll fix both of these up.

@andrewjstone
Copy link
Contributor Author

There's actually a bug here where we're generating new output on every test run because UUIDs for physical disks aren't fixed.

There's another one, where we want to sort by zone type rather than uuid, but we don't.

I'll fix both of these up.

These are now fixed.

I think this PR is good to go. I haven't yet changed back the diffs to be multiline, but I can do that in a follow up immediately. There are some changes that make writing tests slightly different which I'd like to get in before the blueprint stuff gets refactored. There are also a bunch of other changes to make the test system more deterministic by using seeded TypedUuids everywhere I noticed an issue.

Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

🎉

@andrewjstone andrewjstone merged commit a583f75 into main May 16, 2024
19 checks passed
@andrewjstone andrewjstone deleted the omdb-physical-disks-experimental-tables-2 branch May 16, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[omdb] Add support for showing physical disks in blueprints and inventory
3 participants