actions / actions-runner-controller

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

On demand runner action based on user provided docker image #2684

Open abhilashissac-myntra opened 1 year ago

abhilashissac-myntra commented 1 year ago

Checks

Controller Version

0.23.3

Helm Chart Version

No response

CertManager Version

1.10

Deployment Method

Helm

cert-manager installation

We followed the ARC installation steps. Also we installed cert-manager from the official documentation.

Checks

Resource Definitions

apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
  name: github-runners
  namespace: default
spec:
  replicas: 1
  template:
    spec:
      organization: myntra-PoC
      labels:
        - vanilla
        - azure
        - java
        - go
        - nodejs
        - python  
      env:
      - name: RUNNER_FEATURE_FLAG_EPHEMERAL
        value: "true"
---
apiVersion: actions.summerwind.dev/v1alpha1
kind: HorizontalRunnerAutoscaler
metadata:
  name: github-runner-deployment-autoscaler
  namespace: default
spec:
  # Runners in the targeted RunnerDeployment won't be scaled down
  # for 5 minutes instead of the default 10 minutes now
  scaleDownDelaySecondsAfterScaleOut: 300
  scaleTargetRef:
    kind: RunnerDeployment
    # # In case the scale target is RunnerSet:
    # kind: RunnerSet
    name: github-runners
  minReplicas: 1
  maxReplicas: 5
  metrics:
  - type: PercentageRunnersBusy
    scaleUpThreshold: '0.75'
    scaleDownThreshold: '0.25'
    scaleUpFactor: '2'
    scaleDownFactor: '0.5'

To Reproduce

kubectl apply -f actions.yml

Describe the bug

We are able to create on demand action runners, but then we are not able to ensure that the runners are created based on the user provided docker image. For example, a Java based repo should be able to create on demand runners with the JAVA image that is provided by the user for running the actions.

Describe the expected behavior

We would like to ensure that an on demand runner action is created based on user provided docker image

Whole Controller Logs

Will update the logs shortly

Whole Runner Pod Logs

Will provide the logs shortly

Additional Context

No response

github-actions[bot] commented 1 year 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.

abhilashissac-myntra commented 1 year ago

Steps to Reproduce :

  1. $ helm repo add jetstack https://charts.jetstack.io/
  2. $ helm repo update
  3. $ helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.10.1 --set installCRDs=true
  4. $ helm repo add actions-runner-controller https://actions-runner-controller.github.io/actions-runner-controller/
  5. $ helm repo update
  6. $ helm upgrade --install --namespace actions-runner-system --create-namespace --set=authSecret.create=true --set=authSecret.github_token="PAT_Token" --wait actions-runner-controller actions-runner-controller/actions-runner-controller
  7. $ kubectl apply -f actions.yaml

The actions.yaml file is added in the Resource Definition section.

Also, the requirement is such that the runners should be created using the Java/NodeJS/Go/Python etc images dynamically which is specified