actions / actions-runner-controller

Kubernetes controller for GitHub Actions self-hosted runners
Apache License 2.0
4.74k stars 1.12k forks source link

Actions runner deployed in kubernetes mode on aks has /runner/_work/externals volume empty causing this error - env: ‘/__e/node20/bin/node’: No such file or directory #3425

Open jjayapandian opened 7 months ago

jjayapandian commented 7 months ago

Checks

Controller Version

0.20.2

Helm Chart Version

No response

CertManager Version

No response

Deployment Method

Helm

cert-manager installation

using 1.11.4 cert manager

Checks

Resource Definitions

apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
  name: 
  namespace: 
spec:
  replicas: 1
  template:
    metadata: {}
    spec:
      dockerEnabled: false
      dockerdContainerResources: {}
      enterprise: 
      env:
      - name: GITHUB_ACTIONS_RUNNER_TRACE
        value: "true"
      - name: RUNNER_CONTAINER_IN_SAME_NODE
        value: "true"
      group: 
      image: 
      labels:
      - azure
      resources: {}

helm chart values.yaml
actions-runner-controller:
  actionsRunner:
    containerProvider: kubernetes
    persistentVolumeEnabled: true
    persistentVolumeStorageClass: azure-storage
    persistentVolumeStorageSize: 100Mi

To Reproduce

1. Use azure storage 

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: azure-storage
provisioner: disk.csi.azure.com
reclaimPolicy: Delete
2.Deploy action runner controller on AKS with kubernetes values.yaml
3.Run workflow file

name: test
on:
  workflow_dispatch:
jobs:
  job2:
    runs-on: azure
    container:
      image: alpine
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          path: dir1

Describe the bug

Getting env: ‘/__e/node20/bin/node’ : No such file or directory when running runners in kubernetes mode

Describe the expected behavior

/runner/_work/externals is empty whereas /runner/externals has the data somehow its not mapping properly in kubernetes mode

Whole Controller Logs

NA

Whole Runner Pod Logs

NA

Additional Context

NA

github-actions[bot] commented 7 months ago

Hello! Thank you for filing an issue.

The maintainers will triage your issue shortly.

In the meantime, please take a look at the troubleshooting guide for bug reports.

If this is a feature request, please review our contribution guidelines.

procinger commented 5 months ago

Hello search engine user,

I also ran into this problem today. My setup is a Kubernetes cluster with DinD. We use Docker containers in some Github jobs. So that the external tools are also available in Dind, I have created an initContainer which copies externals directory into an emptyDir volume.

initContainers:
- name: init-runner
  image: ghcr.io/actions/actions-runner:latest
  imagePullPolicy: IfNotPresent
  command: ["sh", "-c", "cp -ar /home/runner/externals/* /externals/"]
  volumeMounts:
    - name: externals
      mountPath: /externals
containers:
- name: runner
  image: ghcr.io/actions/actions-runner:latest
...snip...
  volumeMounts:
    - name: work
      mountPath: /home/runner/_work
    - name: externals
      mountPath: /home/runner/externals
...snip...
- name: dind
  imagePullPolicy: IfNotPresent
  image: docker:dind
...snip...
  volumeMounts:
    - name: work
      mountPath: /home/runner/_work
    - name: externals
      mountPath: /home/runner/externals

hope it helps