diff --git a/src/bentoml/_internal/configuration/v1/__init__.py b/src/bentoml/_internal/configuration/v1/__init__.py index f1ca96e3e0c..8d8fca76fea 100644 --- a/src/bentoml/_internal/configuration/v1/__init__.py +++ b/src/bentoml/_internal/configuration/v1/__init__.py @@ -292,4 +292,14 @@ def migration(*, override_config: dict[str, t.Any]): current=f"{namespace}.timeout", replace_with=f"{namespace}.traffic.timeout", ) + for key in override_config: + if key.startswith("runners."): + runner_name = key.split(".")[1] + if any(key.schema == runner_name for key in _RUNNER_CONFIG): + continue + rename_fields( + override_config, + current=f"runners.{runner_name}.timeout", + replace_with=f"runners.{runner_name}.traffic.timeout", + ) return unflatten(override_config) diff --git a/tests/unit/_internal/configuration/test_containers.py b/tests/unit/_internal/configuration/test_containers.py index a448fad503b..2ac60c88d3f 100644 --- a/tests/unit/_internal/configuration/test_containers.py +++ b/tests/unit/_internal/configuration/test_containers.py @@ -152,9 +152,12 @@ def test_runner_timeouts(container_from_file: t.Callable[[str], ConfigDictType]) timeout: 100 test_runner_2: resources: system + test_runner_3: + timeout: 60 """ bentoml_cfg = container_from_file(RUNNER_TIMEOUTS) runner_cfg = bentoml_cfg["runners"] assert runner_cfg["traffic"]["timeout"] == 50 assert runner_cfg["test_runner_1"]["traffic"]["timeout"] == 100 assert runner_cfg["test_runner_2"]["traffic"]["timeout"] == 50 + assert runner_cfg["test_runner_3"]["traffic"]["timeout"] == 60