dudarev / photoplanet

Project for learnpython.dn.ua
http://dudarev.github.io/photoplanet/
6 stars 7 forks source link

Add supervisor to ansible tasks #20

Open dudarev opened 9 years ago

eixin commented 9 years ago

Perhaps, it might make sense to use uwsgi Emperor mode instead (http://uwsgi-docs.readthedocs.org/en/latest/Emperor.html). This mode also facilitates multiple django applications on the same server, thus it might be useful anyway.

dudarev commented 9 years ago

I actually used emperor when I had donetskogram.com set up on Linode and it ran there together with another site. The doc I followed:

https://gist.github.com/dudarev/4348689

At the moment, I would not prioritize using emperor mode high. More important features for adminning:

Ideally deployment process I see as following: a single file with secrets, a single command that:

And everything runs after that single command. Less than 15 minutes are needed for the whole process. We are far from that and quite a few manual interactions are still needed.

There is also a possibility to add "Deploy on Heroku" button, their new feature.

But this is long term view. Concern of this ticket is just a supervisor that controls uwsgi processes.

eixin commented 9 years ago

Excuse me for being unclear: the Emperor mode implies this feature: site restarts after machine reboots or a process is terminated for some other reason, at least as I have seen in docs (see the link in my previous message). Surely, it needs to be added to RC, to start site on reboot. Did you have troubles with that while you were working on Linode? And if no, why would we need supervisor (another component) for doing the task which is performed by uwsgi itself?

dudarev commented 9 years ago

@eixin Yes, my bad. You are write. On Linode I had uwsgi with nginx approach as described in that link I gave above. Supervisor is typically used together with gunicorn and I had such configuration somewhere else.

Please, re-evaluate what should be done in this ticket in your opinion:

  1. adding emperor mode with adding it to RC or
  2. migrating to gunicorn and supervisor

I'm now more inclined to go with 1.

Based on your decision, rename the ticket accordingly.