actions / actions/runner

Runner application should allow binding to a specific job ID

Open
#3,697 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug
This is half-bug half-feature request (or maybe even a question if this already exists). I am have a bunch of ephemeral runners I spin up in response to events in my repository. This involves spawning a new machine and running the runner script in it. Unfortunately, when the runner script starts it talks to GitHub and gets associated with a job at random among outstanding jobs. The simplest form of this is that if two jobs are kicked off by GitHub (say job ID 1 and job ID 2) at around the same time, then the following steps are annoying to deal with:

  1. Receive request from GitHub to start job 1. Begin spinning up VM for job 1.
  2. Receive request from GitHub to start job 2. Begin spinning up VM for job 2.
  3. VM for job 2 provisions and starts ./run.sh.
  4. GitHub associates that VM with job 1, even though I had actually intended for it to be spawned for job 2.

This is possible to work around with very careful locking, such that there is only one machine at a time that runs ./run.sh until I get the "job started" event so I know exactly which machine is associated with which job. But it would be nice if I could just go ./run.sh --jobid [whatever] to ensure that this runner will "bind" to only that job, and not anything else that happens to be waiting for a runner. This would save me significant complexity on my side keeping track of what is in flight.

To Reproduce
Steps to reproduce the behavior:

  1. Try to run several jobs at the same time.
  2. Have ./run.sh run without external synchronization.

Expected behavior
I'd like for this case to be easy in that each machine I spawn is guaranteed to only service a specific request.

Runner Version and Platform

Version of your runner?
v2.322.0 (or whatever the latest is)

OS of the machine running the runner? OSX/Windows/Linux/...
Linux arm64/x64

What's not working?

My script just gets upset that the machines aren't what it expects.

Job Log Output

Probably not relevant

Runner and Worker's Diagnostic Logs

Also probably not relevant

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ./run.sh and trace how the runner claims an available job when multiple jobs are waiting. Determine whether the startup path can accept and enforce a job ID, then verify that a runner started for one requested job cannot service another; the issue provides no specific source file or test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.