Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
81–90 of 336 posts
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#82Earlier quoted context omitted.
Yes yes yes. I came to post the exact same thing then saw this =)
Eh. I tried to do Chromium/Puppeteer based scraping this way. Building a Dockerfile took ages due to the low compute. (Rust was a non-starter). I also had (foolishly) only bought the Pi with 2GB instead of 8GB so RAM was an issue. Disk was super slow. I'm not sure how viable this is, especially with how hard it is currently to source a Pi, let alone its computation/memory constraints.
Why compile anything on the raspberry pi? Cross-compile on a machine with more compute (like your laptop, desktop, phone, or ec2 instance) one time, and then transfer the compiled binaries or built docker image over.
> Pi with 2GB instead of 8GB
For headless chrome, that should be enough unless you're doing other stuff with it. Unless you mean for compiling stuff, which as before can be done elsewhere.
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#83Earlier quoted context omitted.
AFAIK, scheduled GitHub workflows stop running after a while. But when that happens, GitHub will send you an email with a big green “Continue running workflow” button.
I've got a couple projects like this, that mostly just create bundles of other source projects that I'm not involved with. Creating a windows installer, or docker image for projects that don't have that integrated. It's kind of annoying that they will stop in several weeks when there's no project changes.
Can't you configure a GHA which commits nonsense every month?
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#84Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#85Raspberry Pi at home if you don't have a home server already. Or some low spec cheap vps.
A use case I've needed cloud services for is web scraping. Sites which IP ban web scrapers will still allow scraping from major cloud provider IP space.
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#86i'm sure the major cloud providers have cheap / free tiers for this kind of work, but quite frankly i've been burned by run away pricing tiers too many times to ever consider using cloud again for a personal project .. so unless this is getting funded by a client try to host your own.
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#87Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#88Earlier quoted context omitted.
AFAIK, scheduled GitHub workflows stop running after a while. But when that happens, GitHub will send you an email with a big green “Continue running workflow” button.
I've got a couple projects like this, that mostly just create bundles of other source projects that I'm not involved with. Creating a windows installer, or docker image for projects that don't have that integrated. It's kind of annoying that they will stop in several weeks when there's no project changes.
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#89Earlier quoted context omitted.
Eh. I tried to do Chromium/Puppeteer based scraping this way. Building a Dockerfile took ages due to the low compute. (Rust was a non-starter). I also had (foolishly) only bought the Pi with 2GB instead of 8GB so RAM was an issue. Disk was super slow. I'm not sure how viable this is, especially with how hard it is currently to source a Pi, let alone its computation/memory constraints.
You really don't need docker for this.
I have a Raspberry Pi that is natively running a scraper using headless Chromium and cron. It works great, except....
I ended up needing a virtual framebuffer. I got it working on the Raspberry Pi, but I got a new workstation and wanted to edit my script and test it there. I got cryptic errors that I needed to debug to understand they were framebuffer issues, then attempt to recreate the setup that's running on my Pi, then debug that.....
My first mistake was not writing down what I did in my README, but a Docker image would have saved me a ton of time here.
Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?
#90Here's how a cron job implementation would look with Temporal -
` func Subscription(ctx [redacted].Context, userUUID string) error { free_trial_on := true
for {
if free_trial_on {
// Sleep until trial period passes
[redacted].Sleep(ctx, days(15))
free_trial_on = False
} else {
// Charge subscription fee
[redacted].ExecuteActivity(ctx, ChargeSubscriptionAndEmailReceipt, userUUID, frequency).Get(ctx, nil)
// Sleep until next payment is due
[redacted].Sleep(ctx, days(30))
}
}
}
`