gitea-runner: switch to native host execution with Legion tool mounts
This commit is contained in:
@@ -15,6 +15,9 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app: gitea-runner
|
app: gitea-runner
|
||||||
spec:
|
spec:
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: register
|
- name: register
|
||||||
image: gitea/act_runner:latest
|
image: gitea/act_runner:latest
|
||||||
@@ -26,20 +29,18 @@ spec:
|
|||||||
--instance "$GITEA_INSTANCE_URL" \
|
--instance "$GITEA_INSTANCE_URL" \
|
||||||
--token "$GITEA_RUNNER_REGISTRATION_TOKEN" \
|
--token "$GITEA_RUNNER_REGISTRATION_TOKEN" \
|
||||||
--name legion \
|
--name legion \
|
||||||
--labels "self-hosted:docker://ghcr.io/catthehacker/ubuntu:act-22.04,linux:docker://ghcr.io/catthehacker/ubuntu:act-22.04,x64:docker://ghcr.io/catthehacker/ubuntu:act-22.04,legion:docker://ghcr.io/catthehacker/ubuntu:act-22.04" \
|
--labels "self-hosted,linux,x64,legion" \
|
||||||
--no-interactive
|
--no-interactive
|
||||||
# Write runner config enabling docker socket passthrough for build jobs
|
|
||||||
cat > /data/config.yaml << 'EOF'
|
cat > /data/config.yaml << 'EOF'
|
||||||
runner:
|
runner:
|
||||||
capacity: 2
|
capacity: 2
|
||||||
envs: {}
|
|
||||||
timeout: 3h
|
timeout: 3h
|
||||||
container:
|
host:
|
||||||
network: host
|
workdir_parent: /data/workspace
|
||||||
docker_host: "unix:///var/run/docker.sock"
|
|
||||||
force_pull: false
|
|
||||||
options: -v /usr/local/bin/kubectl:/usr/local/bin/kubectl:ro
|
|
||||||
EOF
|
EOF
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: /home/will
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: gitea-runner-secret
|
name: gitea-runner-secret
|
||||||
@@ -51,6 +52,11 @@ spec:
|
|||||||
image: gitea/act_runner:latest
|
image: gitea/act_runner:latest
|
||||||
workingDir: /data
|
workingDir: /data
|
||||||
command: ["act_runner", "daemon", "--config", "/data/config.yaml"]
|
command: ["act_runner", "daemon", "--config", "/data/config.yaml"]
|
||||||
|
env:
|
||||||
|
- name: HOME
|
||||||
|
value: /home/will
|
||||||
|
- name: PATH
|
||||||
|
value: /home/will/.local/bin:/usr/local/bin:/usr/bin:/bin
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: gitea-runner-secret
|
name: gitea-runner-secret
|
||||||
@@ -59,6 +65,24 @@ spec:
|
|||||||
mountPath: /data
|
mountPath: /data
|
||||||
- name: docker-sock
|
- name: docker-sock
|
||||||
mountPath: /var/run/docker.sock
|
mountPath: /var/run/docker.sock
|
||||||
|
- name: usr-local-bin
|
||||||
|
mountPath: /usr/local/bin
|
||||||
|
readOnly: true
|
||||||
|
- name: usr-bin
|
||||||
|
mountPath: /usr/bin
|
||||||
|
readOnly: true
|
||||||
|
- name: usr-local-lib
|
||||||
|
mountPath: /usr/local/lib
|
||||||
|
readOnly: true
|
||||||
|
- name: usr-lib-python3
|
||||||
|
mountPath: /usr/lib/python3
|
||||||
|
readOnly: true
|
||||||
|
- name: usr-lib-python312
|
||||||
|
mountPath: /usr/lib/python3.12
|
||||||
|
readOnly: true
|
||||||
|
- name: home-will-local
|
||||||
|
mountPath: /home/will/.local
|
||||||
|
readOnly: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: 512Mi
|
memory: 512Mi
|
||||||
@@ -73,3 +97,21 @@ spec:
|
|||||||
hostPath:
|
hostPath:
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
type: Socket
|
type: Socket
|
||||||
|
- name: usr-local-bin
|
||||||
|
hostPath:
|
||||||
|
path: /usr/local/bin
|
||||||
|
- name: usr-bin
|
||||||
|
hostPath:
|
||||||
|
path: /usr/bin
|
||||||
|
- name: usr-local-lib
|
||||||
|
hostPath:
|
||||||
|
path: /usr/local/lib
|
||||||
|
- name: usr-lib-python3
|
||||||
|
hostPath:
|
||||||
|
path: /usr/lib/python3
|
||||||
|
- name: usr-lib-python312
|
||||||
|
hostPath:
|
||||||
|
path: /usr/lib/python3.12
|
||||||
|
- name: home-will-local
|
||||||
|
hostPath:
|
||||||
|
path: /home/will/.local
|
||||||
|
|||||||
Reference in New Issue
Block a user