Bentoml: [DOCS] how to configure BentoML (via config file, CLI arg and env var)

Created on 17 May 2020  路  3Comments  路  Source: bentoml/BentoML

Is your feature request related to a problem? Please describe.
Document how BentoML is configured and some of the most useful configurations.

All configs and their default values can be found in this file: https://github.com/bentoml/BentoML/blob/master/bentoml/configuration/default_bentoml.cfg

Configs have multiple sections, e.g. "core", "logging", "instrument", "yatai_service" etc. BentoML is using a hierarchical configuration module built based on the Python configparser module.

Configs can be set in a few different ways.

1) change config for "this machine", this can be used for your development machine, and it will remember your settings on a local file, ~/bentoml/bentoml.cfg by default. e.g.:

# for "core" section:
bentoml config set usage_tracking=false

# for "yatai_service" section:
bentoml config set yatai_service.url=127.0.0.1:50051
  1. If you only need to set the config one time for a single python session, without persisting the config to local file, set the config via bentoml.config in python:
import bentoml
bentoml.config().set('core', 'usage_tracking', 'False')
bentoml.config().set('yatai_service', 'url', '127.0.0.1:50051')
  1. Or set it via environment variable if you are using BentoML cli commands or don't want to change the python code, e.g.:
 $ BENTOML__YATAI_SERVICE__URL=127.0.0.1:50051 python guides/quick-start/main.py

 $ BENTOML__YATAI_SERVICE__URL=127.0.0.1:50051 bentoml get IrisClassifier:latest

Describe the solution you'd like
Document the above in more details and add to docs page

Describe alternatives you've considered
n/a

Additional context
n/a

documentation help wanted

All 3 comments

@parano - I along with @kishore-ganesh and https://github.com/CallmeMehdi are almost done with this. We can draft a PR in a day or two.

Sounds good, thanks @pncnmnp @kishore-ganesh

@parano
In this issue, you have mentioned -

Document ..... some of the most useful configurations.

Can you specify the configurations you want us to cover from default_bentoml.cfg?

Was this page helpful?
0 / 5 - 0 ratings