-
Notifications
You must be signed in to change notification settings - Fork 78
[RFC][monarch] Typed global configuration from python integrated with the Attrs system #1414
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
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
… the Attrs system This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
This was referenced Oct 3, 2025
samlurye
added a commit
that referenced
this pull request
Oct 3, 2025
… the Attrs system This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) ghstack-source-id: 313909164 Pull Request resolved: #1414
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 3, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) ghstack-source-id: 313935693
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 3, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` ghstack-source-id: 313996274 Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/)
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 3, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` ghstack-source-id: 314014793 Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/)
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 4, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` ghstack-source-id: 314061849 Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/)
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 4, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` ghstack-source-id: 314105483 Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/)
…grated with the Attrs system" This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/) [ghstack-poisoned]
samlurye
added a commit
that referenced
this pull request
Oct 4, 2025
…Attrs system Pull Request resolved: #1414 This diff introduces a typed global configuration system in python for monarch, integrated with the hyperactor `Attrs` system and the `hyperactor::global::config` module. To make an attribute configurable via python, first add the meta attribute `PYTHON_CONFIG_KEY`, like so: ``` @meta( CONFIG_ENV_VAR = "HYPERACTOR_MESH_DEFAULT_TRANSPORT".to_string(), PYTHON_CONFIG_KEY = "default_transport".to_string(), ) pub attr DEFAULT_TRANSPORT: ChannelTransport = ChannelTransport::Unix; ``` This makes it so that the `DEFAULT_TRANSPORT` attr can be configured using `monarch.configure(default_transport=...)`. In order to ensure that attrs with type `ChannelTransport` can be configured by passing `PyChannelTransport` values to `monarch.configure`, in `monarch_hyperactor/src/config.rs`, add the macro invocation: ``` declare_py_config_type!(PyChannelTransport as ChannelTransport); ``` For attrs with rust types that can be passed directly to and from python (like `String`), simply add: ``` declare_py_config_type!(String); ``` These macro invocations only need to be added once per unique attr type we want to support -- *not* once per actual attr. From python, the `DEFAULT_TRANSPORT` attr is then configurable in the global config by calling ``` monarch._rust_bindings.monarch_hyperactor.config.configure( default_transport=ChannelTransport.MetaTlsWithHostname, ... ) ``` You can then get the currently configured values with ``` monarch._rust_bindings.monarch_hyperactor.config.get_configuration() ``` which returns ``` { "default_transport": ChannelTransport.MetaTlsWithHostname, ... } ``` ghstack-source-id: 314105606 Differential Revision: [D83701581](https://our.internmc.facebook.com/intern/diff/D83701581/)
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.
Stack from ghstack (oldest at bottom):
This diff is an RFC for introducing a typed global configuration system in python for monarch, integrated with the hyperactor
Attrs
system and thehyperactor::global::config
module. To make an attribute configurable via python, first add the meta attributePYTHON_CONFIG_KEY
, like so:This makes it so that the
DEFAULT_TRANSPORT
attr can be configured usingmonarch.configure(default_transport=...)
. In order to ensure that attrs with typeChannelTransport
can be configured by passingPyChannelTransport
values tomonarch.configure
, inmonarch_hyperactor/src/config.rs
, add the macro invocation:For attrs with rust types that can be passed directly to and from python (like
String
), simply add:These macro invocations only need to be added once per unique attr type we want to support -- not once per actual attr.
From python, the
DEFAULT_TRANSPORT
attr is then configurable in the global config by callingYou can then get the currently configured values with
which returns
Differential Revision: D83701581