4

I want to use supervisor to run celery in production, but I am using python 3 instead of python 2. Is there a supervisor that supports python 3?

Also, is it possible to use python 2 to run supervisor for my python 3 code for celery?

PiccolMan
  • 4,854
  • 12
  • 35
  • 53
  • You could consider installing Python 2 and 3 alongside each other to let supervisor start / manage applications written in Python 3. It's not ideal but may be the best solution. – Simeon Visser Aug 29 '15 at 20:22

1 Answers1

12

supervisord is just process manager, fact that itself uses python2 does not mean it can't run python3 application.

Just put your application in virtualenv created with python3.

$ virtualenv -p python3 myvenv

Activate that environment and install your app into it with celery as well. And in supervisor you will use full path to celery from inside that virtualenv.

e.g. I created my python3 virtualenv in /home/beezz/myvenv then celery will be located at /home/beezz/myenv/bin/celery

And here is virtualenv's documentation. In general it's good practice to keep applications in separate virtual environments.

If you are not tied to supervisord somehow, circus is also nice process manager with some cool features and it's python3 ready.

beezz
  • 2,398
  • 19
  • 15
  • 1
    For anyone looking to use circus check this out http://aameer.github.io/circus-as-an-alternative-to-supervisor/ – Aameer Apr 01 '16 at 17:41
  • 1
    supervisor docs states that it will NOT run under python3 though! http://supervisord.org/introduction.html#platform-requirements – Meitham Feb 17 '17 at 11:46
  • 1
    They've change their mind, and are implementing python3 support https://github.com/Supervisor/supervisor#supported-platforms – rlaverde Apr 27 '17 at 17:32
  • why not https://github.com/just-containers/s6-overlay? – Daviddd Nov 29 '17 at 09:39