-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get up and running on Heroku #2
Conversation
Looks nice, it will be awesome to see it fully operational on Heroku. Currently you can't do much, it crashes here: http://hubot-control.herokuapp.com/hubots/new I'll take a look at this PR a little later. |
Yeah, I was still in the middle of working on this. Fixed the crash at least. Currently requires a custom buildpack that can run Rails and install node.js dependencies (I'm using https://github.com/rtgibbons/heroku-buildpack-ruby-nodejs). One issue is that Heroku doesn't let you publicly expose random ports, but perhaps this can be solved via simple proxy on the Rails side. |
Well, that and the fact that I still haven't successfully started a hubot instance. But I think it's almost there. |
@michaelmior Still having trouble getting a hubot running? If so, are you looking to run it locally or on Heroku and what adapter are you trying to run with? |
Trying to get it running on Heroku with the shell adapter. It seems to start fine and then die. I can give you access to the app if you'd like if you let me know what email address you use for Heroku. (Same goes for you @spajus) |
The issue may be Heroku killing the additional processes that get spawned. (Also just a note that updated commit is courtesy of @crawfordcomeaux :) ) |
crawford.comeaux@gmail.com ...I'll see what I can do, but I'm new to hubot, so I'll need to figure out the shell adapter locally first. Also, from playing with the irc adapter, I can say you need to be wary of where you're getting the adapters from. Went through several different sources before realizing they all suffered from the same bug that was making my bot flood. 2 hours to learn I should change a single env var in an undocumented way. |
Everything I've read so far on the shell adapter says that it's not for production & really just meant for local testing. Is there a use case for trying to get it working on Heroku? |
It's the simplest adapter and a good test case. No one would actually use it in production, but it makes sense to start with the simplest adapter possible. |
The irc adapter's pretty easy to get up. I'd give it a shot & see if you have the same issues. I think you're probably right about Heroku killing the spawned processes. |
I've tried the IRC adapter as well. Again, just more opportunities for failure there, so I'd rather get the shell adapter working first. It's quite possible that getting this running in a straightforward way is not at all possible on Heroku, but I thought it was worth a shot. |
@michaelmior, you could try running a campfire adapter, it's built in and should require no extra dependencies. Shell adapter works a bit differently, and there is a special mode for that: http://hubot-control.herokuapp.com/hubots/1/interact The goal is to be able to start a hubot and keep it up, if Heroku allows running extra processes in the background. hubot-control forks a new top-level process for starting Hubot, so that you can reboot or shutdown hubot-control app, and your Hubot will still be running. Not sure if that's easily achievable on Heroku. |
Looks like I got hubot-irc bot running: http://hubot-control.herokuapp.com/hubots/6 Had to add to
|
return 8000, 9000 | ||
end | ||
ports = Hubot.select("max(port) as port, max(test_port) as test_port").take! | ||
return ports.port || 8000, ports.test_port || 9000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue (#3) is solved in master. You should merge.
I think I discovered the problem: ntwitter's used by hubot, but isn't set as a dependency in package.json. |
Adding ntwitter to hubot-control's package.json looks like it may have done the trick. I pushed the change to heroku & now crawbot at least spits something out into the log before dying. Oddly enough, it seems like you guys are running the latest hubot (2.5.5), but that's supposed to be resolved in that version. |
@@ -1,11 +1,10 @@ | |||
source 'https://rubygems.org' | |||
|
|||
ruby '2.0.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to use ruby 2.0.0 for Heroku? It would be nicer to keep lower requirements for those who can't upgrade their rubies yet.
Merged into master |
Note that this could probably use an extra section in the README as there are a couple extra steps beyond a typical Heroku install. |
Yes, I just linked README to this pull request for now. |
Okay, then I'll just point out that until the linked issue in the buildpath is resolved, you'll also need to run the following after creating the app.
|
This is a first pass at easily getting the app running on Heroku. With this merged into master, you should be able to
You can see a demo at http://hubot-control.herokuapp.com/. Some node stuff still needs to be installed to actually get Hubot working, but I figured I would share what I've got so far. Note that this also includes a fix for #1 (I just ran
rails g bootstrap:install
)