Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 374931 - GSoC 2011 - Rails hosting for Council web app
Summary: GSoC 2011 - Rails hosting for Council web app
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Other web server issues (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Infrastructure
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 09:46 UTC by Joachim Bartosik (RETIRED)
Modified: 2011-09-13 19:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Config that worked for me (00_default_vhost.conf,466 bytes, text/plain)
2011-07-27 14:41 UTC, Joachim Bartosik (RETIRED)
Details
A Capistrano deploy.rb file that worked for me (deploy.rb,425 bytes, text/plain)
2011-08-02 11:48 UTC, Joachim Bartosik (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Bartosik (RETIRED) gentoo-dev 2011-07-12 09:46:17 UTC
The sources for Rails application are in site/ directori inside repo:

http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=summary

it uses Bundler to manage gems, tested with MySQL 5.1. Currently there is no dependency on mysql in Gemfile, so you will have to apply

https://github.com/ahenobarbi/Gentoo-Council/commit/beff3676a2f995371619785d706d296ac904ccb2

or manually add mysql gem dependency.

Reproducible: Always
Comment 1 Petteri Räty (RETIRED) gentoo-dev 2011-07-16 19:02:50 UTC
The mysql gem has been added a while ago to the gentoo repository.
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-07-18 20:31:30 UTC
Can you please include some instructions for deployment, like the recruiting webapp?

http://git.overlays.gentoo.org/gitweb/?p=proj/recruiting-webapp.git;a=blob;f=README;h=93a9d08f2fd9e6f802cf695fd47b7ff1ee7e53d6;hb=master

Also, that README has "gem install bundler", which should be "emerge bundler" instead.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-07-18 20:32:10 UTC
Lastly, where do we want this to live?
There is already http://council.gentoo.org/ which directs to the Council project page.
Comment 4 Petteri Räty (RETIRED) gentoo-dev 2011-07-18 20:49:39 UTC
(In reply to comment #3)
> Lastly, where do we want this to live?
> There is already http://council.gentoo.org/ which directs to the Council
> project page.

Council members: Opinions? Do we want to change that to stop redirecting and use that or come up with a new subdomain?
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2011-07-18 21:16:07 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Lastly, where do we want this to live?
> > There is already http://council.gentoo.org/ which directs to the Council
> > project page.
> 
> Council members: Opinions? Do we want to change that to stop redirecting and
> use that or come up with a new subdomain?

I assume the council.gentoo.org uri does not receive too much traffic so I would like to see the council application live in that subdomain instead of using a subfolder in this subdomain
Comment 6 Fabian Groffen gentoo-dev 2011-07-18 21:26:35 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Lastly, where do we want this to live?
> > There is already http://council.gentoo.org/ which directs to the Council
> > project page.
> 
> Council members: Opinions? Do we want to change that to stop redirecting and
> use that or come up with a new subdomain?

No.  Just put it under a subdir, /webapp or something.
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-07-18 21:28:42 UTC
A subdirectory is not possible, as the webapp will be living on a different host than the main www redirect.
Comment 8 Fabian Groffen gentoo-dev 2011-07-18 21:35:41 UTC
If it's technically speaking not an option, then why do we need to discuss it?  I'm inclined to say "just do it", or find some nice other cname for it and add the appropriate redirects for a subdir.  Seems to me, you guys know best how to do this well, council only needs to know the final url how to reach it best.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-07-18 21:37:26 UTC
The question that I meant was:
Option A: Reuse the council.g.o subdomain
Option B: Use a new subdomain (suggestion of name needed)
Comment 10 Petteri Räty (RETIRED) gentoo-dev 2011-07-18 21:43:29 UTC
(In reply to comment #9)
> The question that I meant was:
> Option A: Reuse the council.g.o subdomain
> Option B: Use a new subdomain (suggestion of name needed)

Option A is ok to me.
Comment 11 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-07-19 13:20:47 UTC
(In reply to comment #9)
> The question that I meant was:
> Option A: Reuse the council.g.o subdomain
> Option B: Use a new subdomain (suggestion of name needed)

I wouldn't touch option A. I think many people may already be used to get to the council page through the http://council.gentoo.org "shortcut". Furthermore, should the council webapp be public? Do we need / want to allow non council members to use it?
Comment 12 Joachim Bartosik (RETIRED) gentoo-dev 2011-07-19 13:37:40 UTC
(In reply to comment #11)
> Furthermore, should the council webapp be public? Do we need / want to allow
> non council members to use it?

Non-council members can submit ideas using the webapp. So probably they should have access to it.
Comment 13 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-07-19 13:51:08 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Furthermore, should the council webapp be public? Do we need / want to allow
> > non council members to use it?
> 
> Non-council members can submit ideas using the webapp. So probably they should
> have access to it.

Right, that is what I was thinking about.
In that case, why not keep the current redirection to the council project page and add there a link to the webapp?
About the cname, council-webapp.gentoo.org ?
Comment 14 Markos Chandras (RETIRED) gentoo-dev 2011-07-19 15:03:03 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > (In reply to comment #11)
> > > Furthermore, should the council webapp be public? Do we need / want to allow
> > > non council members to use it?
> > 
> > Non-council members can submit ideas using the webapp. So probably they should
> > have access to it.
> 
> Right, that is what I was thinking about.
> In that case, why not keep the current redirection to the council project page
> and add there a link to the webapp?
> About the cname, council-webapp.gentoo.org ?

Isn't that a bit too complicated to remember? I would suggest to use council.gentoo.org for the web-application and put a hyperlink on the index page of that application pointing to the council project page.
Comment 15 Fabian Groffen gentoo-dev 2011-07-19 15:16:13 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Right, that is what I was thinking about.
> > In that case, why not keep the current redirection to the council project page
> > and add there a link to the webapp?
> > About the cname, council-webapp.gentoo.org ?
> 
> Isn't that a bit too complicated to remember? I would suggest to use
> council.gentoo.org for the web-application and put a hyperlink on the index
> page of that application pointing to the council project page.

FWIW I'd do it the other way around.  Keep the general info page at council.g.o (makes most sense, and is consistent with others) and give it a link to c-w.g.o.
Comment 16 Ulrich Müller gentoo-dev 2011-07-25 16:44:23 UTC
I don't have a strong opinion on this, but I would prefer if http://council.gentoo.org/ was kept for the main council page.
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2011-07-26 12:56:09 UTC
I concur with grobian and ulm.
Comment 18 Petteri Räty (RETIRED) gentoo-dev 2011-07-26 12:58:35 UTC
(In reply to comment #17)
> I concur with grobian and ulm.

infra: council-webapp seems to have a majority opinion so please setup the application there.
Comment 19 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-07-26 23:44:18 UTC
@joachim: in comment #2, I asked for any specific deployment instructions, and didn't hear any response from you.
Comment 20 Joachim Bartosik (RETIRED) gentoo-dev 2011-07-27 14:41:25 UTC
Created attachment 281139 [details]
Config that worked for me

Steps to run with passenger:

1. Clone git repository

2. Configure install and configure MySQL, Apache, passenger (my vhost config attached). Remember that the web app is in

    $(repo_directory)/site

3. In

    $(repo_directory)/site

run

    bundle install
    bundle exec rails g hobo:rapid
    touch tmp/restart.txt

4. Check if everything works fine.

If you want to use capistrano I can write instructions for that.
Comment 21 Joachim Bartosik (RETIRED) gentoo-dev 2011-08-02 11:48:13 UTC
Created attachment 281819 [details]
A Capistrano deploy.rb file that worked for me

If you would like to use capistrano for deployment:

1. Install capistrano and git on your machine
2. Clone repository
2. Run

    cd /path/to/your/clone/site && capify .

3. Customise

    config/deploy.rb

use attached file as base.

4. Install git and bundler on host on which you will deploy
5. Configure passenger on target host
6. Run (on you develpment machine)

    cap deploy:setup
    cap deploy

7. (reason why you might like to go through previous steps) When you want to update application just run

   cap deploy
Comment 22 Joachim Bartosik (RETIRED) gentoo-dev 2011-08-29 17:29:26 UTC
Also you will need to run

    rake db:schema:load

in

    $(repo_directory)/site
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-02 23:03:28 UTC
$ RAILS_ENV=production bundle exec rails g hobo:rapid
/var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:59:in `taglib_filename': No such taglib: taglibs/auto/rapid/cards {:type=>:include, :template_dir=>"app/views/taglibs", :src=>"taglibs/auto/rapid/cards"} /var/www/council-webapp.gentoo.org/site/app/views/taglibs/auto/rapid/cards.dryml (Dryml::DrymlException)
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:10:in `get'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/dryml_builder.rb:118:in `import_taglib'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/dryml_builder.rb:91:in `build'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/dryml_builder.rb:75:in `each'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/dryml_builder.rb:75:in `build'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/template.rb:75:in `compile'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:105:in `load'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:67:in `initialize'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:15:in `new'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml/taglib.rb:15:in `get'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml.rb:45:in `precompile_taglibs'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml.rb:44:in `each'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml.rb:44:in `precompile_taglibs'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml.rb:43:in `chdir'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/bundler/gems/hobo-6051f2f6b1f3/dryml/lib/dryml.rb:43:in `precompile_taglibs'
	from /var/www/council-webapp.gentoo.org/site/config/initializers/dryml_taglibs.rb:16
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:227:in `load_dependency'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:201
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:200:in `each'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/engine.rb:200
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
	from /var/www/council-webapp.gentoo.org/site/config/environment.rb:20
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/application.rb:103:in `require_environment!'
	from /var/www/council-webapp.gentoo.org/site/vendor/bundle/ruby/1.8/gems/railties-3.0.3/lib/rails/commands.rb:16
	from script/rails:6:in `require'
	from script/rails:6
Comment 24 Joachim Bartosik (RETIRED) gentoo-dev 2011-09-03 08:50:29 UTC
Please run just

    bundle exec rails g hobo:rapid

(not in production mode). Apparently this generator works correctly only in development environment.
Comment 25 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-04 03:14:52 UTC
I kicked your app a bit more and it runs now, but seems rather slow:
https://council-webapp.gentoo.org/

Please run your own tests on it, and if it's good, then we can promote it to a production machine (will be moved w/ database intact).
Comment 26 Petteri Räty (RETIRED) gentoo-dev 2011-09-04 07:19:58 UTC
(In reply to comment #25)
> I kicked your app a bit more and it runs now, but seems rather slow:
> https://council-webapp.gentoo.org/
> 
> Please run your own tests on it, and if it's good, then we can promote it to a
> production machine (will be moved w/ database intact).

The first page load took quite a while. Is passenger configured so that it always keeps a worker ready (I don't know much about passenger but this is my guess)?
Comment 27 Joachim Bartosik (RETIRED) gentoo-dev 2011-09-05 18:55:53 UTC
Setting PassengerPoolIdleTime to 0 could solve the problem [0], [1].

[0] http://modrails.com/documentation/Users%20guide%20Apache.html#PassengerPoolIdleTime
[1] http://modrails.com/documentation/Users%20guide%20Apache.html#PassengerPoolIdleTime
Comment 28 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-07 00:54:42 UTC
I don't think that's quite it, but I've changed some other parameters anyway, and it seems to be snappier (I gave myself admin powers too for testing, create a user for yourself and I'll grant the same admin flag to you for testing).

While testing it, here's a bug for you:

Started GET "/users/2-robin-h-johnson/account" for xxxx at Wed Sep 07 00:52:54 +0000 2011
  Processing by UsersController#account as HTML
  Parameters: {"id"=>"2-robin-h-johnson"}
Rendered controller: users; dryml-tag: account-page (143.8ms)
Completed   in 156ms

ActionView::Template::Error (undefined method `email_address' for #<User:0x2ad003fb7b8>):
0  app/views/taglibs/auto/rapid/forms.dryml:85:in `form__for_user'
  app/views/taglibs/auto/rapid/forms.dryml:84:in `form__for_user'
  app/views/taglibs/themes/clean/clean.dryml:2:in `page'
  app/views/taglibs/themes/clean/clean.dryml:1:in `page'
Comment 29 Petteri Räty (RETIRED) gentoo-dev 2011-09-13 19:23:20 UTC
(In reply to comment #28)
> 
> While testing it, here's a bug for you:
> 

Filed as https://bugs.gentoo.org/show_bug.cgi?id=382873
As we are running let's do further fixing in new bugs.