-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: gjcolombo/migration-failure-injection-spec
Are you sure you want to change the base?
server: make clients parse config TOMLs #810
Conversation
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!) |
360192d
to
986264a
Compare
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ComponentV0
s instead of an internal-to-Propolis-server ParsedConfig
type.
There was a problem hiding this 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!
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.
0ac3bf1
to
15ad57c
Compare
986264a
to
8c0f774
Compare
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).