From 438f317ab36fb0da64475a1042b406d4e588df90 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 12:54:16 +0100 Subject: [PATCH 1/7] [#426] installed curl to docker, restored the binaries job --- .github/workflows/release.yml | 55 +++++++++++++++++++++++++++++++++++ Dockerfile | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c993ff9..97c528da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,8 +25,63 @@ jobs: - code-quality uses: ./.github/workflows/docker-image-release.yml secrets: inherit + make-binary: + needs: + - code-quality + strategy: + matrix: + os: [ubuntu-20.04, macos-12] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - name: 'Install Linux dependencies' + if: matrix.os == 'ubuntu-20.04' + run: | + sudo apt update + sudo apt install -y build-essential squashfs-tools curl gcc make bison + - name: 'Install MacOs dependencies' + if: matrix.os == 'macos-12' + run: | + brew install squashfs + - uses: actions/checkout@v2 + - name: 'Set up Ruby' + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0.3' + - name: 'Create Linux Bin' + if: matrix.os == 'ubuntu-20.04' + run: | + wget https://github.com/pmq20/ruby-packer/releases/download/linux-x64/rubyc + chmod +x ./rubyc + ./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ env.LINUX_BIN_PATH }} + - name: 'Create Darwin Bin' + if: matrix.os == 'macos-12' + run: | + export PATH="$(brew --prefix)/opt/openssl@1.1/bin:$PATH" + export LDFLAGS="-L$(brew --prefix)/opt/openssl@1.1/lib" + export CPPFLAGS="-I$(brew --prefix)/opt/openssl@1.1/include" + export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@1.1/lib/pkgconfig" + export SSL_CERT_FILE=$(ruby -e "require 'openssl'; puts OpenSSL::X509::DEFAULT_CERT_FILE") + + wget https://github.com/pmq20/ruby-packer/releases/download/darwin-x64/rubyc + chmod +x ./rubyc + ./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ env.DARWIN_BIN_PATH }} + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + if: matrix.os == 'ubuntu-20.04' + with: + name: ${{ env.LINUX_BIN_PATH }} + path: ${{ env.LINUX_BIN_PATH }} + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + if: matrix.os == 'macos-12' + with: + name: ${{ env.DARWIN_BIN_PATH }} + path: ${{ env.DARWIN_BIN_PATH }} create_release: runs-on: ubuntu-latest + needs: + - make-binary steps: - name: Generate release notes uses: softprops/action-gh-release@v2 diff --git a/Dockerfile b/Dockerfile index d5f4c002..31cff39f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,8 @@ FROM ruby:3.0.3-alpine AS shell RUN apk --update add --no-cache \ bash \ - vim + vim \ + curl WORKDIR /root/ From 4d62ad75daeae104df6b9f08c1ce9b4e0fbf7922 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 12:56:06 +0100 Subject: [PATCH 2/7] [#426] updated checkout action version --- .github/workflows/make-binary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/make-binary.yml b/.github/workflows/make-binary.yml index 732b3940..edbfdb22 100644 --- a/.github/workflows/make-binary.yml +++ b/.github/workflows/make-binary.yml @@ -24,7 +24,7 @@ jobs: if: matrix.os == 'macos-12' run: | brew install squashfs - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: 'Set up Ruby' uses: ruby/setup-ruby@v1 with: From 8b1b45ea2be3713d3fa0ce899f1f0d3575fc54e1 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 13:35:32 +0100 Subject: [PATCH 3/7] [#426] bundle gems without dev dependencies --- .github/workflows/make-binary.yml | 2 +- uffizzi.gemspec | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/make-binary.yml b/.github/workflows/make-binary.yml index edbfdb22..86fcb275 100644 --- a/.github/workflows/make-binary.yml +++ b/.github/workflows/make-binary.yml @@ -34,7 +34,7 @@ jobs: run: | wget https://github.com/pmq20/ruby-packer/releases/download/linux-x64/rubyc chmod +x ./rubyc - ./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ inputs.linux-bin-path }} + BUNDLE_WITHOUT=development:test ./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ inputs.linux-bin-path }} - name: 'Create Darwin Bin' if: matrix.os == 'macos-12' run: | diff --git a/uffizzi.gemspec b/uffizzi.gemspec index 425ffaf6..ced43dd6 100644 --- a/uffizzi.gemspec +++ b/uffizzi.gemspec @@ -28,9 +28,9 @@ Gem::Specification.new do |spec| spec.add_dependency 'activesupport' spec.add_dependency 'awesome_print' - spec.add_dependency 'faker' spec.add_dependency 'launchy' spec.add_dependency 'minitar' + spec.add_dependency 'open3' spec.add_dependency 'securerandom' spec.add_dependency 'sentry-ruby' spec.add_dependency 'thor' @@ -43,10 +43,10 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'deepsort', '~> 0.4.5' spec.add_development_dependency 'factory_bot' spec.add_development_dependency 'fakefs' + spec.add_development_dependency 'faker' spec.add_development_dependency 'minitest' spec.add_development_dependency 'minitest-power_assert' spec.add_development_dependency 'mocha' - spec.add_development_dependency 'open3' spec.add_development_dependency 'pry-byebug' spec.add_development_dependency 'pry-inline' spec.add_development_dependency 'rake' From 578b0456330eb80ee825ceb51591d0e81c34a4de Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 13:44:02 +0100 Subject: [PATCH 4/7] [426] updated gemfile.lock --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6a4f2a98..4fe51a06 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,9 +4,9 @@ PATH uffizzi-cli (2.4.16) activesupport awesome_print - faker launchy minitar + open3 securerandom sentry-ruby thor @@ -146,10 +146,10 @@ DEPENDENCIES deepsort (~> 0.4.5) factory_bot fakefs + faker minitest minitest-power_assert mocha - open3 pry-byebug pry-inline rake From 9f2717af7f743f32b1dba0c1bbcf33c6b9636607 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 14:07:16 +0100 Subject: [PATCH 5/7] [#426] replaced faker with ffaker in runtime for linux bin --- Gemfile.lock | 2 ++ lib/uffizzi/cli/cluster.rb | 2 +- lib/uffizzi/cli/install.rb | 2 +- lib/uffizzi/helpers/project_helper.rb | 4 ++-- lib/uffizzi/services/cluster_service.rb | 2 +- uffizzi.gemspec | 2 ++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4fe51a06..4da364ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ PATH uffizzi-cli (2.4.16) activesupport awesome_print + ffaker (~> 2.22) launchy minitar open3 @@ -41,6 +42,7 @@ GEM fakefs (1.8.0) faker (3.5.1) i18n (>= 1.8.11, < 2) + ffaker (2.24.0) hashdiff (1.0.1) i18n (1.8.11) concurrent-ruby (~> 1.0) diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index b4041a5c..37bf55e4 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'psych' -require 'faker' +require 'ffaker' require 'uffizzi' require 'uffizzi/auth_helper' require 'uffizzi/helpers/config_helper' diff --git a/lib/uffizzi/cli/install.rb b/lib/uffizzi/cli/install.rb index 785fc76d..9011c31d 100644 --- a/lib/uffizzi/cli/install.rb +++ b/lib/uffizzi/cli/install.rb @@ -64,7 +64,7 @@ def helm_set_repo def build_installation_options(uri) { uri: uri, - controller_username: Faker::Lorem.characters(number: 10), + controller_username: FFaker::Lorem.characters(10), controller_password: generate_password, cert_email: options[:email], cluster_issuer: options[:issuer] || InstallService::DEFAULT_CLUSTER_ISSUER, diff --git a/lib/uffizzi/helpers/project_helper.rb b/lib/uffizzi/helpers/project_helper.rb index f03fe5b3..4190ef2a 100644 --- a/lib/uffizzi/helpers/project_helper.rb +++ b/lib/uffizzi/helpers/project_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'faker' +require 'ffaker' module Uffizzi module ProjectHelper @@ -34,7 +34,7 @@ def default_description end def generate_name - Faker::Lorem.word + FFaker::Lorem.word end end end diff --git a/lib/uffizzi/services/cluster_service.rb b/lib/uffizzi/services/cluster_service.rb index 4697a495..3b0d3cd4 100644 --- a/lib/uffizzi/services/cluster_service.rb +++ b/lib/uffizzi/services/cluster_service.rb @@ -75,7 +75,7 @@ def wait_cluster_scale_down(cluster_name, cluster_api_connection_params) end def generate_name - name = Faker::Internet.domain_word[0..CLUSTER_NAME_MAX_LENGTH] + name = FFaker::InternetSE.domain_word[0..CLUSTER_NAME_MAX_LENGTH] return name if valid_name?(name) diff --git a/uffizzi.gemspec b/uffizzi.gemspec index ced43dd6..e9c1ce74 100644 --- a/uffizzi.gemspec +++ b/uffizzi.gemspec @@ -28,6 +28,8 @@ Gem::Specification.new do |spec| spec.add_dependency 'activesupport' spec.add_dependency 'awesome_print' + # Added ffaker for runtime because rubyc used for linux bin generation has Ruby version 2.7 and the faker library is incompatible + spec.add_dependency 'ffaker', '~> 2.22' spec.add_dependency 'launchy' spec.add_dependency 'minitar' spec.add_dependency 'open3' From fcd59305c155ab7745160f94c1a11b59b430d9ac Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 14:26:19 +0100 Subject: [PATCH 6/7] [426] use faker version 2.23.0 --- Gemfile.lock | 10 ++++------ lib/uffizzi/cli/cluster.rb | 2 +- lib/uffizzi/cli/install.rb | 2 +- lib/uffizzi/helpers/project_helper.rb | 4 ++-- lib/uffizzi/services/cluster_service.rb | 2 +- uffizzi.gemspec | 4 +--- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4da364ef..5840132c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ PATH uffizzi-cli (2.4.16) activesupport awesome_print - ffaker (~> 2.22) + faker (< 3.0) launchy minitar open3 @@ -33,18 +33,17 @@ GEM childprocess (5.1.0) logger (~> 1.5) coderay (1.1.3) - concurrent-ruby (1.1.9) + concurrent-ruby (1.3.5) crack (0.4.5) rexml deepsort (0.4.5) factory_bot (6.2.0) activesupport (>= 5.0.0) fakefs (1.8.0) - faker (3.5.1) + faker (2.23.0) i18n (>= 1.8.11, < 2) - ffaker (2.24.0) hashdiff (1.0.1) - i18n (1.8.11) + i18n (1.14.7) concurrent-ruby (~> 1.0) kramdown (2.3.1) rexml @@ -148,7 +147,6 @@ DEPENDENCIES deepsort (~> 0.4.5) factory_bot fakefs - faker minitest minitest-power_assert mocha diff --git a/lib/uffizzi/cli/cluster.rb b/lib/uffizzi/cli/cluster.rb index 37bf55e4..b4041a5c 100644 --- a/lib/uffizzi/cli/cluster.rb +++ b/lib/uffizzi/cli/cluster.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'psych' -require 'ffaker' +require 'faker' require 'uffizzi' require 'uffizzi/auth_helper' require 'uffizzi/helpers/config_helper' diff --git a/lib/uffizzi/cli/install.rb b/lib/uffizzi/cli/install.rb index 9011c31d..785fc76d 100644 --- a/lib/uffizzi/cli/install.rb +++ b/lib/uffizzi/cli/install.rb @@ -64,7 +64,7 @@ def helm_set_repo def build_installation_options(uri) { uri: uri, - controller_username: FFaker::Lorem.characters(10), + controller_username: Faker::Lorem.characters(number: 10), controller_password: generate_password, cert_email: options[:email], cluster_issuer: options[:issuer] || InstallService::DEFAULT_CLUSTER_ISSUER, diff --git a/lib/uffizzi/helpers/project_helper.rb b/lib/uffizzi/helpers/project_helper.rb index 4190ef2a..f03fe5b3 100644 --- a/lib/uffizzi/helpers/project_helper.rb +++ b/lib/uffizzi/helpers/project_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'ffaker' +require 'faker' module Uffizzi module ProjectHelper @@ -34,7 +34,7 @@ def default_description end def generate_name - FFaker::Lorem.word + Faker::Lorem.word end end end diff --git a/lib/uffizzi/services/cluster_service.rb b/lib/uffizzi/services/cluster_service.rb index 3b0d3cd4..4697a495 100644 --- a/lib/uffizzi/services/cluster_service.rb +++ b/lib/uffizzi/services/cluster_service.rb @@ -75,7 +75,7 @@ def wait_cluster_scale_down(cluster_name, cluster_api_connection_params) end def generate_name - name = FFaker::InternetSE.domain_word[0..CLUSTER_NAME_MAX_LENGTH] + name = Faker::Internet.domain_word[0..CLUSTER_NAME_MAX_LENGTH] return name if valid_name?(name) diff --git a/uffizzi.gemspec b/uffizzi.gemspec index e9c1ce74..6acd6f39 100644 --- a/uffizzi.gemspec +++ b/uffizzi.gemspec @@ -28,8 +28,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'activesupport' spec.add_dependency 'awesome_print' - # Added ffaker for runtime because rubyc used for linux bin generation has Ruby version 2.7 and the faker library is incompatible - spec.add_dependency 'ffaker', '~> 2.22' + spec.add_dependency 'faker', '< 3.0' spec.add_dependency 'launchy' spec.add_dependency 'minitar' spec.add_dependency 'open3' @@ -45,7 +44,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'deepsort', '~> 0.4.5' spec.add_development_dependency 'factory_bot' spec.add_development_dependency 'fakefs' - spec.add_development_dependency 'faker' spec.add_development_dependency 'minitest' spec.add_development_dependency 'minitest-power_assert' spec.add_development_dependency 'mocha' From 33da4d2c55a0cb2c87f8a29691724737cef86c82 Mon Sep 17 00:00:00 2001 From: Lidia Mokevnina Date: Fri, 21 Mar 2025 15:05:21 +0100 Subject: [PATCH 7/7] [#426] try macos-13 for binary building --- .github/workflows/make-binary.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/make-binary.yml b/.github/workflows/make-binary.yml index 86fcb275..0402650f 100644 --- a/.github/workflows/make-binary.yml +++ b/.github/workflows/make-binary.yml @@ -11,7 +11,7 @@ jobs: make-binary: strategy: matrix: - os: [ubuntu-20.04, macos-12] + os: [ubuntu-20.04, macos-13] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -21,7 +21,7 @@ jobs: sudo apt update sudo apt install -y build-essential squashfs-tools curl gcc make bison - name: 'Install MacOs dependencies' - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' run: | brew install squashfs - uses: actions/checkout@v4 @@ -36,7 +36,7 @@ jobs: chmod +x ./rubyc BUNDLE_WITHOUT=development:test ./rubyc --openssl-dir=/etc/ssl ./uffizzi --output=${{ inputs.linux-bin-path }} - name: 'Create Darwin Bin' - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' run: | export PATH="$(brew --prefix)/opt/openssl@1.1/bin:$PATH" export LDFLAGS="-L$(brew --prefix)/opt/openssl@1.1/lib" @@ -55,7 +55,7 @@ jobs: path: ${{ inputs.linux-bin-path }} - name: Upload Artifacts uses: actions/upload-artifact@v4 - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' with: name: ${{ inputs.darwin-bin-path }} path: ${{ inputs.darwin-bin-path }}