osm / icka

16 stars 7 forks source link

Is it possible to run in Heroku? #6

Closed Deihmos closed 2 months ago

Deihmos commented 3 years ago

I tried but it failed. It tried to excite bin/icka but that does not work. Is this possible?

Luni-4 commented 3 years ago

I can run icka on Heroku through the worker process. So I set up the Procfile in this way:

worker: ./bin/icka -forever

and scaled up the number of free dynos with this command: heroku ps:scale worker=1. It works perfectly.

Unfortunately this is not optimal because with the -forever option the app never sleeps. The best way would be to implement a web server that sleeps for an hour, then wakes up, perform its task and finally goes back to sleep again. In this way we could use the web process without spending free dynos

Deihmos commented 3 years ago

Do you have to use the -forever ? Couldn't I use the scheduler to start the app hourly?

Luni-4 commented 3 years ago

I used the -forever option because I had set up the worker process, but if you know how to use the scheduler to start the app hourly, that would be great! Unfortunately, I wasn't able to do that

larakel1 commented 3 years ago

Im very newbie, i tried the following with Heroku first, heroku login git clone https://github.com/osm/icka.git cd Icka heroku create

In heroku web i config var set ICKA_EMAIL - email ICKA_PASSWORD - password

git push heroku master

Can someone help me please?

kmikita commented 3 years ago

$ git clone https://github.com/osm/icka.git $ cd icka $ heroku create $ heroku config:set ICKA_EMAIL=your@email $ heroku config:set ICKA_PASSWORD=your_password $ echo "worker: ./bin/icka -forever" > Procfile $ git add . $ git commit -m "Procfile" $ git push heroku master $ heroku ps:scale worker=1 $ heroku logs

larakel1 commented 3 years ago

heroku ps:scale worker=1 » Warning: heroku update available from 7.53.0 to 7.54.0. Scaling dynos... ! ! Couldn't find that process type (worker).

$ git clone https://github.com/osm/icka.git $ cd icka $ heroku create $ heroku config:set ICKA_EMAIL=your@email $ heroku config:set ICKA_PASSWORD=your_password $ echo "worker: ./bin/icka -forever" > Procfile $ git add . $ git commit -m "Procfile" $ git push heroku master $ heroku ps:scale worker=1 $ heroku logs

Thank you so much for the help in the last step heroku ps:scale worker=1 it gives the following heroku ps:scale worker=1 » Warning: heroku update available from 7.53.0 to 7.54.0. Scaling dynos... ! ! Couldn't find that process type (worker).

Deihmos commented 3 years ago

heroku ps:scale worker=1 » Warning: heroku update available from 7.53.0 to 7.54.0. Scaling dynos... ! ! Couldn't find that process type (worker).

$ git clone https://github.com/osm/icka.git $ cd icka $ heroku create $ heroku config:set ICKA_EMAIL=your@email $ heroku config:set ICKA_PASSWORD=your_password $ echo "worker: ./bin/icka -forever" > Procfile $ git add . $ git commit -m "Procfile" $ git push heroku master $ heroku ps:scale worker=1 $ heroku logs

Thank you so much for the help in the last step heroku ps:scale worker=1 it gives the following heroku ps:scale worker=1 » Warning: heroku update available from 7.53.0 to 7.54.0. Scaling dynos... ! ! Couldn't find that process type (worker).

Did you add the Procfile

larakel1 commented 3 years ago

@Deihmos i did all commands, did i need do something in heroku web?

C:\Users\icka>git ls-files .gitignore Makefile Procfile README.md go.mod go.sum main.go


the log 2021-06-03T12:22:40.738155+00:00 app[api]: Initial release by user x@mail.com 2021-06-03T12:22:40.738155+00:00 app[api]: Release v1 created by user x@mail.com 2021-06-03T12:22:40.983870+00:00 app[api]: Enable Logplex by user x@mail.com 2021-06-03T12:22:40.983870+00:00 app[api]: Release v2 created by user x@mail.com 2021-06-03T12:22:51.702678+00:00 app[api]: Release v3 created by user x@mail.com 2021-06-03T12:22:51.702678+00:00 app[api]: Set ICKA_EMAIL config vars by user x@mail.com 2021-06-03T12:23:00.036718+00:00 app[api]: Release v4 created by user x@mail.com 2021-06-03T12:23:00.036718+00:00 app[api]: Set ICKA_PASSWORD config vars by x@mail.com 2021-06-03T12:23:18.000000+00:00 app[api]: Build started by user x@mail.com 2021-06-03T12:23:30.379358+00:00 app[api]: Release v5 created by user x@mail.com 2021-06-03T12:23:30.379358+00:00 app[api]: Deploy 63553683 by user x@mail.com 2021-06-03T12:23:48.000000+00:00 app[api]: Build succeeded

kmikita commented 3 years ago

Procfile must contain worker: ./bin/icka -forever then

$ git add .
$ git commit -m "Procfile"
$ git push heroku master
$ heroku ps:scale worker=1

If success, then $ heroku logs shows successfully kept connection alive one in hour.

You don't need to do something in heroku web instead monitor dashboard. :)

larakel1 commented 3 years ago

Procfile must contain worker: ./bin/icka -forever then

$ git add .
$ git commit -m "Procfile"
$ git push heroku master
$ heroku ps:scale worker=1

If success, then $ heroku logs shows successfully kept connection alive one in hour.

You don't need to do something in heroku web instead monitor dashboard. :)

thank you so much again my problem was in procfile file ("worker: ./bin/icka -forever" > Procfile) with the quotation marks when i did the echo command, now i edited the Procfile file without quotation marks by hand and worked, thank you so much!

tech234a commented 3 years ago

I have a repo based on this script that can be deployed to Heroku completely from a web browser without editing code. It uses far fewer Heroku account hours than running it forever as shown above in this issue.

https://github.com/tech234a/irccloud

For those of you who used this repo back when it was based on vijaiaeroastro's script: the easiest way to update is to delete your existing Heroku app, use the deploy button in the README to create a new app with the same name as your previous one, and make sure your existing cron-job.org job is enabled.