faust icon indicating copy to clipboard operation
faust copied to clipboard

Deploying Faust applications via Circus or Supervisord, not possible due to lack of web fd support?

Open fgimian opened this issue 5 years ago • 0 comments

Hey there guys, great job on the fork.

The Faust docs do reference tools like Circus and Supervisord for use when running in production. If we wish to fire off multiple Faust workers from a single Circus config, we encounter a problem.

Let's take an example Circus config:

[watcher:processor]
cmd = faust -A boo --datadir=/data/worker$(circus.wid) worker -l info --web-transport=unix://...
numprocesses = 2
copy_env = True
use_sockets = True

[socket:web]
host = 127.0.0.1
port = 8888

Circus makes available Unix sockets for use by child applications by opening a Unix socket and presenting the file descriptor (an integer) to be used. However, Faust only seems to support specifying the full path to a Unix socket file which won't work.

Other web servers like Uvicorn allow passing an fd like so:

[watcher:web]
cmd = uvicorn --fd $(circus.sockets.web) example:App
numprocesses = 4
use_sockets = True
copy_env = True

[socket:web]
host = 0.0.0.0
port = 8888

Is it possible to support use of a file descriptor in Faust or alternatively, is there another way that this can be made to work with Circus or Supervisor when running multiple workers?

Thanks a lot Fotis

fgimian avatar Dec 14 '20 03:12 fgimian