view · edit · sidebar · attach · print · history

20110113-change_condition_followers_run-simplify_installation_oddb

<< | Index | >>


  1. Change condition of followers run, not by using email sending result
  2. Simplify installation oddb suspend
  3. Compile mod_ruby on Windows suspend
  4. Set up a virtual host on Windows

Goal
  • Simplify installation of oddb / 60%
Milestones
  1. Change condition of bsv_followers run, not by using email sending result
  2. Local test 9:30
  3. Change condition of swissmedic_followers run
  4. Local test
  5. Commit 10:00
  6. Simplify installation of oddb
    1. Install Ubuntu on VirtualBox
    2. Install Ruby 1.8.6 with oniguruma patch
    3. Install PostgreSQL 8.4
    4. Check gem version 11:40
    5. Install de.oddb.org through gem suspend
  7. Compile mod_ruby on Windows
Summary
Commits
ToDo Tomorrow
Keep in Mind
  1. On Ice
  2. emerge --sync

Change condition of followers run, not by using email sending result

Experiment

src/util/updater.rb#update_bsv

            return_value_plug_update = nil
            wrap_update(klass, subj) {

        return_value_plug_update = plug.update
        LogFile.append('oddb/debug', " return_value_BsvXmlPlugin.update = " + return_value_plug_update.inspect.to_s, Time.now)

                #if plug.update
                if return_value_plug_update
                    log_notify_bsv(plug, this_month, subj)
                end
            }
            return return_value_plug_update
        end

Run

  • bin/oddbd
  • currencyd
  • ext/meddata/bin/meddatad

Run

  • jobs/import_bsv

Result

log/oddb/debug/2011/01.log

...
2011-01-13 09:25:24 CET return_value_BsvXmlPlugin.update = "/home/masa/ywesee/oddb.org/data/xml/XMLPublications-2011.01.13.zip"
...
2011-01-13 09:25:47 CET getin Net::SMTP
2011-01-13 09:25:47 CET recipient=mhatakeyama@ywesee.com
2011-01-13 09:25:50 CET the first log.notify end
...
2011-01-13 09:25:50 CET getin Net::SMTP
2011-01-13 09:25:50 CET recipient=mhatakeyama@ywesee.com
2011-01-13 09:25:53 CET the second log.notify end
...
2011-01-13 09:25:53 CET getin update_bsv_followers

Note

  • Good

Next

  • swissmedic_followers

src/util/updater.rb#update_swissmedic

    def update_swissmedic(*args)
      logs_pointer = Persistence::Pointer.new([:log_group, :swissmedic])
      logs = @app.create(logs_pointer)
      klass = SwissmedicPlugin
      plug = klass.new(@app)
return_value_plug_update = nil
      wrap_update(klass, "swissmedic") {
        #if(plug.update(*args))
        if(return_value_plug_update = plug.update(*args))
          month = @@today << 1
          pointer = logs.pointer + [:log, Date.new(month.year, month.month)]
          log = @app.update(pointer.creator, log_info(plug))
          log.notify('Swissmedic XLS')
        end
      }
return return_value_plug_update
    end

Reboot bin/oddbd

Run jobs/import_swissmedic

Result

log/oddb/debug/2011/01.log

...
2011-01-13 09:43:18 CET getin Net::SMTP
2011-01-13 09:43:18 CET recipient=mhatakeyama@ywesee.com
2011-01-13 09:43:19 CET getin update_swissmedic_followers

Note

  • Good

Commit

Note

  • This commit changes the condition of followers methods to run
  • update_bsv_followers runs even if the mail sending process fails
  • update_swissmedic_followers as well

Simplify installation oddb

Memo

  • We would like to install ch.oddb.org (oddb.org) and de.oddb.org both on linux and on windows only through gem
    • We do not want to use 'emerge' command and to compile source code, etc.

Set up environment

 masa@masa-VirtualBox:/media/VBOXADDITIONS_4.0.0_69151$ sh autorun.sh 
  • and reboot
 masa@masa-VirtualBox:~$ su passwd postgres
 masa@masa-VirtualBox:~$ su postgres
 postgres@masa-VirtualBox:/home/masa$ createdb testdb
 postgres@masa-VirtualBox:/home/masa$ psql testdb
 testdb=# \l
 testdb=# \q
  • Install Ruby 1.8.6 with oniguruma patch
    • Install patch command
 sudo apt-get install patch
  • Install vim
 sudo apt-get install vim
 ~/src$ tar zxvf ruby-1.8.6-p369.tar.gz
 ~/src$ tar zxvf oniguruma_patch_for_ruby-1.8.6_p369.20100615_from_Hannes-san.tar.gz
 ~/src$ cd oniguruma/
 ~/src/oniguruma$ ./configure --with-rubydir=/home/masa/src/ruby-1.8.6-p369
 ~/src/oniguruma$ make 186
 ~/src/oniguruma$ cd ../ruby-1.8.6-p369/
 ~/src/ruby-1.8.6-p369$ mkdir ~/bin
 ~/src/ruby-1.8.6-p369$ ./configure --prefix=/home/masa/bin
 ~/src/ruby-1.8.6-p369$ make
 ~/src/ruby-1.8.6-p369$ make install
  • set PATH
 ~$ vim ~/.bashrc
 export PATH=$PATH:/home/masa/bin/bin
 ~$ source ~/.bashrc
  • Check ruby working
 ~$ ruby -v
 ruby 1.8.6 (2009-06-08 patchlevel 369) [i686-linux]
  • Install gem
 ~$ sudo apt-get install rubygems1.8
  • Check gem working
 ~$ gem -v
 1.3.7
  • Check gem list locally
 ~$ gem list

 *** LOCAL GEMS ***
  • set PATH
 ~$ vim ~/.bashrc
 export PATH=$PATH:/home/masa/bin/bin:/var/lib/gems/1.8/bin
 ~$ source .bashrc

Set up de.oddb

  • Install
    • de.oddb
    • rclconf
 ~$ sudo gem install de.oddb
 ~$ sudo gem install rclconf

suspend

Compile mod_ruby on Windows

mod_ruby source code

Install Apache on Windows7

Installer

Setting

  • Network Domain: localdomain
  • Server Name: localhost
  • Administrator's Email Address: mhatakeyama@ywesee.com
  • Custom
    • Select 'Build Headers and Libraries'
  • Check Apache working
 It Works!

Note

  • Ruby script can work on Apache even if there is not mod_ruby

Reference

Note

  • I cannot find httpd-2.0.47, and mod_ruby-1.1

Set up a virtual host on Windows

Change hosts

  • exec 'Editor' als Administrator ausfuhlen (as an administrator)
  • open C:\Windows\System32\drivers\etc\hosts
	127.0.0.1       localhost vhost.localhost
view · edit · sidebar · attach · print · history
Page last modified on January 13, 2011, at 05:03 PM