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

server: make clients parse config TOMLs #810

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

gjcolombo
Copy link
Contributor

Stacked on #809. Related to #804 and #806.

Remove config TOML processing from propolis-server. The only thing the config TOML is used for in Omicron is specifying a bootrom path (and possibly a version string); turn this into a propolis-server command-line argument instead. The instance spec-based ensure API already ignored the server's config TOML, and the non-spec ensure API is about to be removed anyway, so this is a good time to make this shift.

To avoid breaking existing config TOML users, move the TOML-to-spec processing logic into the propolis-config-toml crate, and have it output propolis-client's generated instance spec types. (This would have been a layering violation previously, but is OK now that propolis-server no longer uses this crate.) Teach propolis-cli to use this crate to process TOMLs and to use the instance spec-based ensure endpoint to create and migrate VMs.

Remove the config TOML from the Propolis zone image and change its command line invocation. Also change PHD's propolis-server invocations as needed.

Finally, tweak the propolis-server and propolis-cli READMEs to describe the new state of affairs.

Tests: cargo test, PHD, created and migrated ad-hoc VMs (including with propolis-cli's --crucible-disks option).

@gjcolombo gjcolombo requested a review from hawkw November 15, 2024 18:36
@gjcolombo
Copy link
Contributor Author

The migrate-from-base tests' unhappiness is expected here, since downlevel propolis-server won't grok the args uplevel PHD is passing it. (This is a case where even HTTP server API versioning wouldn't have saved us!)

@gjcolombo gjcolombo force-pushed the gjcolombo/death-of-a-config-file branch from 360192d to 986264a Compare November 15, 2024 22:41
Copy link
Member

Choose a reason for hiding this comment

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

AFAICT, this code hasn't changed meaningfully, just moved --- but if there are changes here that are worth a closer look, let me know?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the logic in this and the old spec/config_toml.rs should be about the same. The main difference is that the new code generates a map of ComponentV0s instead of an internal-to-Propolis-server ParsedConfig type.

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

This is a large-ish diff, but the actual change is pretty straightforward and seems to be mostly moving code around, as far as I can tell. No concerns from me!

@gjcolombo gjcolombo force-pushed the gjcolombo/migration-failure-injection-spec branch from 0ac3bf1 to 15ad57c Compare December 2, 2024 20:40
@gjcolombo gjcolombo force-pushed the gjcolombo/death-of-a-config-file branch from 986264a to 8c0f774 Compare December 2, 2024 20:55
@gjcolombo gjcolombo force-pushed the gjcolombo/migration-failure-injection-spec branch from 15ad57c to 6046650 Compare December 17, 2024 17:53
Base automatically changed from gjcolombo/migration-failure-injection-spec to master December 17, 2024 18:30
Remove the propolis-server logic to add devices from the config TOML
when fielding an instance ensure request. This logic never adds any
devices in production anyway because the zone image's config TOML never
specifies any.

The config TOML does specify the path to the bootrom the server should
load (and an optional version string to display to the guest). Supply
these arguments on the command line instead of getting them from the
TOML. Once this is done, the config TOML in the zone image is
unnecessary, so remove it.
Now that config TOMLs no longer configure Propolis servers, rename
the propolis-server-config crate to propolis-config-toml, then add code
to convert a config TOML into a set of instance spec configuration
options. Most of this code already existed in propolis-server's config
TOML processor, which is now deleted.

Also tweak a couple of field names in the SoftNPU port spec type to
clarify that the name that a port has *within a SoftNPU setup* is
distinct from its instance spec component key.
@gjcolombo gjcolombo force-pushed the gjcolombo/death-of-a-config-file branch from 8c0f774 to fb4b081 Compare December 17, 2024 18:43
@gjcolombo gjcolombo merged commit 263fc28 into master Dec 18, 2024
10 of 11 checks passed
@gjcolombo gjcolombo deleted the gjcolombo/death-of-a-config-file branch December 18, 2024 00:06
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.

2 participants