Skip to content
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

fix(cli): helper message default values #2943

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

ssheng
Copy link
Collaborator

@ssheng ssheng commented Aug 26, 2022

What does this PR address?

Default value in help text is outputting incorrect value from config.

Before:

Options:
  --production                 Run the BentoServer in production mode
  --port INTEGER               The port to listen on for the REST api server  [default: <bound method
                               _ConfigurationItem.get of _ConfigurationItem(_config={'api_server': {'port': 3000,
                               'host': '0.0.0.0', 'backlog': 2048, 'workers': 1, 'timeout': 60, 'max_request_size':
                               20971520, 'metrics': {'enabled': True, 'namespace': 'BENTOML'}, 'logging': {'access':
                               {'enabled': True, 'request_content_length': True, 'request_content_type': True,
                               'response_content_length': True, 'response_content_type': True}}, 'cors': {'enabled':
                               False, 'access_control_allow_origin': None, 'access_control_allow_credentials': None,
                               'access_control_allow_methods': None, 'access_control_allow_headers': None,
                               'access_control_max_age': None, 'access_control_expose_headers': None}}, 'runners':
                               {'batching': {'enabled': True, 'max_batch_size': 100, 'max_latency_ms': 10000},
                               'resources': None, 'logging': {'access': {'enabled': True, 'request_content_length':
                               True, 'request_content_type': True, 'response_content_length': True,
                               'response_content_type': True}}, 'timeout': 300}, 'tracing': {'type': 'zipkin',
                               'sample_rate': None, 'excluded_urls': None, 'zipkin': {'url': None}, 'jaeger':
                               {'address': None, 'port': None}, 'otlp': {'protocol': None, 'url': None}}},
                               _path=('api_server', 'port'))>]
  --host TEXT                  The host to bind for the REST api server [defaults: 127.0.0.1(dev),
                               0.0.0.0(production)]
  --api-workers INTEGER        Specify the number of API server workers to start. Default to number of available CPU
                               cores in production mode
  --backlog INTEGER            The maximum number of pending connections.  [default: <bound method
                               _ConfigurationItem.get of _ConfigurationItem(_config={'api_server': {'port': 3000,
                               'host': '0.0.0.0', 'backlog': 2048, 'workers': 1, 'timeout': 60, 'max_request_size':
                               20971520, 'metrics': {'enabled': True, 'namespace': 'BENTOML'}, 'logging': {'access':
                               {'enabled': True, 'request_content_length': True, 'request_content_type': True,
                               'response_content_length': True, 'response_content_type': True}}, 'cors': {'enabled':
                               False, 'access_control_allow_origin': None, 'access_control_allow_credentials': None,
                               'access_control_allow_methods': None, 'access_control_allow_headers': None,
                               'access_control_max_age': None, 'access_control_expose_headers': None}}, 'runners':
                               {'batching': {'enabled': True, 'max_batch_size': 100, 'max_latency_ms': 10000},
                               'resources': None, 'logging': {'access': {'enabled': True, 'request_content_length':
                               True, 'request_content_type': True, 'response_content_length': True,
                               'response_content_type': True}}, 'timeout': 300}, 'tracing': {'type': 'zipkin',
                               'sample_rate': None, 'excluded_urls': None, 'zipkin': {'url': None}, 'jaeger':
                               {'address': None, 'port': None}, 'otlp': {'protocol': None, 'url': None}}},
                               _path=('api_server', 'backlog'))>]
  --reload                     Reload Service when code changes detected, this is only available in development mode
  --working-dir PATH           When loading from source code, specify the directory to find the Service instance
                               [default: .]
  --ssl-certfile TEXT          SSL certificate file
  --ssl-keyfile TEXT           SSL key file
  --ssl-keyfile-password TEXT  SSL keyfile password
  --ssl-version INTEGER        SSL version to use (see stdlib 'ssl' module)
  --ssl-cert-reqs INTEGER      Whether client certificate is required (see stdlib 'ssl' module)
  --ssl-ca-certs TEXT          CA certificates file
  --ssl-ciphers TEXT           Ciphers to use (see stdlib 'ssl' module)
  -q, --quiet                  Suppress all warnings and info logs
  --verbose, --debug           Generate debug information
  --do-not-track               Do not send usage info
  -h, --help                   Show this message and exit.

After:

Options:
  --production                 Run the BentoServer in production mode
  --port INTEGER               The port to listen on for the REST api server  [default: 3000]
  --host TEXT                  The host to bind for the REST api server [defaults: 127.0.0.1(dev),
                               0.0.0.0(production)]
  --api-workers INTEGER        Specify the number of API server workers to start. Default to number of available CPU
                               cores in production mode
  --backlog INTEGER            The maximum number of pending connections.  [default: 2048]
  --reload                     Reload Service when code changes detected, this is only available in development mode
  --working-dir PATH           When loading from source code, specify the directory to find the Service instance
                               [default: .]
  --ssl-certfile TEXT          SSL certificate file
  --ssl-keyfile TEXT           SSL key file
  --ssl-keyfile-password TEXT  SSL keyfile password
  --ssl-version INTEGER        SSL version to use (see stdlib 'ssl' module)
  --ssl-cert-reqs INTEGER      Whether client certificate is required (see stdlib 'ssl' module)
  --ssl-ca-certs TEXT          CA certificates file
  --ssl-ciphers TEXT           Ciphers to use (see stdlib 'ssl' module)
  -q, --quiet                  Suppress all warnings and info logs
  --verbose, --debug           Generate debug information
  --do-not-track               Do not send usage info
  -h, --help                   Show this message and exit.

Before submitting:

Who can help review?

Feel free to tag members/contributors who can help review your PR.

@ssheng ssheng requested a review from a team as a code owner August 26, 2022 04:29
@ssheng ssheng requested review from parano and removed request for a team August 26, 2022 04:29
@ssheng ssheng added this to the 1.0.4 milestone Aug 26, 2022
@bojiang bojiang requested review from bojiang and removed request for parano August 26, 2022 04:31
@aarnphm aarnphm changed the title fix: CLI helper message default values fix(cli): helper message default values Aug 26, 2022
@aarnphm aarnphm merged commit 102be0f into bentoml:main Aug 26, 2022
@ssheng ssheng deleted the cli-help-default branch August 26, 2022 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants