4

I'm running a DAST scanner via github actions and it has failed due to timeout because the job took longer than 6 hours. Reading through the documentation I see the limit should not be applied to self hosted runners, and there is no entry for job execution timeout in the self-hosted runner limitations. Is there a way to disable the 360 minute timeout for job execution?

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
Itay Gurvich
  • 121
  • 1
  • 6
  • Please do not edit solution announcements into the question. Accept (i.e. click the "tick" next to it) one of the existing answer, if there are any. You can also create your own answer, and even accept it, if your solution is not yet covered by an existing answer. Compare https://stackoverflow.com/help/self-answer – Yunnosch Mar 22 '23 at 23:47

3 Answers3

8

Under job: add timeout-minutes: NUMBER

Itay Gurvich
  • 121
  • 1
  • 6
3

According to the Github Actions selfhosted-runner documentation found here you should be able to have processes run for up to 24 hours. And workflows for up to 72 hours.

Lucemans
  • 46
  • 3
  • 1
    Unless I'm missing something, 24 hours is the time limit for jobs waiting in queue, not total job execution time limit. – Itay Gurvich Dec 01 '21 at 16:10
  • 1
    This answer seems to confirm the asker's belief that 6 hours is less than the limit that should be put on this job, but it doesn't help them understand why they are seeing the problem that the documentation seems to indicate shouldn't be happening. – John Chesshir Dec 01 '21 at 16:39
0

Yeah, there are some limits

  • Job execution time - Each job in a workflow can run for up to 6 hours of execution time. If a job reaches this limit, the job is terminated and fails to complete.

  • Workflow run time - Each workflow run is limited to 35 days. If a workflow run reaches this limit, the workflow run is cancelled. This period includes execution duration, and time spent on waiting and approval.

  • API requests - You can execute up to 1000 requests to the GitHub API in an hour across all actions within a repository. If requests are exceeded, additional API calls will fail which might cause jobs to fail.

Concurrent jobs - The number of concurrent jobs you can run in your account depends on your GitHub plan, as well as the type of runner used. If exceeded, any additional jobs are queued.

One suggestion is to try to split your jobs into smaller chunks. For example, in your workflow.yml file, you simply define two jobs like this (leveraging the needs: configuration in the second job).

Below is a random example of this kind of needed Job:

name: CI build and notify

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    
    - name: Deploy Docker image to Google Cloud Run
      run: ...

  notify:
    needs: build
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Notify Slack and send eMail
        run: ...