view · edit · sidebar · attach · print · history

20131111-install-funtoo

<< | Index | >>


Summary

  • Install funtoo on new machine
  • Trying to make yus work without needle

Commits

Index

---

Install funtoo on new machine

(2 PM) Still waiting for the new PC to come, but thinking about how to bring up the new machine.

Steps to bring up a new machines are:

  1. Install funtoo http://www.funtoo.org/Funtoo_Linux_Installation
    1. Using amd64 SystemRescueCD (as I always have a USB boot stick for emergency repairs)
    2. Format using GPT with following partitions
      1. Linux filesystem 500 MB
      2. boot partition 32 MB
      3. swap 4 GB
      4. / root 20 GB
      5. /var 10 GB. I like to have a separate var partition for rare cases where logs fill a HD completely
      6. /tmp 2 GB
      7. /var/www/oddb.org 80 GB where our data live
    3. boot into new funtoo
    4. Compile vanilla kernel 3.11
    5. Setup static IP
  2. Setup using puppet or (it fails) http://www.funtoo.org/Funtoo_Linux_First_Steps
    1. https://github.com/ngiger/vagrant-oddb_org/#installation-into-an-already-running-funtoo-server
    2. Adapt / save your hieradata/private/config.yaml

make yus daemon run under ruby18

Testing the vagrant on a freshly checkout virtualbox I remarked that the old way of installing yus under ruby 1.8 did not work any longer, as some old gems could no longer be installed via emerge. Therefore I reworked my install_yus.sh using the insights gained in the last few months namely.

  1. Use the possibility to use bundler to install the yus
  2. When using gem18 and its bundler always use --bindir=/usr/local/ruby18/bin to avoid modifiying the binaries installed via the default ruby 1.9
  3. adapt /var/lib/service/yus/run to use /usr/local/bin/yusd18 to be able to change directory and calling bundle exec ruby18 bin/yusd to avoid runtime errors
  4. Don't install ruby-password

Even after this changes I remarked that after sudo eselect ruby set ruby18 yusd started okay, but after a sudo eselect ruby set ruby19 it failed.

No my new VM runs oddb.org without any problems and I was able to reset my admin password. See patch Fixed running yusd under ruby18

jobs/rebuild_indices returned immediately if no indexname specified

Calling jobs/rebuild_indices on my VM returned after 40 seconds. Investigation showed, that the name passed to src/util/oddbapp.rb rebuild_indices was an empty string and not nil. Pushed fix Fix rebuild_indices if no name given

We get 'Internal Server Error' while importing the Patents

Adapting jobs/import_swissmedic and src/util/updater.rb to provoke the error as soon as possible. But it took over 3 hours till I got there. Will add more debug info and restart the run again.

Trying to make yus work without needle

Makeing unit tests working in logical order

  1. test/test_privilege.rb. Okay.
  2. test/test_entity.rb. Okay.
  3. test/test_session.rb. Okay.
  4. test/test_server.rb. Okay.

Making the unit tests passed involved changing small things. Created a new branch https://github.com/ngiger/yus/commits/without_needle with a single commit Trying to make yus work without needle gem.

Will test the stuff on the my VM. Runninb bin/oddbd fails with now with the following error

process: Oddb (OddbApp)
init system
/usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing': undefined method `update' for Ledermix Eugenol N, Lösung:ODDB::Sequence (NoMethodError)
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:590:in `block in update_indices'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `each'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:589:in `update_indices'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/cache.rb:515:in `store'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:274:in `odba_isolated_store'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:395:in `block in odba_store_unsaved'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `each'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:392:in `odba_store_unsaved'
        from /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/persistable.rb:380:in `odba_store'
        from /var/www/oddb.org/src/util/oddbapp.rb:1423:in `initialize'
        from bin/oddbd:42:in `new'
        from bin/oddbd:42:in `<main>'

Changing the /var/www/oddb.org/Gemfile to use the branch of yus, change yus specification to gem "yus", :git => 'https://github.com/ngiger/yus.git', :branch => 'without_needle'. Unfortunately use is not yet conform to the bundler world, as I get the following error:

Could not find gem 'yus (>= 0) ruby' in https://github.com/ngiger/yus.git (at without_needle).
Source does not contain any versions of 'yus (>= 0) ruby'

The unit tests work on my developer machine for Ruby 1.8, 1.9 and 2.0. But they fail on Travis-CI because cracklib could not be installed. Commit this patch Added group yus_runtime to avoid errors on travis-ci to fix this problem.

Okay, consulting the Bundler documentation for gem from git http://bundler.io/v1.5/git.html , I see that I must artificially specify a version from the git gem. E.g gem "yus", '1.0.2.alpha', :git => 'https://github.com/ngiger/yus.git', :branch => 'without_needle'

But I still get the same error when launching bin/oddbd. Therefore I try to use the old yusd again. The error about the missing "update" disappeared after reloading the postgres database. However afterward I get the following error in bin/oddbd

error in SBSM::Session#process: /de/gcc
NoMethodError
undefined method `digest' for nil:NilClass
(drbssl://localhost:9997) /opt/src/yus/lib/yus/session.rb:295:in `generate_token'
(drbssl://localhost:9997) /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/drbwrapper.rb:28:in `method_missing'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
error in SBSM::Session#process: /de/gcc

Note: I had clone without_needle branch of yus into /opt/src/yus/. At the same time bin/yusd reported:

I, [2013-11-11T21:05:07.497441 #9281]  INFO -- start: starting yus-server on drbssl://localhost:9997
W, [2013-11-11T21:10:38.003502 #9281]  WARN -- Yus::Server: Token-Authentication failed for ngiger@ywesee.com
I, [2013-11-11T21:10:41.439912 #9281]  INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org
I, [2013-11-11T21:10:41.440187 #9281]  INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com
I, [2013-11-11T21:10:43.727902 #9281]  INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org
I, [2013-11-11T21:10:43.728000 #9281]  INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com
I, [2013-11-11T21:10:49.185800 #9281]  INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org
I, [2013-11-11T21:10:49.185970 #9281]  INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com

Looking at the tests for yus I find that we have no call to generate_token in the test directory. Therefore it is time to activate a coverage report, analysing it and adding the missing tests. Added commit Added default configuration

After pushing/getting these changes and restarting yusd and bin/oddb. I try to enter my login credentials and got the following (good) result for yusd w

I, [2013-11-11T22:17:42.263479 #10176]  INFO -- start: starting yus-server on drbssl://localhost:9997
W, [2013-11-11T22:21:11.403687 #10176]  WARN -- Yus::Server: Token-Authentication failed for ngiger@ywesee.com
I, [2013-11-11T22:22:44.950147 #10176]  INFO -- Yus::Server: Login attempt for ngiger@ywesee.com from oddb.org
I, [2013-11-11T22:22:44.950643 #10176]  INFO -- Yus::Server: Authentication succeeded for ngiger@ywesee.com

but bin/oddb reported the following failure

error in SBSM::Session#process: /de/gcc
NoMethodError
undefined method `hexdigest' for 1:Fixnum
(drbssl://localhost:9997) /opt/src/yus/lib/yus/session.rb:290:in `generate_token'
(drbssl://localhost:9997) /usr/local/lib64/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/drbwrapper.rb:28:in `method_missing'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1508:in `perform'
(drbssl://localhost:9997) /usr/lib64/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'

Therefore my default configuration is used. Why didn't we use the real configuration? Does the persistance not work correctly?

view · edit · sidebar · attach · print · history
Page last modified on November 12, 2013, at 08:34 AM