-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fabric enhancements #1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fabric enhancements #1216
Conversation
|
Though I don't use the fabfile (I like uWSGI) it's fantastic to see this getting attention. Good job Eduardo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this hard-coded? I think the common case would be to leverage the number of cores on the machine. Perhaps we can have it default to that, and overideable via a setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience you usually have access to 8 or 16 cores but as little as 512Mb or 1Gb of RAM in a VPS. When running multiple sites you end up with a bunch of workers that eat up your memory. However, single sites probably don't have this problem. I'll add the setting as you suggest as it seems a nice compromise.
|
Looks good overall, I just left some questions inline. Once we're happy with everything, can we squash this all into one commit? All the commits listed above will end up in the changelog otherwise. Thanks a lot Ed! |
|
Thanks for the feedback, Steve. I'll go over all your points and make some
tweaks later this week (hopefully).
|
|
Oh, and yes, I'll squash the commits into one when we're done. What would you like it to say? |
|
Thanks for all the answers Ed, they all make sense. As for the commit message, just a brief description of the enhancements I guess. |
|
Okay, I addressed all concerns and ended up removing a good deal of unnecessary changes/additions, so thanks for the sharp eye, Steve. Let me know if we're good to go and I'll squash all the commits. |
|
Also, let me know if you'd like me to update the docs. As I see it, all that needs to be done is update the settings code block and Fabric tasks descriptions. I would also like to propose we include a mini "tutorial", because the current reference might not be enough for complete newcomers. I was thinking on something like this. |
|
Thanks Ed. The mini tutorial is a great idea - many people have complained about the lack of docs on using the built-in fabfile. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user doesn't specify a number in this setting, it'll default to the recommended cores*2+1. You can see it gets injected in the right place in gunicorn_conf.py.template.
0f5b59f to
1e7b9ed
Compare
Now specifically designed to host multiple sites in a server. See stephenmcd#1216.
|
Ok I squashed the commits and left only two: one mentioning the fabfile changes and the other one mentioning the doc changes. I had to pull from master and I'm not sure of how to squash that last commit, so any pointers are appreciated. |
|
Thanks Ed! I use mercurial for everything (which gets mirrored via git on here) so I can't really help there. One extraneous commit message isn't too big a deal though. |
|
I think you should rebase master in your branch to have your commits on top
and then:
git commit --amend
To add your last change to the last commit
|
Now specifically designed to host multiple sites in a server. See stephenmcd#1216.
1979f8e to
081dd68
Compare
|
Thanks Federico. Rebasing instead of merging was the solution. Now we have a squeaky clean commit history. |
|
All merged - thanks again Ed for the huge effort. |
My overall goal with this PR is to help developers with none or minimal sys-admin knowledge get Mezzanine sites deployed following best practices. I've tested all new features and made sure existing ones were not broken.
Enhancements over the current fabfile:
gunicornis used instead of the the deprecatedgunicorn_django.rsyncinstead ofgitorhg(in case your project is not under VCS).sudoonly require you to type the password once.ALLOWED_HOSTS) are blocked on Nginx level.local_settings.pyfor security concerns (they shouldn't be tracked by VCS) and to make sureSECRET_KEYandNEVERCACHE_KEYare in scope.