Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forgejo / Gitea runner jobs scaler #6488

Open
cobak78 opened this issue Jan 16, 2025 · 0 comments
Open

Forgejo / Gitea runner jobs scaler #6488

cobak78 opened this issue Jan 16, 2025 · 0 comments

Comments

@cobak78
Copy link

cobak78 commented Jan 16, 2025

Proposal

We want to improve scaling capabilites for the Forgejo Actions as explained in this issue (https://codeberg.org/forgejo/discussions/issues/241). To achieve that we already created new enpoints here for listing pending jobs, and a new --one-job runner execution command here.

Scaler Source

Forgejo runners https://code.forgejo.org/forgejo/runner

Scaling Mechanics

We tested this functionallity with a new scaled job definition that checks pending jobs on forgejo. And spawns pre-registered runners to execute the jobs one by one.

This is an example of a scaled job definition

apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
  labels:
    app: forgejo-runner
  name: forgejo-runner
  namespace: runners
spec:
  jobTargetRef:
    template:
      metadata:
        labels:
          app: forgejo-runner
      spec:
        volumes:
        - name: runner-data
          persistentVolumeClaim:
            claimName: runner-pvc-claim
        - name: runner-config
          configMap:
            name: runner-config
        containers:
        - name: runner
          image: runner:6.1
          command: ["sh", "-c", "stackit-git-runner job"]
          volumeMounts:
          - name: runner-data
            mountPath: /data
          - name: runner-config
            mountPath: /config
            readOnly: false
  minReplicaCount: 0
  maxReplicaCount: 20
  pollingInterval: 30
  triggers:
  - type: forgejo-runner
    metadata:
      name: "forgejo-runner-ubuntu"
      token: "xxx"
      address: "https://v11.next.forgejo.org"
      global: "true"
      labels: "ubuntu-latest"

Authentication Source

token authorization using forgejo token definition

Anything else?

We are ready to create a PR with all the code and tests already done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Triage
Development

No branches or pull requests

1 participant