Skip to content

Conversation

shayne-fletcher
Copy link
Contributor

Summary: replaces abandoned D83683389

Differential Revision: D83778023

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 2, 2025
Copy link

meta-codesync bot commented Oct 2, 2025

@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
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
@meta-codesync meta-codesync bot closed this in 49612c4 Oct 4, 2025
@facebook-github-bot
Copy link
Contributor

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
CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged meta-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants