Skip to content
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

Major overhaul, current Errbit master, systemd + Puma #9

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

chewi
Copy link

@chewi chewi commented May 8, 2015

I present a general overhaul of the entire cookbook. It now works with current Errbit master (about to be v0.4.0) on CentOS 7.1 using systemd and Puma. It also still works on Ubuntu 12.04 using SysVinit and Unicorn. It includes the changes from #4 as I also wanted to use either rbenv or RVM. It supersedes #3 and #6.

I didn't change the Gemfile as cookbook developers are now expected to use ChefDK to install things like kitchen-vagrant. I didn't change the Vagrantfile either as Kitchen now provides a more convenient workflow. Feel free to delete these.

There are obviously a lot of changes to review here. If you're short on time then perhaps you should merge it anyway on the basis that your cookbook doesn't currently work at all with recent releases of Errbit or recent releases of Linux distributions.

Knowing where you are in the world though, I suspect you have much bigger things to worry about right now. I hope you're well and thank you for giving me a starting point. It saved a lot of time.

@chewi chewi force-pushed the master branch 2 times, most recently from 7d24225 to b770380 Compare May 13, 2015 16:41
chewi added 6 commits May 15, 2015 10:39
This seems to be the preferred method now and it is simpler. Change
defaults to be more or less in line with upstream. Properly generate a
random secret token. These changes are not really backwards compatible
but that wasn't likely to be an option anyway.
We don't require any additional gems during the compile phase so these
additional hacks are not necessary.
No need to manually specify the commands and subscriptions can be
defined in the same single block.
libxml2-dev and libxslt1-dev are installed by
rbenv. libcurl4-gnutls-dev doesn't seem to be required by anything. I
also think it's a little rude for every cookbook to call apt-get
update. ;)
chewi added 5 commits May 15, 2015 10:47
The old Puma recipe didn't look like it was finished. I needed systemd
support and Puma plays nicer with systemd (socket activation!) than
Unicorn does so I used the former. Non-systemd support for Puma and
systemd support for Unicorn would be nice but I don't have time. :(
Annoyingly we can't use rbenv_script for this, which means we have to
set HOME in the environment.
Like rake db:migrate, we cannot use rbenv_script here. Unfortunately
there appears to be no way of outputting the generated password, short
of running chef-client with :info log level.
chewi added 3 commits May 15, 2015 10:47
SELinux prevents this. We could change the context of the log
directory but it's easier to just move the logs. I think they should
go here anyway.
Other cookbooks don't include it and it interferes with Berkshelf.
The time between migrating and restarting should always be as short as
possible. Precompiling assets can take a while. This is how Capistrano
does it.
@chewi
Copy link
Author

chewi commented May 15, 2015

Sorry if you're getting spammed by rebases and additional commits, I've had to make a few adjustments after setting this up for real as opposed to just using Kitchen.

chewi added 2 commits May 18, 2015 10:57
I didn't realise that the opscode-centos box has SELinux effectively
disabled.
If you're proxying to nginx rather than connecting to it directly then
the port that nginx listens on may well be different to the port that
Errbit should advertise. In our case, we have Apache accepting SSL
connections that proxy to nginx without SSL. It would be nice if the
cookbook could configure nginx for SSL but I'll leave that to someone
else. :)
chewi added 11 commits July 27, 2015 10:31
Upstream says 2.3.0 is crashy. I've not seen that in other projects
but let's play it safe.
I wanted to force Node.js instead but this is trickier than you'd
think. Upstream also includes puma now but we'll continue to put that
in the UserGemfile in case unicorn is requested instead.
It's undergoing a rewrite for v3 that will probably break
things. Berkshelf otherwise selects 1.8.0 for some strange reason.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant