-
Notifications
You must be signed in to change notification settings - Fork 20
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
chewi
wants to merge
42
commits into
millisami:master
Choose a base branch
from
yakara-ltd:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shamelessly stolen from GitLab https://github.com/gitlabhq/gitlabhq/blob/master/lib/support/init.d/gitlab
Setting in the global profile is not necessary anymore
errbit now requires one but doesn't include it in the Gemfile because which one you need depends on which Ruby implementation you are using.
This negates the need for a symlink to shared. Using deployment mode probably won't work anyway because Gemfile.lock won't be up to date after adding a JavaScript interpreter.
chewi
force-pushed
the
master
branch
2 times, most recently
from
May 13, 2015 16:41
7d24225
to
b770380
Compare
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. ;)
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.
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.
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. |
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. :)
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.