Live data from Hacker News

Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

news.ycombinator.com

81–90 of 336 posts

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#82
post #23

Earlier 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.

> Building a Dockerfile took ages due to the low compute

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?

#83
post #26

Earlier 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.

> 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?

#85
post #77

Raspberry 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.

How are sites detecting and banning once-an-hour users? Yes, if you want to spider an entire website continuously, you could get IP banned, but if you're making 24 (or even 96) requests a day to visit one site and check some data, your traffic is indistinguishable from baseline.

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#86
cheapest would have to be running it on the computer you made this post from .. assuming its always on and the delta to your power bill is negligible. as others have suggested if you have an RPi or some other low power SBC laying around, that would be ideal.

i'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?

#88
post #26

Earlier 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 you not trigger an action via a local cronjob and the API?

Re: Ask HN: What is the cheapest, easiest way to host a cronjob in 2022?

#89

Earlier 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.

It's true that you don't, but I can see the advantages.

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?

#90
Hey, this is still a WIP, but I'm building [redacted]. We wrap an open-source workflow orchestrator Temporal that offers "durable execution" with very detailed execution tracing and a bunch of recovery mechanisms. We offer a fully-managed Temporal cluster, hosted runtime (so you don't need to worry about provisioning/scaling workers), and offer version control integrations, CI/CD and dynamic config out of the box - so you can go from code to running workflows with no infrastructure overhead. Think "lambda for workflows". Feel free to get on our waitlist!

Here'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))
    }
  }
} `
Post reply on HN