nemo_gym.server_utils#
Module Contents#
Classes#
All instances of BaseServer are queryable using ServerClient. |
|
Functions#
Initialize ray cluster in a process.
We store the Ray address in the global config dict so that child processes can connect to it.
This avoids the need to start a new Ray cluster in each child process.
Note: This function will modify the global config dict - update |
Data#
API#
- nemo_gym.server_utils._GLOBAL_AIOHTTP_CLIENT: Union[None, aiohttp.ClientSession]#
None
- nemo_gym.server_utils._GLOBAL_AIOHTTP_CLIENT_REQUEST_DEBUG: bool#
False
- class nemo_gym.server_utils.GlobalAIOHTTPAsyncClientConfig(/, **data: typing.Any)[source]#
Bases:
pydantic.BaseModel- global_aiohttp_connector_limit: int#
None
- global_aiohttp_connector_limit_per_host: int#
1024
- global_aiohttp_client_request_debug: bool#
False
- nemo_gym.server_utils.get_global_aiohttp_client(
- global_config_dict_parser_config: Optional[nemo_gym.global_config.GlobalConfigDictParserConfig] = None,
- global_config_dict_parser_cls: Type[nemo_gym.global_config.GlobalConfigDictParser] = GlobalConfigDictParser,
- nemo_gym.server_utils.MAX_NUM_TRIES#
3
- async nemo_gym.server_utils.request(
- method: str,
- url: str,
- _internal: bool = False,
- **kwargs: Unpack[aiohttp.client._RequestOptions],
- nemo_gym.server_utils.DEFAULT_HEAD_SERVER_PORT#
11000
- nemo_gym.server_utils.ServerStatus#
None
- class nemo_gym.server_utils.ServerClient(/, **data: typing.Any)[source]#
Bases:
pydantic.BaseModel- head_server_config: nemo_gym.config_types.BaseServerConfig#
None
- global_config_dict: omegaconf.DictConfig#
None
- model_config#
‘ConfigDict(…)’
- classmethod load_head_server_config() nemo_gym.config_types.BaseServerConfig[source]#
- classmethod load_from_global_config(
- head_server_config: Optional[nemo_gym.config_types.BaseServerConfig] = None,
- async request(
- server_name: str,
- url_path: str,
- method: str,
- **kwargs: Unpack[aiohttp.client._RequestOptions],
- async get(
- server_name: str,
- url_path: str,
- **kwargs: Unpack[aiohttp.client._RequestOptions],
- Parameters:
server_name – str The name of the server you are trying to call.
url_path – str The URL path in the server you are trying to call e.g. “/v1/responses”.
- nemo_gym.server_utils.SESSION_ID_KEY#
‘session_id’
- class nemo_gym.server_utils.BaseServer(/, **data: typing.Any)[source]#
Bases:
pydantic.BaseModelAll instances of BaseServer are queryable using ServerClient.
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- config: nemo_gym.config_types.BaseRunServerInstanceConfig#
None
- classmethod load_config_from_global_config() nemo_gym.config_types.BaseRunServerInstanceConfig[source]#
- class nemo_gym.server_utils.ProfilingMiddlewareInputConfig(/, **data: typing.Any)[source]#
Bases:
pydantic.BaseModel- profiling_results_dirpath: Optional[str]#
None
- class nemo_gym.server_utils.ProfilingMiddlewareConfig(/, **data: typing.Any)[source]#
Bases:
nemo_gym.server_utils.ProfilingMiddlewareInputConfig- profiling_enabled: bool#
False
- class nemo_gym.server_utils.UvicornLoggingConfig(/, **data: typing.Any)[source]#
Bases:
pydantic.BaseModel- uvicorn_logging_show_200_ok: bool#
False
- nemo_gym.server_utils.initialize_ray() None[source]#
Initialize ray cluster in a process. We store the Ray address in the global config dict so that child processes can connect to it. This avoids the need to start a new Ray cluster in each child process. Note: This function will modify the global config dict - update
ray_head_node_address
- class nemo_gym.server_utils.SimpleServer(/, **data: typing.Any)[source]#
Bases:
nemo_gym.server_utils.BaseServer- server_client: nemo_gym.server_utils.ServerClient#
None
- setup_profiling(
- app: fastapi.FastAPI,
- profiling_config: nemo_gym.server_utils.ProfilingMiddlewareConfig,
- class nemo_gym.server_utils.HeadServer(/, **data: typing.Any)[source]#
Bases:
nemo_gym.server_utils.BaseServer- config: nemo_gym.config_types.BaseServerConfig#
None