This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] Documenting deployment with Heroku

Asheesh Laroia lists at asheesh.org
Mon Jun 11 21:01:17 UTC 2012


Excerpts from Daniel Mizyrycki's message of Sun Jun 10 15:13:50 -0400 2012:
> Hi Asheesh,
> Here is what I saw:
> 
> * Heroku cli tools are based on rubi. I thing for the installation 
> purpose is worth mention to install the package rubygems, and then 
> install heroku as their instructions only support Debian based systems 
> for linux. My biggest concern was to install rubi on my system (Centos 
> 6) but rubygems are a total of 3.2MB of rpm including dependencies! For 
> Redhat systems would be Something along these lines:
> 
> yum install git rubygems   (just about 3Mb rpms)
> gem install heroku
> 

Interesting; I hadn't realized how Debian/Ubuntu-centric the instructions
are, for Linux systems.

I think it makes sense to document other ways to install the Heroku stuff.
I'd much prefer to link to Heroku-written docs on this in general.

> * heroku 2.26.6 client  already does he following step automatically, so 
> it might be confusing to repeat it.
> 
> # Configure a remote branch for pushing to heroku
> git remote add heroku git at heroku.com:ohdevel.git

Interesting; for me, the Heroku client *used* to do that, but then for
some reason stopped doing it. Maybe the right fix is to adjust our docs
to assume it does work, but to provide instructions as to what to do if
it doesn't. (I'm thinking, it should tell you to run "git remote -v"
and ask you to look at the output to verify something Heroku-related
shows up. If not, it tells you what to do.)

I'm on Heroku client 2.25.0 at the moment.

> 
> * The following step brought up the fact that the procedure does not 
> install lxml.
>    This may  or may not be an issue.
> 

This happens not to be an issue, but it'd be good to state that up-front.

> # Populate the database
> heroku run --app ohdevel python manage.py syncdb --noinput
> 
> ( INFO     Some parts of the OpenHatch site may fail because the lxml 
> library
>   is not installed. Look in ADVANCED_INSTALLATION.mkd for information 
> about lxml)

Good; this is very important.

> * At last I got:
> 
> # Get the URL of our new website
> heroku apps:info --app ohdevel
> 
> ( Application Error
> 
> An error occurred in the application and your page could not be served. 
> Please
> try again in a few moments.
> 
> If you are the application owner, check your logs for details. )

Interesting. It really should work at this point. Can you share the logs?

> * At this point I realized running migrations is mandatory. Although the 
> document does mention migration are not running properly, it sorts of 
> imply the entire procedure will achieve some sort of successful 
> deployment which I wasn't able to see following the instructions. I feel 
> we should address the issue either, stating the Heroku deployment 
> procedure is work in progress, or giving the instructions to achieve the 
> state where we have a 'temporary deployment where you don't mind erasing 
> the database later.' I am missing something?

Because of a special hack in mysite/settings.py , we disable migrations
on Heroku. That means that the 'syncdb --noinput' will create all DB
tables, even those that normally would require migrations.

(Look for "### If we are running on Heroku" in mysite/settings.py and
you'll see what I mean.)

I'm going to test these instructions right now, once again, and
see if I can replicate your problem.

> * I tried to work in the Heroku environment (with heroku run shell) to 
> be able to debug what it is  happening. I am perplexed that there is no 
> vim, nano, and even less! The environment is debian sid. dpkg is blocked 
> for root use, and it doesn't seem one can become root. Do we need to 
> upload binaries as part of a deployment for troubleshooting at Heroku?

Well yeah, you're not supposed to do much editing of code/setings within
Heroku. The key is to get them right from the start with the data that
you transfer to Heroku when you do the 'git push'.

> I am very pleased at the speed the Heroku deployment went so far and 
> look forward helping this procedure works as advertised.

(-: !

-- Asheesh.


More information about the Devel mailing list