Skip to content

Flex jobs and humans first

You pay for slots: jobs that run at the same time. Most CI load comes in peaks, and much of it does not need to start right away. Flex jobs move that work out of the peak, so the same work fits into fewer slots.

Flex jobs

Mark a job as flex with the longest delay you accept:

jobs:
  nightly:
    runs-on: ubuntu-latest-flex-6h   # finished within 6 hours

or as an extra label: runs-on: [ubuntu-latest, flex-6h]. The delay is 1h to 24h.

Use the flex tag agreed at onboarding, for example:

nightly:
  tags: [runnerli-flex-6h]

How it behaves:

  • Finished within the delay. The delay counts from the start of the workflow run. The job starts at once when slots are free, otherwise later, but early enough to finish in time. How long it takes is estimated from its previous successful runs.
  • People's jobs go first. Waiting pushes, merge requests and releases start before flex jobs that still have time.
  • Flex jobs fill idle slots, overnight and between pushes.
  • Your slots are the limit for every job. Flex orders your work; it does not add slots. A flex job that must start now to meet its deadline takes your next free slot.
  • Running jobs are never stopped.
  • Never delayed: manual starts, releases and tag pushes run at once, whatever their labels say.
  • A misspelled flex label (flex-0h, flex-6) runs the job at once, as an ordinary job.

Beta

During the beta the deadline is a best effort. If the runners are full, a flex job can finish late. We are alerted when that happens.

Humans first

runner.li can also do this without any change to your workflows. It sorts every job into one of three classes:

  • Human: pushes, merge requests and manual starts by people
  • Bot: scheduled runs, and jobs started by bot accounts such as Renovate and Dependabot (also recognized by branch names like renovate/)
  • Unknown: everything else

With humans first on, human jobs go first, then unknown, then bot jobs. Bot jobs are treated as flex jobs with a deadline, so they still run, and each class can have its own limit, so a burst of dependency updates cannot take every slot.

  • On by default in the beta, opt-in for paid plans.
  • Opt a job out with flex-0h in runs-on.
  • Tell us if your bots use other account names or branch prefixes.
  • GitLab: jobs are classified but not reordered yet, because GitLab decides which runner gets which job.