Skip to content

Conversation

@sunshowers
Copy link
Contributor

In #5270, we need determinism not just from blueprints but also collections. So
move the UuidRng into a common place.

As part of that, I also decided to make it its own crate and write some
documentation about it, making it more generic along the way. I think this
should be a pretty clean representation of what this is trying to do.

Created using spr 1.3.6-beta.1
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

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

Looks good!

H: Hash,
H2: Hash,
{
// XXX: is Hash really the right thing to use here? That's what
Copy link
Contributor

Choose a reason for hiding this comment

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

The guarantees around stability seem nice in stable-hash, especially if we want to persist these values. However, the backwards compatibility seems dangerous in that it ignores default values. Probably best to stick with this for now.

Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) March 28, 2024 21:08
@sunshowers sunshowers merged commit 7484017 into main Mar 28, 2024
@sunshowers sunshowers deleted the sunshowers/spr/nexus-move-uuidrng-code-out-to-a-common-crate-make-collectionbuilder-use-it branch March 28, 2024 22:24
sunshowers added a commit that referenced this pull request Mar 29, 2024
While developing #5238, I noticed that the output was getting
significantly busier and less aligned. I decided to prototype out using
`tabled` to display outputs, and I really liked the results.

Examples that cover all of the cases are included in the PR. In the
future I'd also like to add color support on the CLI, and expand it to
inventory and `omdb` (it's similar except it doesn't have the zone
policy table).

Some other changes that are bundled into this PR:

* Sort by (zone type, zone ID) rather than zone ID, to keep zones of the
same type grouped together.
* Moved unchanged data to the top to allow users to see less scrollback.
* Moved metadata to the bottom for the same reason.
* Add information about the zone config being changed.
* Change `Blueprint::diff_sleds` and
`Blueprint::diff_sleds_from_collection` to
`Blueprint::diff_since_blueprint` and `diff_since_collection` recently.
* Reordered `diff_since_blueprint`'s arguments so that `self` is after
and the argument is before, to align with `diff_since_collection`. (I
found that surprising!)
* Renamed the diff type from `OmicronZonesDiff` to `BlueprintDiff`,
since it's going to contain a lot more than zones.
* Return an error from the diff methods, specifically if the before and
after have the same zone ID but different types.

Depends on #5238 and #5341.
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.

4 participants