MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Guide for using bot in Heroku

Open m33Lucky opened this issue 10 years ago • 19 comments

Can some make a detailed guide to use bot on heroku

m33Lucky avatar Sep 20 '16 15:09 m33Lucky

Also I tried to fire up there and did not work.

mefjiu avatar Sep 20 '16 15:09 mefjiu

@m33Lucky Why don't you have a go at it and someone can help you through it?

laxdog avatar Mar 07 '17 21:03 laxdog

I was also interested in this! I could do this work (could even one-click-deploy), but I'd want to rip out a few pieces and abstract/decouple them more... is this already being done in another branch or is it on the roadmap?

ckcollab avatar Mar 26 '17 21:03 ckcollab

This is being done to an extent as part of the unit test work.

There's a few other things I was planning on doing around it too, if it'll help with this though I can expedite it.

Was there something in particular @ckcollab you were thinking of?

laxdog avatar Mar 27 '17 09:03 laxdog

Configuration is a big one, it's tied to this file and class, where it should probably be coming from environment variables... ideally... but it is so nice how easy it is right now to get going if you don't know what environment variables are...

I would propose switching to yaml files (nicer to edit as a human) and mapping all of the same settings to env vars. Completely get rid of the settings class and replace it with a few lines loading yaml if it's there, loading default if not, prompting for key/secret, save yaml file for them, and then go on like normal.

Then with both yaml + env vars handled we have the nicest "human editable" format as well as easy server setup (Heroku, docker .env files, etc.).

Does that sound like too much work for too little benefit? I've already done a bit of this but it's kind of janky and I'm very nervous to mess with this stuff :)

ckcollab avatar Mar 27 '17 10:03 ckcollab

I'm also interested on this :)

HostFat avatar Apr 26 '17 14:04 HostFat

Can the dev add something like an official bitcoin address to donate for the bounty of this feature?

HostFat avatar May 01 '17 05:05 HostFat

I would say this shouldn't go on heroku, free version at least. Requires significant rewriting to work there. Wsgi server, task queue, etc etc etc

Can be done, much simpler otherwise.

ckcollab avatar May 01 '17 05:05 ckcollab

And to be clear I will do this if you want but it'll cost probably 10 billable hours, at least.

ckcollab avatar May 01 '17 05:05 ckcollab

I'm not sure if this info can help to limit the work required:

https://devcenter.heroku.com/articles/free-dyno-hours

By verifying a credit/debit card, free dyno hours are 1000.

and

"Worker-only Free dynos do not sleep since they do not respond to web requests. Be mindful of this as they may run 24/7 and consume from your pool of hours."

Anyway, maybe if more people donate for this feature, it will receive a good amount of BTC. (I'm not sure about this :) )

HostFat avatar May 01 '17 05:05 HostFat

Right, like I said, it could work on there but running 24/7 won't work. That's why you need a task queue or something to spin up every-so-often.

ckcollab avatar May 01 '17 06:05 ckcollab

Well, I'm not sure how the free dyno hours are used and calculated, but if they are "hours", 1000 hours every-month, "for only 1 app", they are a lot :)

It shouldn't need the task queue system.

HostFat avatar May 01 '17 06:05 HostFat

It shouldn't need the task queue system.

It may not need a task queue, but it can't run 24/7, and this is meant to run 24/7.

Feel free to write it if you have the solution in mind ;)

ckcollab avatar May 01 '17 06:05 ckcollab

Why it can't run 24/7 ?

The larger month is of 31 days, so 744 hours ...

HostFat avatar May 01 '17 06:05 HostFat

Because it will go to sleep after 30 min idle... you need it to stay awake and continue processing on its own, you may be able to easily do this with a Heroku scheduler of some sort (task queue). Not to mention, you will also need to setup WSGI (I believe) among other things to make this run on Heroku. It just uses SimpleHTTPServer now not gunicorn/uwsgi/etc.

ckcollab avatar May 01 '17 07:05 ckcollab

Ok.

And what does it mean with this? "Worker-only Free dynos do not sleep since they do not respond to web requests."

Can the bot set as "Worker-only"?

HostFat avatar May 01 '17 07:05 HostFat

Can the bot be set as "Worker-only"?

...try it out :)

ckcollab avatar May 01 '17 07:05 ckcollab

Oh! Also, Heroku filesystem is ephemeral so you'll have to get default.cfg generated somewhere in there. Can probably store it on S3 and download it in a custom buildpack.

ckcollab avatar May 01 '17 07:05 ckcollab

Closing, this isn't happening.

laxdog avatar Aug 04 '17 08:08 laxdog