ci: add neuron-technologies runner for Gitea Actions
This commit is contained in:
@@ -77,3 +77,83 @@ spec:
|
|||||||
hostPath:
|
hostPath:
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
type: Socket
|
type: Socket
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: neuron-technologies-runner
|
||||||
|
namespace: ci
|
||||||
|
labels:
|
||||||
|
app: neuron-technologies-runner
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: neuron-technologies-runner
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: neuron-technologies-runner
|
||||||
|
annotations:
|
||||||
|
config-version: "2026-04-24-initial"
|
||||||
|
spec:
|
||||||
|
initContainers:
|
||||||
|
- name: register
|
||||||
|
image: registry.neuralplatform.ai/ci-base:latest
|
||||||
|
workingDir: /data
|
||||||
|
command: ["/bin/sh", "-c"]
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
act_runner register \
|
||||||
|
--instance "$GITEA_INSTANCE_URL" \
|
||||||
|
--token "$GITEA_RUNNER_REGISTRATION_TOKEN" \
|
||||||
|
--name neuron-technologies \
|
||||||
|
--labels "self-hosted:docker://registry.neuralplatform.ai/ci-base:latest,ubuntu-latest:docker://registry.neuralplatform.ai/ci-base:latest,ubuntu-24.04:docker://registry.neuralplatform.ai/ci-base:latest,linux,x64" \
|
||||||
|
--no-interactive
|
||||||
|
cat > /data/config.yaml << 'EOF'
|
||||||
|
runner:
|
||||||
|
capacity: 2
|
||||||
|
timeout: 3h
|
||||||
|
container:
|
||||||
|
network: host
|
||||||
|
docker_host: "unix:///var/run/docker.sock"
|
||||||
|
force_pull: false
|
||||||
|
valid_volumes:
|
||||||
|
- /var/run/docker.sock
|
||||||
|
default_image: "registry.neuralplatform.ai/ci-base:latest"
|
||||||
|
extra_hosts:
|
||||||
|
- "gitea.git.svc.cluster.local:10.43.1.53"
|
||||||
|
EOF
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: neuron-technologies-runner-secret
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
containers:
|
||||||
|
- name: runner
|
||||||
|
image: registry.neuralplatform.ai/ci-base:latest
|
||||||
|
workingDir: /data
|
||||||
|
command: ["act_runner", "daemon", "--config", "/data/config.yaml"]
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: neuron-technologies-runner-secret
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
- name: docker-sock
|
||||||
|
mountPath: /var/run/docker.sock
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 512Mi
|
||||||
|
cpu: 250m
|
||||||
|
limits:
|
||||||
|
memory: 4Gi
|
||||||
|
cpu: "4"
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
- name: docker-sock
|
||||||
|
hostPath:
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
type: Socket
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
# gitea-runner-secret — Gitea act-runner registration token
|
# gitea-runner-secret — neural-platform org runner token
|
||||||
# GITEA_INSTANCE_URL is static (not a secret); GITEA_RUNNER_REGISTRATION_TOKEN comes from Vault
|
|
||||||
apiVersion: external-secrets.io/v1beta1
|
apiVersion: external-secrets.io/v1beta1
|
||||||
kind: ExternalSecret
|
kind: ExternalSecret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -25,3 +24,27 @@ spec:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: secret/data/gitea
|
key: secret/data/gitea
|
||||||
property: runner_token
|
property: runner_token
|
||||||
|
---
|
||||||
|
# neuron-technologies-runner-secret — neuron-technologies org runner token
|
||||||
|
apiVersion: external-secrets.io/v1beta1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: neuron-technologies-runner-secret
|
||||||
|
namespace: ci
|
||||||
|
spec:
|
||||||
|
refreshInterval: 1h
|
||||||
|
secretStoreRef:
|
||||||
|
name: vault
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
target:
|
||||||
|
name: neuron-technologies-runner-secret
|
||||||
|
creationPolicy: Owner
|
||||||
|
template:
|
||||||
|
data:
|
||||||
|
GITEA_INSTANCE_URL: "http://192.168.8.148:30322"
|
||||||
|
GITEA_RUNNER_REGISTRATION_TOKEN: "{{ .runner_token }}"
|
||||||
|
data:
|
||||||
|
- secretKey: runner_token
|
||||||
|
remoteRef:
|
||||||
|
key: secret/data/gitea
|
||||||
|
property: neuron_technologies_runner_token
|
||||||
|
|||||||
Reference in New Issue
Block a user