MLServer icon indicating copy to clipboard operation
MLServer copied to clipboard

"Maximum batch size" and "Maximum batch time" are not overwritten through env variables

Open saeid93 opened this issue 3 years ago • 3 comments
trafficstars

if the two variable max_batch_time and max_batch_size are defined in the model-settings.json:

{
    "name": "node-1",
    "implementation": "models.NodeOne",
    "max_batch_size": 5,
    "max_batch_time": 1,
    "parameters": {
        "uri": "./fakeuri"
    }
}

Then they couldn't be overwritten by environment variables MLSERVER_MODEL_MAX_BATCH_SIZE and MLSERVER_MODEL_MAX_BATCH_TIME and mlserver will always revert back to the values set in the model-settings.json. However, it is expected to use the values in the json as defaults and env variable as user arguments for overwriting them.

saeid93 avatar Sep 10 '22 22:09 saeid93

Hey @saeid93 ,

Yeah, it's a known issue that, when using mlserver build, local setting files override environment variables. This is due to how they get injected during the container's startup (which is essentially by injecting them as env vars as well).

Having said that, there wasn't an issue for that yet, so thanks for opening one!

adriangonz avatar Sep 12 '22 09:09 adriangonz

Hey @adriangonz,

Sure, no problem. Since the setting.json is also injected by env vars why the same env var is not used for the initialization as well? so it will be overwritten by the user-defined var?

saeid93 avatar Sep 12 '22 15:09 saeid93

Hey @saeid93 ,

When you build a custom image and it has a settings.json present, the same issue should occur. As in, the values set up on that local settings.json will get injected through env vars, overriding whatever else comes from upstream.

adriangonz avatar Sep 13 '22 08:09 adriangonz