Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit bdb75db

Browse files
committed
ci: 🐳 use kubernetes runner
1 parent 88d50b5 commit bdb75db

File tree

16 files changed

+400
-32
lines changed

16 files changed

+400
-32
lines changed

.github/actions/setup-docker/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ runs:
1717
uses: ScribeMD/docker-cache@0.3.6
1818
with:
1919
key: docker-engine-${{ runner.os }}
20+
restore-keys: |
21+
docker-engine-${{ runner.os }}-
22+
docker-engine-
23+
default
2024
2125
- uses: docker/setup-qemu-action@v2
2226
- uses: docker/setup-buildx-action@v2

.github/actions/setup-os/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
run: sudo rm -f /var/lib/man-db/auto-update
1111

1212
- name: 🧩 Install System Packages
13-
run: sudo apt update && sudo apt-get install -y curl lsof unzip jq zip
13+
run: sudo apt update && sudo apt-get install -y curl lsof unzip jq zip gpg
1414
shell: bash
1515

1616
- name: ⚛️ Setup kernel for react native, increase watchers

.github/workflows/deploy-dev-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
jobs:
2626
deploy_dev_api:
2727
if: "!contains(github.event.head_commit.message, 'ci skip')"
28-
runs-on: methylphenidate-runner-set
28+
runs-on: luminar-linux-x64-x1
2929
timeout-minutes: 80
3030
# environment: Development
3131
permissions:

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
deploy:
1010
name: "deploy"
1111
runs-on: methylphenidate-runner-set
12+
container :
13+
image : ubuntu:latest
1214
permissions:
1315
contents: read
1416
packages: write
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
# Github Actions Controller (ARC)
1+
# Github Actions Controller (ARC)
2+
3+
4+
### Linux (Clear Linux)
5+
6+
- `luminar-linux-x64-1x` (1 vCPU, 1GB RAM, 4GB NVMe SSD)
7+
- `luminar-linux-x64-2x` (2 vCPU, 2GB RAM, 8GB NVMe SSD)
8+
- `luminar-linux-x64-3x` (3 vCPU, 3GB RAM, 12GB NVMe SSD)
9+
- `luminar-linux-x64-5x` (5 vCPU, 5GB RAM, 20GB NVMe SSD)
10+
- `luminar-linux-x64-8x` (8 vCPU, 8GB RAM, 32GB NVMe SSD)
11+
12+
### Windows (Windows Server 2019)
13+
14+
TODO.
15+
16+
### MacOS (macOS Big Sur)
17+
18+
TODO.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
INSTALLATION_NAME="methylphenidate-runner-set"
2+
NAMESPACE="methylphenidate-runners"
3+
GITHUB_CONFIG_URL="https://github.com/keinsell/methylphenidate"
4+
GITHUB_PAT=$(op read op://dev/arc_4b7a43a2/token)
5+
6+
# Upgrade Runner Set
7+
helm upgrade "${INSTALLATION_NAME}" \
8+
--namespace "${NAMESPACE}" \
9+
--set githubConfigUrl="${GITHUB_CONFIG_URL}" \
10+
--set githubConfigSecret.github_token="${GITHUB_PAT}" \
11+
--set minRunners=1 \
12+
--set maxRunners=3 \
13+
--set containerMode.type=dind \
14+
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Default values for gha-runner-scale-set-controller.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
labels: {}
5+
6+
# leaderElection will be enabled when replicaCount>1,
7+
# So, only one replica will in charge of reconciliation at a given time
8+
# leaderElectionId will be set to {{ define gha-runner-scale-set-controller.fullname }}.
9+
replicaCount: 1
10+
11+
image:
12+
repository: "ghcr.io/actions/gha-runner-scale-set-controller"
13+
pullPolicy: IfNotPresent
14+
# Overrides the image tag whose default is the chart appVersion.
15+
tag: ""
16+
17+
imagePullSecrets: []
18+
nameOverride: ""
19+
fullnameOverride: ""
20+
21+
env:
22+
## Define environment variables for the controller pod
23+
# - name: "ENV_VAR_NAME_1"
24+
# value: "ENV_VAR_VALUE_1"
25+
# - name: "ENV_VAR_NAME_2"
26+
# valueFrom:
27+
# secretKeyRef:
28+
# key: ENV_VAR_NAME_2
29+
# name: secret-name
30+
# optional: true
31+
32+
serviceAccount:
33+
# Specifies whether a service account should be created for running the controller pod
34+
create: true
35+
# Annotations to add to the service account
36+
annotations: {}
37+
# The name of the service account to use.
38+
# If not set and create is true, a name is generated using the fullname template
39+
# You can not use the default service account for this.
40+
name: ""
41+
42+
podAnnotations: {}
43+
44+
podLabels: {}
45+
46+
podSecurityContext: {}
47+
# fsGroup: 2000
48+
49+
securityContext: {}
50+
# capabilities:
51+
# drop:
52+
# - ALL
53+
# readOnlyRootFilesystem: true
54+
# runAsNonRoot: true
55+
# runAsUser: 1000
56+
57+
resources: {}
58+
## We usually recommend not to specify default resources and to leave this as a conscious
59+
## choice for the user. This also increases chances charts run on environments with little
60+
## resources, such as Minikube. If you do want to specify resources, uncomment the following
61+
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
62+
# limits:
63+
# cpu: 100m
64+
# memory: 128Mi
65+
# requests:
66+
# cpu: 100m
67+
# memory: 128Mi
68+
69+
nodeSelector: {}
70+
71+
tolerations: []
72+
73+
affinity: {}
74+
75+
# Leverage a PriorityClass to ensure your pods survive resource shortages
76+
# ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
77+
# PriorityClass: system-cluster-critical
78+
priorityClassName: ""
79+
80+
## If `metrics:` object is not provided, or commented out, the following flags
81+
## will be applied the controller-manager and listener pods with empty values:
82+
## `--metrics-addr`, `--listener-metrics-addr`, `--listener-metrics-endpoint`.
83+
## This will disable metrics.
84+
##
85+
## To enable metrics, uncomment the following lines.
86+
# metrics:
87+
# controllerManagerAddr: ":8080"
88+
# listenerAddr: ":8080"
89+
# listenerEndpoint: "/metrics"
90+
91+
flags:
92+
## Log level can be set here with one of the following values: "debug", "info", "warn", "error".
93+
## Defaults to "debug".
94+
logLevel: "debug"
95+
## Log format can be set with one of the following values: "text", "json"
96+
## Defaults to "text"
97+
logFormat: "text"
98+
99+
## Restricts the controller to only watch resources in the desired namespace.
100+
## Defaults to watch all namespaces when unset.
101+
# watchSingleNamespace: ""
102+
103+
## Defines how the controller should handle upgrades while having running jobs.
104+
##
105+
## The strategies available are:
106+
## - "immediate": (default) The controller will immediately apply the change causing the
107+
## recreation of the listener and ephemeral runner set. This can lead to an
108+
## overprovisioning of runners, if there are pending / running jobs. This should not
109+
## be a problem at a small scale, but it could lead to a significant increase of
110+
## resources if you have a lot of jobs running concurrently.
111+
##
112+
## - "eventual": The controller will remove the listener and ephemeral runner set
113+
## immediately, but will not recreate them (to apply changes) until all
114+
## pending / running jobs have completed.
115+
## This can lead to a longer time to apply the change but it will ensure
116+
## that you don't have any overprovisioning of runners.
117+
updateStrategy: "immediate"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
githubConfigUrl: "https://github.com/keinsell/methylphenidate"
2+
3+
maxRunners: 15
4+
minRunners: 3
5+
6+
# runnerGroup: "default"
7+
8+
runnerScaleSetName: "luminar-clinux-x64-x2"
9+
10+
containerMode:
11+
type: "kubernetes"
12+
kubernetesModeWorkVolumeClaim:
13+
accessModes: ["ReadWriteOnce"]
14+
storageClassName: "openebs-hostpath"
15+
resources:
16+
requests:
17+
storage: 5Gi
18+
kubernetesModeServiceAccount:
19+
annotations: {}
20+
21+
template:
22+
spec:
23+
containers:
24+
- name: runner
25+
image: ghcr.io/actions/actions-runner:latest
26+
command: ["/home/runner/run.sh"]
27+
env:
28+
- name: ACTIONS_RUNNER_CONTAINER_HOOKS
29+
value: /home/runner/k8s/index.js
30+
- name: ACTIONS_RUNNER_POD_NAME
31+
valueFrom:
32+
fieldRef:
33+
fieldPath: metadata.name
34+
- name: ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER
35+
value: "false"
36+
volumeMounts:
37+
- name: work
38+
mountPath: /home/runner/_work
39+
volumes:
40+
- name: work
41+
ephemeral:
42+
volumeClaimTemplate:
43+
spec:
44+
accessModes: [ "ReadWriteOnce" ]
45+
storageClassName: "openebs-hostpath"
46+
resources:
47+
requests:
48+
storage: 5Gi
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
githubConfigUrl: "https://github.com/keinsell/methylphenidate"
2+
3+
maxRunners: 10
4+
minRunners: 0
5+
6+
# runnerGroup: "default"
7+
8+
runnerScaleSetName: "luminar-linux-x64-x4"
9+
10+
containerMode:
11+
type: "dind"
12+
13+
template:
14+
spec:
15+
containers:
16+
- name: runner
17+
image: ghcr.io/actions/actions-runner:latest
18+
command: ["/home/runner/run.sh"]
19+
resources:
20+
requests:
21+
memory: "64Mi"
22+
cpu: "250m"
23+
limits:
24+
memory: "7Gi"
25+
cpu: "4"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
githubConfigUrl: "https://github.com/keinsell/methylphenidate"
2+
3+
maxRunners: 10
4+
minRunners: 0
5+
6+
# runnerGroup: "default"
7+
8+
runnerScaleSetName: "luminar-linux-x64-x8"
9+
10+
containerMode:
11+
type: "dind"
12+
13+
template:
14+
spec:
15+
containers:
16+
- name: runner
17+
image: ghcr.io/actions/actions-runner:latest
18+
command: ["/home/runner/run.sh"]
19+
resources:
20+
requests:
21+
memory: "64Mi"
22+
cpu: "250m"
23+
limits:
24+
memory: "7Gi"
25+
cpu: "8"

0 commit comments

Comments
 (0)