refactor: extract KVP into standalone libazureinit-kvp crate with layered architecture#287
Open
peytonr18 wants to merge 1 commit intoAzure:mainfrom
Open
refactor: extract KVP into standalone libazureinit-kvp crate with layered architecture#287peytonr18 wants to merge 1 commit intoAzure:mainfrom
libazureinit-kvp crate with layered architecture#287peytonr18 wants to merge 1 commit intoAzure:mainfrom
Conversation
773371a to
f7b1b98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts KVP into a standalone crate,
libazureinit-kvp, and replaces the legacylibazureinit::kvpmodule with a layered, trait-generic architecture.This keeps azure-init's tracing-based KVP emission behavior while making KVP reusable for external distros without pulling in the full azure-init stack.
libazureinit/src/kvp.rs(902 lines) with a new workspace crate:libazureinit-kvp.flock-guarded I/O.What Changed
New crate:
libazureinit-kvpIntroduces a 4-layer design plus top-level client wiring:
KvpStoretraitHyperVKvpStore(production pool-file implementation)InMemoryKvpStore(test double)DiagnosticsKvp<S>TracingKvpLayer<S>tracing_subscriber::Layeradapterhealth_reportpassthroughProvisioningReportPROVISIONING_REPORTKvp<S>client to wire all layers togetherLegacy module removed
libazureinit/src/kvp.rs; functionality now lives inlibazureinit-kvp.libazureinitintegration simplifiedlibazureinit/src/logging.rsJoinHandle,CancellationToken,halt(),close())setup_layersnow returns onlyBox<dyn Subscriber + Send + Sync>src/main.rsDependency updates
libazureinitdrops directfs2/sysinfousage for KVP internalslibazureinit-kvplibazureinit-kvpDocs
doc/kvp_design.md(design rationale + architecture)doc/libazurekvp.md(API/reference)ProvisioningReportAPIhealth_reportvaluesWhy
Behavioral Notes
flock+ write + unlock) rather than buffered async channel writes.health_reporttoPROVISIONING_REPORTpath preserves long values through chunked writes.Architecture
See
doc/kvp_design.mdfor design rationale anddoc/libazurekvp.mdfor API details.Fixes #239. Supersedes #286.