-
Notifications
You must be signed in to change notification settings - Fork 76
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
Using rbenv instead of system ruby #114
Conversation
Conflicts: Modulefile manifests/install.pp
Two comments,
|
Good comments, it's not quite finished it. It works so far, if I get it tested, documented, and cleaned up, would it be of interest to replace puppetlabs/ruby in gitlab-requirements? |
A couple of thoughts/questions:
|
Which is fair enough, but the nice thing is that it's restricted to the GitLab user, and ensures the use of a working Ruby. So it manages Ruby, but for only the specific user, meaning system Ruby / rvm / rbenv for other users aren't needed. I could setup up a $manage_ruby switch pretty easily, to turn on/off rbenv. GitLab is working totally as expected with rbenv for me. I didn't read anything in the literature against using it, and a cursory Google search only revealed someone's frustrations (the fix being sourcing rvbenv in .bashrc for ssh, which this does). |
IMO, rbenv + path, is way saner than RVM. |
@atomaka Ah! This document does indeed say:
However, those hard-to-diagnose problems are probably caused by non-"global" installation. I've setup rbenv to install for the GitLab user "globally", so as far as the user is aware, the rbenv Ruby is the only Ruby. I'm running in production with no problems. The only other gotcha was an ssh session for the GitLab user, but it was fixed by setting .bashrc as the file to source for Rbenv (perhaps a better fix would be to set it in ~/.ssh/environment). GitLab uses scripts which have a shebang of Anyway, more testing is always better, but I think this works cleaner than interfering with system Ruby. |
@atomaka I'm glad it's actually being seriously considered. GitLab is fantastic, and I've been running a while now without a hitch. When school winds down I can fix the tests. |
I've been contemplating Brightbox' ruby for Ubuntu now for quite some time. It's compatible with Ubuntu's Ruby, but comes with sane versions. The problem of course in our setup comes when we have to install specific gems: Brightbox' ruby (which ever version we use) would have to be made the system default… |
I'm 👍 on this. This greatly simplifies life for those stuck with RHEL/CentOS. Changing the system ruby in RHEL can be quite painful and problematic. |
I'd have thought this should only be contemplated if there's also a suitable proposal on how to maintain security updates for the ruby version and ruby libraries that get installed this way. |
rbenv::compile { 'gitlab/2.0.0-p353': | ||
user => $git_user, | ||
home => $git_home, | ||
ruby => '2.0.0-p353', |
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.
This is already outdated…
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.
We could parameterize it for easy updating; however, it's a strong point of Puppet to be explicit about version updates. Might be slower, but it means everything gets tested first.
I'll be testing and updating it soon.
+1 |
Heh, I've been reading the discussion as it comes into my inbox, but haven't had much in the way of input. I'm still running my GitLab instance pretty flawlessly with my fork. Anyway: the Just a thought. |
Conflicts: manifests/params.pp
Hey, I merged the latest master branch in and parameterized Ruby, setting its default to 2.1.1 (per the cookbook. Ran a clean provision on a Vagrant box and tested it out, all working with Gitlab 6.8.1, gitlab-shell 1.9.3, Ubuntu 12.04.4, Puppet 3.4.3 (haven't updated it to 3.5 yet but should be okay). |
I need to figure out what tests to update to get this passing. |
@andschwa Yep, it would be nice! |
@sbadia Dude actually that would be great, as it's been a while since I've written Puppet tests. |
If you want to use the latest Ruby version, you may have to manually update the |
And at least a bit of test coverage now exists. |
Ugh, okay apparently older versions of Ruby have a syntax error with the tests I added. Did I mention I really don't know Ruby tests? |
We could also add 2.1.1, 2.1.0, etc.
These fail for reasons beyond our control (as far as I can tell)
And all passing! Woot woot. Turning in for the night. |
Any update on this? - It'd be really nice to be able to deploy Gitlab 7 |
@sammcj We have the tests passing now, with coverage of rbenv as well. I've tested it from scratch on Ubuntu 14.04, and use it in "production" (I'm the only user) on Ubuntu 12.04. More testing is always better, but I'm satisfied. |
You know, one thing we may want is a parameter |
I'm assuming most people are moving to https://github.com/spuder/puppet-gitlab because of this. |
@sammcj I hadn't seen that project yet, looks interesting. By "this" do you mean it not being merged? I would if I could, but am not a maintainer. We'd need a new major release for sure, but that's fine. |
Spuder's module does not appear to take care of the Ruby environment whatsoever, which is a necessity because many distributions lack the required minimum Ruby version. |
Smoketests / functional testing in progress ( https://github.com/sbadia/vagrant-gitlab/tree/gitlab-rbenv ) thanks @andschwa ! @sammcj, Spencer's (spuder) module use only the omnibus package (recommended way to install from Gitlab team), but IMHO I don't really like this kind of bundleized |
@andschwa maintainer flag added :-p welcome \o/ |
rbenv::install { $git_user: | ||
group => $git_user, | ||
home => $git_home, | ||
|
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.
please remove this space
Merged in #170 many thanks !! |
Woo! Awesome work all around people. Sorry I've been out of the loop, been finishing up my internship these last few weeks (exactly one more week to go). This is great stuff guys 😄 @sbadia Thanks for handling the rebase and things (and the maintainer flag)! I had those emails flagged, it's just been crazy busy. Will be hopping back into Puppet development in a week. |
This would remove the need to manage Ruby either manually, or with puppet-gitlab-requirements. Instead it uses the popular rbenv module to setup the proper Ruby version for GitLab. I'll update tests later.