nested-github-runners-action icon indicating copy to clipboard operation
nested-github-runners-action copied to clipboard

Action finishes before nested jobs have started

Open wilkerHop opened this issue 2 years ago • 1 comments

I have added this job to my workflow:

  create-nested-runners:
    runs-on: ubuntu-latest
    steps:
      - name: Run Multiple GitHub Runners in Runner
        uses: dougcalobrisi/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          runners: 3

and changed each other job runner to nested-${{ github.run_id }}.

This is the create-nested-runners's log:

2022-06-23 19:36:08 INFO     Pulling docker image dougcalobrisi/nested-github-runner:latest
2022-06-23 19:36:37 INFO     Added shared volume /shared:/shared
2022-06-23 19:36:37 INFO     Starting runners
2022-06-23 19:36:37 INFO     Starting runner 0
2022-06-23 19:36:37 INFO     Starting runner 1
2022-06-23 19:36:37 INFO     Starting runner 2
2022-06-23 19:36:38 INFO     Started runner 1 in container eac5653e4cd7f65e9f11af4059d2dc756840d48077b02b1d920706e5634561d7
2022-06-23 19:36:38 INFO     Started runner 0 in container d9d2f9c1f695bfadee4f2f4767e6c8f1d9128f3ed1309a87e64ee064434c53
2022-06-23 19:36:38 INFO     Started runner 2 in container b97bc26816f3b950fe5b8b28646e7e1c018c23d201e903badc29c5c4f53f6017
2022-06-23 19:36:40 ERROR    End of log for container d9d2f9c1f695bfadee4f2f584767e6c8f1d9128f3ed1309a87e64ee064434c53 before proper termination
2022-06-23 19:36:40 ERROR    End of log for container eac5653e4cd7f65e9f11af40d2dc756840d48077b02b1d920706e5634561d7 before proper termination
2022-06-23 19:36:40 ERROR    End of log for container b97bc26816f3b950fe5b8b28646e7e1c018c23d201e903badc29c5c4f53f17 before proper termination

and the others are forever in queue with the message: Requested labels: nested-2551535643.

Am I doing anything wrong?

For more context: https://github.com/wilkerHop/poc-nested-github-runners-action/actions/runs/2552581455

wilkerHop avatar Jun 23 '22 23:06 wilkerHop

This likely occurs because the GitHub Runner failed to start in the containers. Looking at your Workflow, everything looks good - does your GITHUB_TOKEN secret have the proper permissions to create new repository-level runners? If not, the the runners may fail at startup, causing the containers to exit.

I'll look into adding better logging for this soon.

dougcalobrisi avatar Jun 27 '22 11:06 dougcalobrisi

Hey, @dougcalobrisi! I end up forgetting to update the issue.

The problem was indeed the GITHUB_TOKEN permissions.

wilkerHop avatar Oct 25 '22 09:10 wilkerHop