haystack
haystack copied to clipboard
How to run REST-API in Windows-10, as Gunicorn is not supported by Windows?
Question I am unable to run this command "gunicorn rest_api.application:app -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker -t 300" beacuse it's Gunicorn is not available in windows.
Additional context I have seen some alternatives like waitress etc but I can't understand how to fine tune this command to waitress command. Anyone who can give alternative of this line for windows?
FAQ Check Yes done, but didn't find answer
Hi @ahsantfw You're right that Gunicorn is not available in windows. Our recommended way of deploying a Haystack API is to run the application as a Docker container. Have you seen our recent blog post on building a REST API for question answering? It describes in detail how to setup a Haystack REST API on an AWS EC2 instance (or other environments).
Yes, I had tried it first before implementing it locally. But It was not running, check issue "#1421". So I tried it, There are some alternatives of GUNICORN in windows like waitress ,NGINX etc., but I am unable to convert gunicorn command into one of windows compatible servers command. can somebody convert it "gunicorn rest_api.application:app -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker -t 300" to some other windows compatible servers like waitress or NGINX. waitress would be preferred.
Okay, I see. I am sure that @oryx1729 will be able to help with #1421 and maybe he can also have a quick look at Windows alternatives for gunicorn.
Hi @ahsantfw, you could test if Uvicorn is supported on Windows? You can install it by pip install Uvicorn
& run Haystack with uvicorn rest_api.application:app
.
@ahsantfw I don't know if this is still a problem for you, but I've found the best approach for doing this sort of development on Windows is to use WSL2 + Ubuntu. You can install it now from an administrator powershell with wsl --install
. Then you just work as if it was native Ubuntu (though it doesn't have systemd, so you can start docker with sudo service docker start
)
REST API have been migrated to Uvicorn: https://github.com/deepset-ai/haystack/pull/4304. Closing this thread,