sequenceserver icon indicating copy to clipboard operation
sequenceserver copied to clipboard

ruby versions - need to migrate support

Open yannickwurm opened this issue 2 years ago • 8 comments

So ruby 2.6.10 is no longer LTS supported (i.e. no more security updates).

Some recent installs using ruby 3 have highlighted issues. Probably we will want to get everything to work with newer ruby (e.g., 3.1.2)

https://endoflife.date/ruby

yannickwurm avatar Apr 20 '22 14:04 yannickwurm

Sequenceserver does not work for me with ruby 3.0 (on update from ubuntu 21.10 to 22.04, ruby 2.7 is no longer available from the main repository). Upon invoking sequenceserver, the error is:

<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- webrick (LoadError)
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /var/lib/gems/3.0.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:3:in `<top (required)>'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /var/lib/gems/3.0.0/gems/sequenceserver-2.0.0/lib/sequenceserver/server.rb:1:in `<top (required)>'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /var/lib/gems/3.0.0/gems/sequenceserver-2.0.0/lib/sequenceserver.rb:21:in `<module:SequenceServer>'
	from /var/lib/gems/3.0.0/gems/sequenceserver-2.0.0/lib/sequenceserver.rb:6:in `<top (required)>'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /var/lib/gems/3.0.0/gems/sequenceserver-2.0.0/bin/sequenceserver:177:in `block (2 levels) in <top (required)>'
	from /var/lib/gems/3.0.0/gems/slop-3.6.0/lib/slop.rb:260:in `parse!'
	from /var/lib/gems/3.0.0/gems/slop-3.6.0/lib/slop.rb:65:in `parse!'
	from /var/lib/gems/3.0.0/gems/sequenceserver-2.0.0/bin/sequenceserver:48:in `<top (required)>'
	from /usr/local/bin/sequenceserver:25:in `load'
	from /usr/local/bin/sequenceserver:25:in `<main>'

With 2.7 it worked mostly OK.

Cheers

lukaszsobala avatar May 25 '22 08:05 lukaszsobala

@lukaszsobala This is being worked on in PR #590. Maybe give @iQuxLE's branch a try and help us be sure of the changes? He is working on a Mac. Your testing will help us be sure of the changes for Ubuntu.

yeban avatar May 26 '22 16:05 yeban

@lukaszsobala

Does it work for you now? Your error was mainly because in Ruby 3.0 webrick is no more bundled and you have to gem install or include it in dependencies of squenceserver.gemspec

iQuxLE avatar Jun 02 '22 10:06 iQuxLE

@yeban @iQuxLE I would love to give it a try, but I don't really know how to "try a branch"... Until now I just used gem to install sequenceserver (and nothing else really), and I don't know what bundler does. Could you explain how to do this?

lukaszsobala avatar Jun 02 '22 10:06 lukaszsobala

@lukaszsobala

Git clone https://github.com/iQuxLE/sequenceserver.git

This creates a new sequenceserver (directory) that you can run and it comes from my master.

cd sequenceserver

git checkout abf47f5ea6f34caff541b986b3366184230908e1

This switches to the specific branch where my changes are inside

Now you just have to “bundle install” (and if it does not recognise sequenceserver gem from before also gem install sequenceserver) and you are done and you can use the whole updated version and see whether there is a problem.

There is also the possibility to just grab a specific branch from a master here. But actually that was a little more problematic for me.

I think by now it would just work with Ruby 3.1.2 (its because of the permitted_classes argument in job.rb so you could just cut that inside there if you are using 2.7.5 or 3.0.4

# Fetches job with the given id.
      def fetch(id)
        job_file = File.join(DOTDIR, id, 'job.yaml')
        fail NotFound unless File.exist?(job_file)
        YAML.load_file(job_file, permitted_classes: [Time, Symbol, SequenceServer::BLAST::Job, \
                                                     SequenceServer::Database, SequenceServer::Job])
      end

That it is just like that:

YAML.load_file(job_file)

This is something I just found out and I will try to build a way around this, next.

Carlo

iQuxLE avatar Jun 02 '22 13:06 iQuxLE

@iQuxLE thanks. Now when I do:

git clone https://github.com/iQuxLE/sequenceserver.git
cd sequenceserver
git checkout abf47f5ea6f34caff541b986b3366184230908e1
bundle install --without=development

I get the following error: sequenceserver-2.0.0 requires ruby version >= 3.1.2, which is incompatible with the current version, ruby 3.0.2p107

So yes, it only works with 3.1.2. (edited)

I tried cutting and replacing the lines in job.rb and the behaviour is still the same. I will probably need to install another version of ruby through mamba.

lukaszsobala avatar Jun 02 '22 13:06 lukaszsobala

You can change sequenceserver.gemspec (last file) to Ruby version : >= 2.5 or = 3.0 It should work for you after that

iQuxLE avatar Jun 02 '22 14:06 iQuxLE

You can change sequenceserver.gemspec (last file) to Ruby version : >= 2.5 or = 3.0 It should work for you after that

Indeed @iQuxLE! now it works without a problem. Thank you.

lukaszsobala avatar Jun 02 '22 15:06 lukaszsobala

Closed with 25f6a26 - thank you @tadast & @iQuxLE

yannickwurm avatar May 04 '23 09:05 yannickwurm