ajgon / opsworks_ruby

Set of chef recipes for OpsWorks based Ruby projects.
MIT License
82 stars 93 forks source link

Interest in replacing ruby-ng w/ rvm? #67

Closed kpheasey closed 7 years ago

kpheasey commented 7 years ago

Currently, ruby is installed via brightbox (ruby-ng), these versions are not compiled with debug symbols which is necessary for thread profiling and you can't target patch level versions like 2.3.1. Installing ruby with rvm includes the debug symbols and it also allows easier access to patch level versions (2.3.x)

I have successfully replaced ruby-ng with rvm, using a system wide install. There are minimal code changes. Would there be interest in a pull request?

I'm asking because I'm not sure if this is implementation specific.

ajgon commented 7 years ago

ruby-ng was chosen initially because it was easiest thing to do. However prepacked binaries are problematic, for reasons you mentioned, but also, different distros (amazon linux/ubuntu) have different versions available which causes consistency problems.

I'm really happy for rvm support, and will greatly appreciate the PR!

kpheasey commented 7 years ago

@ajgon How do I run the tests? I have another open pull request that needs some specs too. Once I update the specs, I can make the PR.

ajgon commented 7 years ago

Assuming you have chef-dk installed:

chef exec bundle exec overcommit -r
chef exec bundle exec rspec # specs

# integration tests, needs vagrant and virtualbox installed
for i in default-ubuntu-1404 all-options-ubuntu-1404 unicorn-apache-hanami-resque-ubuntu-1404 thin-nginx-padrino-delayed-job-ubuntu-1404 nullified-ubuntu-1404; do kitchen destroy $i; kitchen converge $i; done
for i in default-ubuntu-1404 all-options-ubuntu-1404 unicorn-apache-hanami-resque-ubuntu-1404 thin-nginx-padrino-delayed-job-ubuntu-1404 nullified-ubuntu-1404; do kitchen verify $i; done
kpheasey commented 7 years ago

Thanks. I'll use the circle ci output and your snippets to update any specs and get everything passing.

kpheasey commented 7 years ago

@ajgon I have everything pretty much ready to go, except for one test that's not passing:

https://github.com/ajgon/opsworks_ruby/blob/a89451f17d19e2d1b4974f23e8f4a546b8ba5b1d/test/integration/all_options/serverspec/all_options_spec.rb#L157-L159

I receive the following output:

       Failures:

         1) opsworks_ruby::deploy appserver Command "pgrep -f puma | tr '\n' ' '" stdout should match /(?:[0-9]+ ){4}/
            Failure/Error: its(:stdout) { should match(/(?:[0-9]+ ){4}/) }
              expected "381 383 " to match /(?:[0-9]+ ){4}/
              Diff:
              @@ -1,2 +1,2 @@
              -/(?:[0-9]+ ){4}/
              +"381 383 "

              /bin/sh -c pgrep\ -f\ puma\ \|\ tr\ \'\\n\'\ \'\ \'
              381 383
            # /tmp/verifier/suites/serverspec/all_options_spec.rb:158:in `block (4 levels) in <top (required)>'

I'm not really sure what that's testing though. Puma is up and running without issue on my opsworks dev stack using ubuntu 14.04.

Here's a link to my branch if you need it. https://github.com/kpheasey/opsworks_ruby/tree/rvm

shrinathaithal commented 3 years ago

@kpheasey any chance you can find that branch again? The link above is 404 and I am in need of ruby 3. Brightbox is still at 2.7 :/

ajgon commented 3 years ago

@shrinathaithal Have you tried using fullstaq provider? They should have 3.x ruby available. You need to set ruby-provider to fullstaq in your Custom JSON, and then you can set ruby-version to 3.0.1.

shrinathaithal commented 3 years ago

I tried snap (hard coded in my own recipe and disabled ruby-ng installations in my copy). I found it had 3.0.1 and works for now. But the inherent problem with snap modules is they upgrade without telling. Will try out fullstaq, thank you.

On Sun, 6 Jun 2021 at 6:00 PM Igor Rzegocki @.***> wrote:

@shrinathaithal https://github.com/shrinathaithal Have you tried using fullstaq provider? They should have 3.x ruby available. You need to set ruby-provider to fullstaq in your Custom JSON, and then you can set ruby-version to 3.0.1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ajgon/opsworks_ruby/issues/67#issuecomment-855391614, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKVWAP4VFTQUCZKUU7Y65LTRNS7XANCNFSM4DCAZOGA .