From eaf9bc1c2e196b2725c892b0c4bd5c1efa558b02 Mon Sep 17 00:00:00 2001 From: treydock Date: Mon, 23 May 2022 09:56:43 -0400 Subject: [PATCH] Several changes to allow Ubuntu 22.04 builds (#2020) * Bump osc_machete_rails sqlite3 versions in myjobs to support Ruby 3.0 * Run unit tests with Ruby 3.0.2 to catch issues with Ubuntu 22.04 * Need tzdata for Ubuntu packages * Allow bundler 2.x * Add rss gem explicitely. It's required but gem not installed with Ruby 3.0 * Attempt to make kwargs work with Ruby 2.7 and 3.0 https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ * Need webrick for dashboard tests on Ruby 3.0 --- .github/workflows/tests.yml | 5 +++++ apps/dashboard/Gemfile | 2 ++ apps/dashboard/Gemfile.lock | 5 +++++ apps/dashboard/app/models/batch_connect/session.rb | 2 +- apps/dashboard/test/models/batch_connect/session_test.rb | 8 ++++---- nginx_stage/nginx_stage.gemspec | 2 +- packaging/deb/control | 4 ++-- 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cbed2b9564..8a1754b975 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,6 +13,11 @@ jobs: os: ["ubuntu-latest"] ruby: ["2.7.1"] bundler: ["2.1.4"] + include: + # Test versions from Ubuntu 22.04 + - os: ubuntu-latest + ruby: "3.0.2" + bundler: "2.3.5" runs-on: ${{ matrix.os }} name: Unit tests diff --git a/apps/dashboard/Gemfile b/apps/dashboard/Gemfile index 0a1a0c9ce0..af176e024a 100644 --- a/apps/dashboard/Gemfile +++ b/apps/dashboard/Gemfile @@ -28,6 +28,7 @@ end group :test do gem "capybara" gem "selenium-webdriver" + gem "webrick" end group :development do @@ -46,6 +47,7 @@ gem 'autoprefixer-rails', '~> 10.2.5' gem 'dotiw' gem 'local_time', '~> 1.0.3' gem 'zip_tricks', '~> 5.5' +gem 'rss', '~> 0.2' gem 'jsbundling-rails', '~> 1.0' gem 'cssbundling-rails', '~> 1.1' diff --git a/apps/dashboard/Gemfile.lock b/apps/dashboard/Gemfile.lock index 6b032850cc..35ae08fde9 100644 --- a/apps/dashboard/Gemfile.lock +++ b/apps/dashboard/Gemfile.lock @@ -193,6 +193,8 @@ GEM request_store (1.5.1) rack (>= 1.4) rexml (3.2.5) + rss (0.2.9) + rexml ruby2_keywords (0.0.5) rubyzip (2.3.2) sdoc (2.4.0) @@ -225,6 +227,7 @@ GEM timecop (0.9.5) tzinfo (2.0.4) concurrent-ruby (~> 1.0) + webrick (1.7.0) websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -259,11 +262,13 @@ DEPENDENCIES pbs (~> 2.2.1) rails (= 6.1.5.1) redcarpet (~> 3.3) + rss (~> 0.2) sdoc selenium-webdriver sinatra sinatra-contrib timecop (~> 0.9) + webrick zip_tricks (~> 5.5) BUNDLED WITH diff --git a/apps/dashboard/app/models/batch_connect/session.rb b/apps/dashboard/app/models/batch_connect/session.rb index c0de362a79..9a74abfeac 100644 --- a/apps/dashboard/app/models/batch_connect/session.rb +++ b/apps/dashboard/app/models/batch_connect/session.rb @@ -295,7 +295,7 @@ def script(opts = {}) content = opts.fetch(:content, "") options = opts.fetch(:options, {}) - OodCore::Job::Script.new(options.merge(content: content)) + OodCore::Job::Script.new(**options.merge(content: content)) end # The content of the batch script used for this session diff --git a/apps/dashboard/test/models/batch_connect/session_test.rb b/apps/dashboard/test/models/batch_connect/session_test.rb index c243c92623..c2ae795801 100644 --- a/apps/dashboard/test/models/batch_connect/session_test.rb +++ b/apps/dashboard/test/models/batch_connect/session_test.rb @@ -339,7 +339,7 @@ def completed? BatchConnect::Session.any_instance.stubs(:info).returns(info) OodCore::Job::Info.any_instance.stubs(:ood_connection_info).returns(connect) session = BatchConnect::Session.new - session.stage(app: bc_jupyter_app, context: bc_jupyter_app.build_session_context) + session.stage(bc_jupyter_app, context: bc_jupyter_app.build_session_context) assert session.connection_in_info? assert !session.starting? @@ -357,7 +357,7 @@ def completed? BatchConnect::Session.any_instance.stubs(:id).returns('test-id') BatchConnect::Session.any_instance.stubs(:info).returns(info) session = BatchConnect::Session.new - session.stage(app: bc_jupyter_app, context: bc_jupyter_app.build_session_context) + session.stage(bc_jupyter_app, context: bc_jupyter_app.build_session_context) assert !session.connection_in_info? assert session.starting? @@ -381,7 +381,7 @@ def completed? session.stubs(:id).returns('test-id') session.stubs(:info).returns(info) - session.stage(app: bc_jupyter_app, context: bc_jupyter_app.build_session_context) + session.stage(bc_jupyter_app, context: bc_jupyter_app.build_session_context) File.open(session.connect_file, 'w') { |file| file.write(connect.to_yaml) } @@ -415,7 +415,7 @@ def completed? session = BatchConnect::Session.new assert !Dir.exist?(session.staged_root) - session.stage(app: bc_jupyter_app, context: bc_jupyter_app.build_session_context) + session.stage(bc_jupyter_app, context: bc_jupyter_app.build_session_context) assert Dir.exist?(session.staged_root) end end diff --git a/nginx_stage/nginx_stage.gemspec b/nginx_stage/nginx_stage.gemspec index 5fab85abf9..efe4761a1b 100644 --- a/nginx_stage/nginx_stage.gemspec +++ b/nginx_stage/nginx_stage.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |spec| spec.add_dependency "syslog", "~> 0.1.0" spec.add_dependency 'dotenv', '~> 2.1' - spec.add_development_dependency "bundler", "~> 2.1.0" + spec.add_development_dependency "bundler", "~> 2.1" spec.add_development_dependency "rake", "~> 13.0.1" spec.add_development_dependency "rspec" spec.add_development_dependency "climate_control" diff --git a/packaging/deb/control b/packaging/deb/control index d9c169c16d..75370536ba 100644 --- a/packaging/deb/control +++ b/packaging/deb/control @@ -3,7 +3,7 @@ Section: unknown Priority: optional Maintainer: Ohio Supercomputer Center Build-Depends: debhelper (>=11~), curl, build-essential, - ruby, ruby-dev, + ruby, ruby-dev, tzdata, nodejs (>= 14.0), nodejs (<< 15.0), sqlite, libsqlite3-dev, python3 Standards-Version: 4.1.4 @@ -13,7 +13,7 @@ Package: ondemand Architecture: any Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends}, - ruby, apache2, sudo, lsof, lua-posix, + ruby, apache2, sudo, lsof, lua-posix, tzdata, nodejs (>= 14.0), nodejs (<< 15.0), ondemand-nginx (= 1.20.2), ondemand-passenger (= 6.0.14) Description: Open OnDemand is an open source release of the Ohio SuperComputer Center's