Hacker News new | ask | show | jobs
by mrkurt 5497 days ago
Oh, hey, it appears you can run python stuff too: https://gist.github.com/0a08e676559fc03e6200

  kurt$ heroku run bash
  Running bash attached to terminal... up, run.2
  ~ $ python -V
  Python 2.7.1
  ~ $
3 comments

Huh, so the Python support is pretty complete:

Simple Flask app: https://gist.github.com/efec5e060e88abc87821

Python/Django: https://gist.github.com/866c79035a2d066a5850

Wow, it gets even more interesting:

  /tmp $ cd redis-2.2.8/
  /tmp/redis-2.2.8 $ make
  /tmp/redis-2.2.8 $ cd src
  /tmp/redis-2.2.8/src $ ./redis-server 
  [295] 31 May 15:36:30 # Warning: no config file specified, using the default config. In   order to specify a config file use 'redis-server /path/to/redis.conf'
  [295] 31 May 15:36:30 * Server started, Redis version 2.2.8
  [295] 31 May 15:36:30 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
  [295] 31 May 15:36:30 * The server is now ready to accept connections on port 6379
  [295] 31 May 15:36:30 - 0 clients connected (0 slaves), 790480 bytes in use
  [295] 31 May 15:36:35 - 0 clients connected (0 slaves), 790480 bytes in use
  [295] 31 May 15:36:40 - 0 clients connected (0 slaves), 790480 bytes in use
Absolutely none of this is officially supported, right? (It looks very much like "game on, DotCloud", from what you've been finding, though....)
I don't think any of it's supported. Redis will run, but you can't exactly get to it (no TCP routing mesh apparently). It really just seems like they made it really easy to add new languages.
This is because running commands is from a one-off dyno vs. the formation dyno's that have requests routed to them.

See: http://devcenter.heroku.com/articles/oneoff-admin-ps

From their new homepage (http://www.heroku.com) :

  "Run Anything
   Run and scale any type of app."
Also Go and Erlang

    ~ $ go
    gobject-query  godefs         godoc          gofix          gofmt          goinstall      gomake         
    gopack         gopprof        gotest         gotry          gotype         govet          goyacc         
    ~ $ erl
    erl   erlc
How do you output from bash/terminal to text like that?
Type part of what you want, then hit tab twice.
Yep, Python works great so far, I threw up a little cookbook recipe for a Pyramid app: http://docs.pylonsproject.org/projects/pyramid_cookbook/dev/...

Since its fairly easy to composite multiple WSGI apps together, one could run a few different Python WSGI-based apps under a single multi-threaded process to take full advantage of the free quota. That would work with Pylons/Pyramid/Flask and other Python web frameworks that don't rely on a single set of module global settings (Django).