question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: provide a signal to other programs when the runner has started a job

See original GitHub issue

It would be helpful if the runner could signal that it has picked up a job to other programs.

We intend to use ephemeral runners (#510). We want to have an auto-scale-group in AWS that holds spare/idle capacity. When a job starts we want to remove the runner from that ASG so that it gets replaced in parallel with the job. The alternative is to scale up only after the job ends (and the machine terminates) but this adds latency, and if we get a burst of jobs (that uses up all of our capacity) we would get excessive queueing (and if the jobs are long-running it could get really bad.)

(You don’t care about these details) when we detect a job has started we trigger a Lambda function that looks at the caller identity and removes the caller from its ASG (we do it this way so that the runner VM has very narrow AWS permissions).

How we’ve worked around this: with --once (which we tried using before noticing #510) we were looking at the runner stdout for the “Job started” message. This isn’t the classiest thing to do (but it at least gracefully degrades – if the message were to change then we would just have more build queueing). Any design you come up with would be fine for us.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
thboopcommented, Mar 30, 2022

We’ve shipped a beta of this functionality in 2.289.1, please try it out and provide any feedback you have on the adr!

2reactions
bryanmacfarlanecommented, Sep 10, 2020

In the meantime one easy way to get a signal is the runner has two processes. One that listens to the queue (long running) and one that spawns a worker process (one per job) so you could ideally hook into process start / stop and at worst poll (ps aux | grep …)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Endless 'Waiting for a runner to pick up this job...' #31587
Hi, folks! I'm trying to setup a workflows, but the runner doesn't start my job. I've requested ubuntu-latest and got a message Waiting...
Read more >
GitLab Runner feature flags
GitLab Runner feature flags. Introduced in GitLab 11.4. Feature flags are toggles that allow you to enable or disable specific features.
Read more >
Services overview
Getting started · Define your work requests. How to. Work states · Manage work · Chain work together · Support for long-running workers ......
Read more >
Using the Collection Runner
Response and request details are available for the person who started the collection run. Other team members can't view details for collection runs...
Read more >
Using an IAM role to grant permissions to applications ...
Pass an IAM role to an Amazon EC2 instance to supply AWS credentials to applications running on the instance.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found