Skip to content

Commit

Permalink
Several changes to allow Ubuntu 22.04 builds (#2020)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
treydock authored May 23, 2022
1 parent 4e93529 commit eaf9bc1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions apps/dashboard/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ end
group :test do
gem "capybara"
gem "selenium-webdriver"
gem "webrick"
end

group :development do
Expand All @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions apps/dashboard/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/models/batch_connect/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/test/models/batch_connect/session_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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?
Expand All @@ -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) }

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nginx_stage/nginx_stage.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions packaging/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: unknown
Priority: optional
Maintainer: Ohio Supercomputer Center <[email protected]>
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
Expand All @@ -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
Expand Down

0 comments on commit eaf9bc1

Please sign in to comment.