Skip to content

Commit

Permalink
Ruby Upgrade to 3.1.0 from 3.0.0 (#8675)
Browse files Browse the repository at this point in the history
* package upgrde ruby

Signed-off-by: Vivek Shankar <[email protected]>

* vendor path changes

Signed-off-by: Vivek Shankar <[email protected]>

* pipeline bundler version update

Signed-off-by: Vivek Shankar <[email protected]>

---------

Signed-off-by: Vivek Shankar <[email protected]>
  • Loading branch information
vivekshankar1 authored Dec 11, 2024
1 parent 52d84db commit fbdce41
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ steps:

- label: ":ruby: :buildkite: a2-ha-backend/automate-cluster-ctl"
commands:
- gem install bundler:1.16.6
- gem install bundler:2.3.27
- cd components/automate-cluster-ctl/; bundle install --jobs=3 --retry=3
- bundle exec rspec
expeditor:
Expand Down
2 changes: 1 addition & 1 deletion components/automate-backend-ctl/habitat/bin/knife
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cd "$pkg_prefix"

# These shouldn't be needed as habitat will have these in the path already
#BUNDLE_BIN_DIR=$(hab pkg path "core/bundler")/bin
#RUBY_BIN_DIR=$(hab pkg path "core/ruby30")/bin
#RUBY_BIN_DIR=$(hab pkg path "core/ruby31")/bin

#export PATH=$PATH:$BUNDLE_BIN_DIR:$RUBY_BIN_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(hab pkg path "core/libffi")/lib
Expand Down
6 changes: 3 additions & 3 deletions components/automate-backend-ctl/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ do_before() {
}

pkg_deps=(
core/ruby30
core/ruby31
core/libffi
chef/mlsa
core/bash
Expand Down Expand Up @@ -46,7 +46,7 @@ do_prepare() {
gem update --system --no-document
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" $PLAN_CONTEXT/Gemfile.lock | tail -n 1)"

export GEM_HOME="$pkg_prefix/vendor/bundle/ruby/3.0.0"
export GEM_HOME="$pkg_prefix/vendor/bundle/ruby/3.1.0"
build_line "Setting GEM_HOME='$GEM_HOME'"
export GEM_PATH="$GEM_HOME"
build_line "Setting GEM_PATH='$GEM_PATH'"
Expand Down Expand Up @@ -96,7 +96,7 @@ if test -n "\$DEBUG"; then set -x; fi
export GEM_HOME="$GEM_HOME"
export GEM_PATH="$GEM_PATH"
unset RUBYOPT GEMRC
exec $(pkg_path_for ruby30)/bin/ruby -I $pkg_prefix/lib ${bin}.real \$@
exec $(pkg_path_for ruby31)/bin/ruby -I $pkg_prefix/lib ${bin}.real \$@
EOF
chmod -v 755 "$bin"
}
Expand Down
2 changes: 1 addition & 1 deletion components/automate-backend-deployment/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pkg_license=("Chef-MLSA")


pkg_deps=(
core/ruby30
core/ruby31
core/aws-cli
core/bash
core/coreutils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!{{pkgPathFor "core/bash"}}/bin/bash
echo "------------- starting opensearch sidecar -------------------"
HAB_LICENSE=accept-no-persist GEM_PATH={{pkg.path}}/lib/gems {{pkgPathFor "core/ruby30"}}/bin/ruby {{pkg.path}}/bin/opensearch_sidecar.rb
HAB_LICENSE=accept-no-persist GEM_PATH={{pkg.path}}/lib/gems {{pkgPathFor "core/ruby31"}}/bin/ruby {{pkg.path}}/bin/opensearch_sidecar.rb
echo "-------------------------------------------------------------"
2 changes: 1 addition & 1 deletion components/automate-backend-opensearch/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pkg_deps=(
core/curl # health_check
chef/automate-openjdk
chef/automate-platform-tools
core/ruby30
core/ruby31
)
pkg_interpreters=(bin/ruby)
pkg_bin_dirs=(os/bin)
Expand Down
6 changes: 3 additions & 3 deletions components/automate-cluster-ctl/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ pkg_maintainer="Chef Software Inc. <[email protected]>"
pkg_license=("Chef-MLSA")

pkg_deps=(
core/ruby30
core/ruby31
core/aws-cli
chef/inspec/4.56.61
# chef/inspec/4.56.61
core/bash
core/coreutils
core/cacerts
Expand Down Expand Up @@ -100,7 +100,7 @@ do_unpack() {
}

do_setup_environment() {
export GEM_HOME="$pkg_prefix/vendor/bundle/ruby/3.0.0"
export GEM_HOME="$pkg_prefix/vendor/bundle/ruby/3.1.0"
export GEM_PATH="$GEM_HOME"

set_runtime_env GEM_HOME "$GEM_HOME"
Expand Down
4 changes: 2 additions & 2 deletions components/automate-cluster-ctl/libexec/automate-cluster-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export _CLUSTER_CTL_VERSION="${AUTOMATE_CLUSTER_VERSION:-DEV}"

# If not provided to use set it to our vendor/bundle
if [[ -z "${GEM_PATH}" ]]; then
export GEM_PATH="$_CLUSTER_CTL_ROOT/vendor/bundle/ruby/3.0.0"
export GEM_HOME="$_CLUSTER_CTL_ROOT/vendor/bundle/ruby/3.0.0"
export GEM_PATH="$_CLUSTER_CTL_ROOT/vendor/bundle/ruby/3.1.0"
export GEM_HOME="$_CLUSTER_CTL_ROOT/vendor/bundle/ruby/3.1.0"
fi

export PATH="${libexec_path}:$PATH"
Expand Down
6 changes: 3 additions & 3 deletions components/automate-cs-nginx/habitat/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pkg_deps=(
# chef-server-* packages.
#
core/curl
core/ruby30
core/ruby31
# WARNING: Version pin managed by .expeditor/update_chef_server.sh
"${vendor_origin}/chef-server-nginx/15.10.21/20241126094216"
"${vendor_origin}/chef-server-ctl/15.10.21/20241126093701"
Expand Down Expand Up @@ -67,7 +67,7 @@ scaffolding_go_binary_list=(
chef_automate_hab_binding_mode="relaxed"

do_prepare() {
GO_LDFLAGS="-X main.RubyPath=$(pkg_path_for core/ruby30)"
GO_LDFLAGS="-X main.RubyPath=$(pkg_path_for core/ruby31)"
GO_LDFLAGS="$GO_LDFLAGS -X main.ChefServerCtlPath=$(pkg_path_for chef/chef-server-ctl)"
GO_LDFLAGS="$GO_LDFLAGS -X main.KnifePath=${pkg_prefix}/bin/knife"
GO_LDFLAGS="$GO_LDFLAGS -X main.Version=${pkg_version}/${pkg_release}"
Expand All @@ -83,6 +83,6 @@ do_install() {
install "$PLAN_CONTEXT/bin/knife" "$wrapper_bin_path/knife"

sed -i "s!__BUILDTIME_HAB_PKG_PATH_CHEF_SERVER_CTL__!$(pkg_path_for chef/chef-server-ctl)!g" "$wrapper_bin_path/knife"
sed -i "s!__BUILDTIME_HAB_PKG_PATH_RUBY__!$(pkg_path_for core/ruby30)!g" "$wrapper_bin_path/knife"
sed -i "s!__BUILDTIME_HAB_PKG_PATH_RUBY__!$(pkg_path_for core/ruby31)!g" "$wrapper_bin_path/knife"
}

2 changes: 1 addition & 1 deletion components/automate-cs-oc-erchef/habitat/hooks/run
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ HOME="{{pkg.svc_data_path}}" BUNDLE_GEMFILE="{{pkgPathFor "chef/oc_erchef"}}/Gem
bundle exec ruby "{{pkg.svc_config_path}}/chef_server_data_bootstrap.rb"

# ruby vars are needed in order to make depselector start up
export PATH={{pkgPathFor "core/ruby30"}}/bin:${PATH}
export PATH={{pkgPathFor "core/ruby31"}}/bin:${PATH}
export LD_LIBRARY_PATH={{pkgPathFor "core/libffi"}}/lib:${LD_LIBRARY_PATH}
export GEM_HOME={{pkgPathFor "chef/oc_erchef"}}/vendor/bundle
export GEM_PATH={{pkgPathFor "chef/oc_erchef"}}/vendor/bundle
Expand Down
2 changes: 1 addition & 1 deletion scripts/credentials
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# Summary: Manage cluster credentials including ssl and passwords
# Built-in help

RUBY_PATH=$(HAB_LICENSE=accept-no-persist hab pkg list --origin core | grep ruby30 | tail -1)
RUBY_PATH=$(HAB_LICENSE=accept-no-persist hab pkg list --origin core | grep ruby31 | tail -1)
[ -d "./test/vendor/bundle" ] || (cd test && /hab/pkgs/$RUBY_PATH/bin/bundle install --path vendor/bundle)
cd test && /hab/pkgs/$RUBY_PATH/bin/bundle exec /hab/pkgs/$RUBY_PATH/bin/ruby lib/credentials "$@"
2 changes: 1 addition & 1 deletion scripts/gather-logs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

[ -d "./test/vendor/bundle" ] || (cd test && $(hab pkg path core30)/bin/bundle install --path vendor/bundle)
cd test && $(hab pkg path core/ruby30)/bin/bundle exec $(hab pkg path core/ruby30)/bin/ruby lib/gather-logs "$@"
cd test && $(hab pkg path core/ruby31)/bin/bundle exec $(hab pkg path core/ruby31)/bin/ruby lib/gather-logs "$@"
4 changes: 2 additions & 2 deletions scripts/smoke-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

[ -d "./test/vendor/bundle" ] || (cd test && $(hab pkg path core/ruby30)/bin/bundle install --path vendor/bundle)
cd test && $(hab pkg path core/ruby30)/bin/bundle exec $(hab pkg path core/ruby30)/bin/ruby lib/smoke-test "$@"
[ -d "./test/vendor/bundle" ] || (cd test && $(hab pkg path core/ruby31)/bin/bundle install --path vendor/bundle)
cd test && $(hab pkg path core/ruby31)/bin/bundle exec $(hab pkg path core/ruby31)/bin/ruby lib/smoke-test "$@"

0 comments on commit fbdce41

Please sign in to comment.