basecamp / pow

Zero-configuration Rack server for Mac OS X
http://pow.cx/
MIT License
3.41k stars 259 forks source link

Procfile #154

Closed josh closed 13 years ago

josh commented 13 years ago

The Procfile appears to be the new hotness from Heroku. Much of Pow's original design was to make local dev as easy as it is to deploy to Heroku.

I'm not sure how much work it would take, but I'd love to support Procfile in Pow. I still need to play with it some more, but it seems awesome for other things like memcache and redis to automatically spawn up along with your application.

http://devcenter.heroku.com/articles/procfile

mrrooijen commented 13 years ago

Josh, that would be awesome. I just recently tried out Pow and was like: "wtf it actually worked!" but since recently I switched to doing everything with Procfile in development and Upstart (exported via Procfile and Foreman) in production.

This is what my Procfile looks like in development:

rails:    cd rails   && bundle exec unicorn -p $PORT
faye:     cd faye    && bundle exec thin start -R app.ru -p $PORT
monitor:  cd monitor && bundle exec ruby app.rb

It would be great if support could be added for this, not sure what you'd require but all I have to do to get it up and running is to execute foreman start and it just works. Though, it would be nice to be able to specify the port for Foreman: foreman start -p 3000 since for example the Faye process is dependent on Rails' port etc.

I think if somehow support could be added to Foreman, and still be able to specify options/flags, that'd totally kick ass. Foreman is truly awesome and has become a must-use tool in my dev box. :)

lackac commented 13 years ago

This might have been obvious, but here's a plan for implementing this feature:

I'd be happy to help with this (including #61).

andrew commented 13 years ago

@josh seeing as you closed #61, does that mean pow won't support Procfiles?

josh commented 13 years ago

I don't have time to work on it.

ma11hew28 commented 13 years ago

Would love support for this for a Sinatra app hosted on Heroku's Cedar stack. http://devcenter.heroku.com/articles/ruby#declare_process_types_with_foremanprocfile

jimmycuadra commented 13 years ago

Why was this closed? It'd make Pow great for anyone moving to Cedar.

sstephenson commented 13 years ago

Feel free to reopen it with a patch. :)

lackac commented 13 years ago

Patches welcome

A bit more serously though, since I've finished #61, I plan to work on this in the coming weeks. :)

rgabo commented 13 years ago

+1

cyberdelia commented 13 years ago

@lackac If you need help or test, I will be pleased to help.

lackac commented 13 years ago

@cyberdelia thanks, sadly I still don't see exactly when I can get around to work on this. It's important for me though, so I will find the time.

timshadel commented 13 years ago

I've implemented a first cut at support for Foreman applications, including node.js apps, by having Foreman start up the processes, and then proxying requests to a randomly chosen web process (like Heroku does).

Tests:

sstephenson commented 13 years ago

Woah.

josh commented 13 years ago

I'm not sure how this issue turned into a pull request. Can you create a separate pull for this.

josh commented 13 years ago

@timshadel I think this might be a github pull request bug. Can you tell me how you created the pull? For now, I've manually disconnected the association.

timshadel commented 13 years ago

Sure. @technoweenie showed how to do it on this SO thread. I think it's totally awesome, but I could totally be missing the easy way to do what I care about.

Two use cases:

  1. For mauricemach/zappa#61 I used it to turn my own bug report into a pull request (I hate having two open things that are the same problem).
  2. I like finding an existing issue I care about, like this one, with lots of discussion, and attaching a patch to it. It's like commenting, but using code instead of words. :-)

So what am I missing? How do most people do this? New pull request with "closes #original" in the message?

josh commented 13 years ago

I don't think you should be able to edit my issue unless you're a collab or the original author. I'll see about getting that fixed.

timshadel commented 13 years ago

OK. I'll open another one.

lackac commented 13 years ago

Since you haven't opened a new pull request yet, I'm going to comment here.

I've checked out the implementation and tested it with a few apps. It worked wonderfully. I like that all the output from foreman go to the application log.

One issue I've found was the lack of error handling. If foreman is not installed or the version installed doesn't have your patches all requests will hang. Most errors could be easily parse-able from foreman's output and a helpful error message could be presented to the user for each request.