-
Notifications
You must be signed in to change notification settings - Fork 78
: config: switch global config to layered sources scheme #1409
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
Closed
shayne-fletcher
wants to merge
1
commit into
meta-pytorch:main
from
shayne-fletcher:export-D83778023
Closed
: config: switch global config to layered sources scheme #1409
shayne-fletcher
wants to merge
1
commit into
meta-pytorch:main
from
shayne-fletcher:export-D83778023
Conversation
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
@shayne-fletcher has exported this pull request. If you are a Meta employee, you can view the originating Diff in D83778023. |
Summary: replaces abandoned D83683389 "base64 JSON snapshot + freeze" approach with a layered config model end-to-end, and wires `bootstrap` to pass real `Attrs` directly. `hyperactor::config::global` now resolves via layers: `TestOverride` → `Runtime` → `Env` → `File` → `Default`. Reads (`global::get`, `get_cloned`) walk layers in that order; `global::attrs()` returns a complete, materialized snapshot (defaults included, meta-only keys omitted unless explicitly set). the layered store is `LAYERS`, seeded with an `Env` layer at startup. `global::set(Source, Attrs)` inserts/replaces a layer and re-sorts by priority; `reset_to_defaults()` clears all explicit layers. test overrides are implemented as a single `TestOverride` layer that is created on demand under `ConfigLock`, with env-var mirroring only in tests and restored on `drop`. `Bootstrap` now carries `Option<Attrs>` in `Bootstrap::{Proc,Host}.config`. if present, the child installs it as the `Runtime` layer (`global::set(Source::Runtime, …)`), so the parent's effective config wins over `Env`/`File`/`Default` in the child. if absent, the child uses `Env`/`Default` as before. no base64, no freezing. minor attrs API addition: `Attrs::get_value_by_name` (internal) to support merging. tests cover layer precedence (`Env` over `File`; `Runtime` over `Env`/`File`; clearing `Runtime` reveals lower layers), snapshot materialization (defaults included, meta omitted), parent->child snapshot as `Runtime`, `TestOverride` behavior with env-var mirroring and restoration, and parity between `get` and `get_cloned`. Reviewed By: mariusae Differential Revision: D83778023
0175430
to
9ea2517
Compare
shayne-fletcher
added a commit
to shayne-fletcher/monarch-1
that referenced
this pull request
Oct 3, 2025
…h#1409) Summary: replaces abandoned D83683389 "base64 JSON snapshot + freeze" approach with a layered config model end-to-end, and wires `bootstrap` to pass real `Attrs` directly. `hyperactor::config::global` now resolves via layers: `TestOverride` → `Runtime` → `Env` → `File` → `Default`. Reads (`global::get`, `get_cloned`) walk layers in that order; `global::attrs()` returns a complete, materialized snapshot (defaults included, meta-only keys omitted unless explicitly set). the layered store is `LAYERS`, seeded with an `Env` layer at startup. `global::set(Source, Attrs)` inserts/replaces a layer and re-sorts by priority; `reset_to_defaults()` clears all explicit layers. test overrides are implemented as a single `TestOverride` layer that is created on demand under `ConfigLock`, with env-var mirroring only in tests and restored on `drop`. `Bootstrap` now carries `Option<Attrs>` in `Bootstrap::{Proc,Host}.config`. if present, the child installs it as the `Runtime` layer (`global::set(Source::Runtime, …)`), so the parent's effective config wins over `Env`/`File`/`Default` in the child. if absent, the child uses `Env`/`Default` as before. no base64, no freezing. minor attrs API addition: `Attrs::get_value_by_name` (internal) to support merging. tests cover layer precedence (`Env` over `File`; `Runtime` over `Env`/`File`; clearing `Runtime` reveals lower layers), snapshot materialization (defaults included, meta omitted), parent->child snapshot as `Runtime`, `TestOverride` behavior with env-var mirroring and restoration, and parity between `get` and `get_cloned`. Reviewed By: mariusae Differential Revision: D83778023
shayne-fletcher
added a commit
to shayne-fletcher/monarch-1
that referenced
this pull request
Oct 3, 2025
…h#1409) Summary: replaces abandoned D83683389 "base64 JSON snapshot + freeze" approach with a layered config model end-to-end, and wires `bootstrap` to pass real `Attrs` directly. `hyperactor::config::global` now resolves via layers: `TestOverride` → `Runtime` → `Env` → `File` → `Default`. Reads (`global::get`, `get_cloned`) walk layers in that order; `global::attrs()` returns a complete, materialized snapshot (defaults included, meta-only keys omitted unless explicitly set). the layered store is `LAYERS`, seeded with an `Env` layer at startup. `global::set(Source, Attrs)` inserts/replaces a layer and re-sorts by priority; `reset_to_defaults()` clears all explicit layers. test overrides are implemented as a single `TestOverride` layer that is created on demand under `ConfigLock`, with env-var mirroring only in tests and restored on `drop`. `Bootstrap` now carries `Option<Attrs>` in `Bootstrap::{Proc,Host}.config`. if present, the child installs it as the `Runtime` layer (`global::set(Source::Runtime, …)`), so the parent's effective config wins over `Env`/`File`/`Default` in the child. if absent, the child uses `Env`/`Default` as before. no base64, no freezing. minor attrs API addition: `Attrs::get_value_by_name` (internal) to support merging. tests cover layer precedence (`Env` over `File`; `Runtime` over `Env`/`File`; clearing `Runtime` reveals lower layers), snapshot materialization (defaults included, meta omitted), parent->child snapshot as `Runtime`, `TestOverride` behavior with env-var mirroring and restoration, and parity between `get` and `get_cloned`. Reviewed By: mariusae Differential Revision: D83778023
This pull request has been merged in 49612c4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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: replaces abandoned D83683389
Differential Revision: D83778023