actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.82k stars 949 forks source link

self-hosted action runner with `kubernetes` mode on EKS failed at `Initialize containers` step from Action UI #3372

Open joosangkim opened 3 months ago

joosangkim commented 3 months ago

Describe the bug ghcr.io/actions/actions-runner:2.317.0 self-hosted runner with kubernetes mode on EKS failed at Initialize containers step from Action UI.

To Reproduce Steps to reproduce the behavior:

  1. Generate Runner deploy with the values.yaml
    
    runnerScaleSetName: "arc-runner"
    githubConfigUrl: ####MASKED####
    githubConfigSecret: ####MASKED####

containerMode: type: "kubernetes" kubernetesModeWorkVolumeClaim: accessModes: ["ReadWriteOnce"] storageClassName: "gp2" resources: requests: storage: 2Gi

template: spec: initContainers:

on: pull_request:

jobs: CI-Test: permissions: contents: read issues: read id-token: write checks: write pull-requests: write runs-on: arc-runner services: mysql: ....... steps:

Expected behavior kubernetes mode should work like dind mode.

Runner Version and Platform

Running on EKS Runner: 2.317.0

What's not working?

Please include error messages and screenshots.

Job Log Output

Outputs from Action UI

##[debug]Evaluating condition for step: 'Initialize containers'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Initialize containers
##[debug]Register post job cleanup for stopping/deleting containers.
Run '/home/runner/k8s/index.js'
  shell: /home/runner/externals/node16/bin/node {0}
##[debug]/home/runner/externals/node16/bin/node /home/runner/k8s/index.js
Error: Error: Job Container is required.
Error: Process completed with exit code 1.
Error: Executing the custom container implementation failed. Please contact your self hosted runner administrator.
##[debug]System.Exception: Executing the custom container implementation failed. Please contact your self hosted runner administrator.
##[debug] ---> System.Exception: The hook script at '/home/runner/k8s/index.js' running command 'PrepareJob' did not execute successfully
##[debug]   at GitHub.Runner.Worker.Container.ContainerHooks.ContainerHookManager.ExecuteHookScript[T](IExecutionContext context, HookInput input, ActionRunStage stage, String prependPath)
##[debug]   --- End of inner exception stack trace ---
##[debug]   at GitHub.Runner.Worker.Container.ContainerHooks.ContainerHookManager.ExecuteHookScript[T](IExecutionContext context, HookInput input, ActionRunStage stage, String prependPath)
##[debug]   at GitHub.Runner.Worker.Container.ContainerHooks.ContainerHookManager.PrepareJobAsync(IExecutionContext context, List`1 containers)
##[debug]   at GitHub.Runner.Worker.ContainerOperationProvider.StartContainersAsync(IExecutionContext executionContext, Object data)
##[debug]   at GitHub.Runner.Worker.JobExtensionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Initialize containers

Runner and Worker's Diagnostic Logs

See above

joosangkim commented 3 months ago

I just had few more test crosschecking with dind mode, I should define container: in github action workflow file. Is there any instruction this functional restriction on kubernetes mode?