Nitin Bansal
02/24/2022, 5:31 AMAnna Geller
02/24/2022, 9:41 AMNitin Bansal
02/24/2022, 11:28 PMAnna Geller
02/25/2022, 10:33 AMsudo
is the culprit. I learned just yesterday that if you're running this with sudo, you’re accessing a different Prefect home directory with different settings.
I think what may help here is when you create a virtual environment (e.g. with Conda) and when you don't run the supervisord in /etc
but rather in some normal home directory. E.g. I have a project in ~/repos/myproject
and within this directory I created a file called supervisord.conf
that looks as follows:
[unix_http_server]
file=/tmp/supervisor.sock ; the path to the socket file
[supervisord]
loglevel=debug ; log level; default info; others: debug,warn,trace
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
[program:prefect-agent]
command=/Users/anna/opt/anaconda3/envs/myCondaVenv/bin/prefect agent docker start --key KEY -l docker
Beforehand, I created a conda env myCondaVenv
as referenced above. Then, since this is all in my project dir (rather than /etc) I can execute the supervisor process without sudo:
supervisord -c ./supervisord.conf
Let me know if you can replicate this setup.