Calagator on Heroku, Ruby 1.9.2, Rails 3.0.10 and PostgreSQL

57 views
Skip to first unread message

Igal Koshevoy

unread,
Oct 17, 2011, 12:47:58 AM10/17/11
to calagator-...@googlegroups.com, pdx-tech-calendar
We've had a number of requests recently from folks wanting to run their own Calagator, but didn't want to become expert sysadmins and Ruby deployment specialists just so they could run this on app. I've been exploring the use of Heroku, a free/cheap service that allows one to easily run Ruby web apps. If this works well, I hope more people will be able to get their own Calagator running.

I've created an experimental branch of Calagator that works with Heroku, which you can see running at http://calagator-demo.heroku.com/

You will find my code in the "with_heroku" branch, and usage instructions at https://github.com/calagator/calagator/blob/with_heroku/HEROKU.md

Getting Calagator running on Heroku has required a whole lot of changes:
* Port to Ruby on Rails 3.0.10 and add monkeypatches that fix its bugs.
* Port to Ruby 1.9.2 and fix code that relied on Ruby 1.8.x's questionable behavior.
* Port to PostgreSQL and fix code that relied on sqlite3's very naughty behavior.
* Fork the "mofo" gem and rework it to support Ruby 1.9.2 and Nokogiri, because there are no Ruby libraries for parsing hCalendar any more -- all three libraries that did this have been broken and abandoned for years.

This code should run correctly on Ruby MRI 1.8.7, REE 1.8.7, and YARV 1.9.2, with sqlite3 and PostgreSQL. I hope to merge all code that's not Heroku-specific back into the "rails_3" branch and later the "master" branche, so everyone using the source code can take advantage of them.

There are some additional non-urgent tasks that should be done:
* Making it possible to use Heroku's configuration variables instead of committing the secrets/themes/keys files into the repository.
* Make it possible to autodetect whether to use JS and CSS caching in themes.
* Make it possible to configure caching to use memcache, rather have it always use files. This is necessary if more than one Heroku dyno is serving the site.
* Make it possible to use our Sunspot search engine with Heroku's Solr service.

Please try this code out and report any issues you encounter so we can make this work. If you can contribute fixes to the code or improve the text in the documentation, that'd be awesome and I'd love to get your help. Thanks!

-igal

Igal Koshevoy

unread,
Oct 17, 2011, 12:55:41 AM10/17/11
to calagator-...@googlegroups.com, pdx-tech-calendar
On Sun, Oct 16, 2011 at 9:47 PM, Igal Koshevoy <ig...@pragmaticraft.com> wrote:
>
> You will find my code in the "with_heroku" branch, and usage instructions at

The link above should be:
https://github.com/calagator/calagator/blob/with_heroku/HEROKU.md

Gmail got too clever and specified a different link and text.

The "with_ruby192" branch also contains a "HEROKU.md" file that's
different and more complex because it doesn't contain the
Heroku-specific patches.

-igal

Igal Koshevoy

unread,
Oct 17, 2011, 3:27:33 PM10/17/11
to calagator-...@googlegroups.com, pdx-tech-calendar
On Mon, Oct 17, 2011 at 10:15 AM, Bryan Jacobson
<bryans.a...@gmail.com> wrote:
> Igal, awesome! Thank you!

Welcome. There's also a Citizenry (http://epdx.org) angle to this.
We'd like to make it easier for folks to deploy Citizenry and will
reuse any solutions we come up with.

-igal

Igal Koshevoy

unread,
Oct 17, 2011, 3:40:36 PM10/17/11
to John Sechrest, pdx-tech-calendar, calagator-...@googlegroups.com
On Mon, Oct 17, 2011 at 12:34 PM, John Sechrest <sech...@gmail.com> wrote:
> I am glad to see this happen.
Thanks.

> Is there any specific simple testing you want done? Any particular part of
> the system you want to have exercised?

Good question:

* Site testing. You only need a web browser for this. Just click
through http://calagator-demo.heroku.com and report any situation
where you get a server error. I can't fully simulate the Heroku
environment on my own computer nor run tests on it, so manual testing
will help catch the remaining cases where Heroku works differently.

* Documentation testing: You'll need a bit more Ruby for this, but
work through the HEROKU.md documentation and see if you can get a
server deployed, report problems, and offer suggestions for improving
this documentation.

Thanks!

-igal

John Sechrest

unread,
Oct 17, 2011, 5:10:33 PM10/17/11
to Igal Koshevoy, pdx-tech-calendar, calagator-...@googlegroups.com
Ok. I will walk thru the calendar and test the corners from a user point of view.

I have just gotten started with git, heroku and ruby, so I will likely make a good test dummy for that. I will let you know where I get stuck.

--
John Sechrest          .             
                                       .                   
                                             .                        
                                                     .                               
                                                               .                      sech...@gmail.com
                                                                          .                              @sechrest 
                                                                                        .
        http://www.oomaat.com                                                              .

Igal Koshevoy

unread,
Oct 17, 2011, 6:00:37 PM10/17/11
to John Sechrest, pdx-tech-calendar, calagator-...@googlegroups.com
On Mon, Oct 17, 2011 at 2:10 PM, John Sechrest <sech...@gmail.com> wrote:
> Ok. I will walk thru the calendar and test the corners from a user point of
> view.
> I have just gotten started with git, heroku and ruby, so I will likely make
> a good test dummy for that. I will let you know where I get stuck.

Thanks for the offer and context.

My current instructions assume a fair amount about the person having
things like Ruby present and knowing how to use it.

I've begun a rewrite of the HEROKU.md documentation with the goal of
making them friendlier to those new to Ruby and explaining things like
installing Ruby, Git, etc.

I'll post a note when I'm done.

-igal

Igal Koshevoy

unread,
Oct 17, 2011, 7:02:55 PM10/17/11
to John Sechrest, pdx-tech-calendar, calagator-...@googlegroups.com
On Mon, Oct 17, 2011 at 3:00 PM, Igal Koshevoy <ig...@pragmaticraft.com> wrote:
> I've begun a rewrite of the HEROKU.md documentation with the goal of
> making them friendlier to those new to Ruby and explaining things like
> installing Ruby, Git, etc.

Done. You can see the revised instructions at:

https://github.com/calagator/calagator/blob/with_heroku/HEROKU.md

This documentation contains two options:
1. Simple setup where you just need the basic tools to deploy
Calagator to Heroku. These should allow someone to deploy Calagator to
Heroku in about 5 minutes.
2. Developer setup where you can also run Calagator on your computer
in development mode. This involves setting up a compiler, PostgreSQL,
etc, and is quite a bit more effort because there's much I can't
provide exact instructions for due to variances in individual systems.
Eventually, I'd like to have the INSTALL.md cover much of this and
incorporate the changes into the Vagrant configuration too.

-igal

Reply all
Reply to author
Forward
0 new messages