From: Tom Hughes Date: Sat, 22 Feb 2025 12:09:15 +0000 (+0000) Subject: Make fullstaq ruby the default X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/7ed67786891a4aae8d8fafad66ba7e2edd0b9449 Make fullstaq ruby the default --- diff --git a/cookbooks/ruby/attributes/default.rb b/cookbooks/ruby/attributes/default.rb index 5bda1dd35..444d260b8 100644 --- a/cookbooks/ruby/attributes/default.rb +++ b/cookbooks/ruby/attributes/default.rb @@ -1,23 +1,4 @@ -default[:ruby][:fullstaq] = false - -if node[:ruby][:fullstaq] - - default[:ruby][:version] = "3.4" - default[:ruby][:interpreter] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/ruby" - default[:ruby][:gem] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/gem" - default[:ruby][:bundle] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/bundle" - -else - - default[:ruby][:version] = if platform?("debian") - "3.1" - elsif node[:lsb][:release].to_f < 22.04 - "2.7" - else - "3.0" - end - default[:ruby][:interpreter] = "/usr/bin/ruby#{node[:ruby][:version]}" - default[:ruby][:gem] = "/usr/bin/gem#{node[:ruby][:version]}" - default[:ruby][:bundle] = "/usr/bin/bundle#{node[:ruby][:version]}" - -end +default[:ruby][:version] = "3.4" +default[:ruby][:interpreter] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/ruby" +default[:ruby][:gem] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/gem" +default[:ruby][:bundle] = "/usr/lib/fullstaq-ruby/versions/#{node[:ruby][:version]}-jemalloc/bin/bundle" diff --git a/cookbooks/ruby/recipes/default.rb b/cookbooks/ruby/recipes/default.rb index 624b39485..cbf2c53f3 100644 --- a/cookbooks/ruby/recipes/default.rb +++ b/cookbooks/ruby/recipes/default.rb @@ -17,46 +17,19 @@ # limitations under the License. # -ruby_version = node[:ruby][:version] - -if node[:ruby][:fullstaq] - - include_recipe "apt::fullstaq-ruby" - - package %W[ - fullstaq-ruby-common - fullstaq-ruby-#{ruby_version}-jemalloc - ] - - %w[bundle bundler erb gem irb racc rake rbs rdbg rdoc ri ruby syntax_suggest typeproc].each do |command| - link "/usr/local/bin/#{command}" do - to "/usr/lib/fullstaq-ruby/versions/#{ruby_version}-jemalloc/bin/#{command}" - owner "root" - group "root" - end - end +include_recipe "apt::fullstaq-ruby" -else +ruby_version = node[:ruby][:version] - package %W[ - ruby - ruby#{ruby_version} - ruby-dev - ruby#{ruby_version}-dev - ] +package %W[ + fullstaq-ruby-common + fullstaq-ruby-#{ruby_version}-jemalloc +] - gem_package "bundler#{ruby_version}-1" do - package_name "bundler" - version "~> 1.17.3" - gem_binary node[:ruby][:gem] - options "--format-executable" +%w[bundle bundler erb gem irb racc rake rbs rdbg rdoc ri ruby syntax_suggest typeproc].each do |command| + link "/usr/local/bin/#{command}" do + to "/usr/lib/fullstaq-ruby/versions/#{ruby_version}-jemalloc/bin/#{command}" + owner "root" + group "root" end - - gem_package "bundler#{ruby_version}-2" do - package_name "bundler" - version "~> 2.3.16" - gem_binary node[:ruby][:gem] - options "--format-executable" - end - end diff --git a/cookbooks/ruby/resources/bundle_install.rb b/cookbooks/ruby/resources/bundle_install.rb index 897bde5fe..2cf7ee632 100644 --- a/cookbooks/ruby/resources/bundle_install.rb +++ b/cookbooks/ruby/resources/bundle_install.rb @@ -47,6 +47,5 @@ action_class do end def after_created - subscribes :run, "gem_package[bundler#{node[:ruby][:version]}-1]" - subscribes :run, "gem_package[bundler#{node[:ruby][:version]}-2]" + subscribes :run, "package[fullstaq-ruby-#{node[:ruby][:version]}-jemalloc]" end diff --git a/roles/dev.rb b/roles/dev.rb index a3e67e0f0..f85849e88 100644 --- a/roles/dev.rb +++ b/roles/dev.rb @@ -159,9 +159,6 @@ default_attributes( } } }, - :ruby => { - :fullstaq => true - }, :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", diff --git a/roles/web-frontend.rb b/roles/web-frontend.rb index e7c0e5850..396cf36db 100644 --- a/roles/web-frontend.rb +++ b/roles/web-frontend.rb @@ -30,9 +30,6 @@ default_attributes( :passenger => { :max_pool_size => 50 }, - :ruby => { - :fullstaq => true - }, :exim => { :local_domains => ["messages.openstreetmap.org"], :routes => {