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

Option to disable swagger UI #1167

Closed
shihgianlee opened this issue Oct 10, 2020 · 4 comments
Closed

Option to disable swagger UI #1167

shihgianlee opened this issue Oct 10, 2020 · 4 comments
Labels
good-first-issue Good for newcomers

Comments

@shihgianlee
Copy link

Is your feature request related to a problem? Please describe.
We would like to have an option to disable Swagger UI in production for select model services.

Describe the solution you'd like
A configuration option to disable Swagger UI.

Describe alternatives you've considered
None

Additional context
None

@parano parano added the good-first-issue Good for newcomers label Oct 20, 2020
@liusy182
Copy link
Contributor

liusy182 commented Nov 8, 2020

My understanding is that, this involves adding a config to turn off swagger when the deployment mode is production.
Since the deployment options vary across platforms, e.g. aws uses bentoml cli, kubernetes uses the yaml, what should the generic solution to this problem?

@parano
Copy link
Member

parano commented Nov 9, 2020

@liusy182 I think first you can make this an option in the API Server class: https://github.com/bentoml/BentoML/blob/v0.9.2/bentoml/server/api_server.py#L96

And then add it as a CLI option for bentoml server and bentoml serve-gunicorn. There's no need to worry about the other deployment platforms(AWS sagemaker, AWS Lambda, Azure Fucntions) for now.

@liusy182
Copy link
Contributor

thanks! I will be taking a look of this item.

@ethagnawl
Copy link

I might be missing something very obvious, but is it possible to disable Swagger via an env var? The only option I see in the PR is BENTOML_ENABLE_SWAGGER. Is the expectation that you'd provide 0/1, "t"/"f" or similar as that environment variable's value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants