Use simple preferred scheduling for Factorio
Test and deploy Factorio / validate (push) Successful in 30s
Test and deploy Factorio / deploy (push) Successful in 17s

This commit is contained in:
2026-10-17 16:34:59 +02:00
parent 72a1d3e886
commit 1aa4d28a60
15 changed files with 25 additions and 285 deletions
+1 -5
View File
@@ -1,4 +1,4 @@
"""Preserve reconciler-owned placement; roll when mounted configuration changes."""
"""Roll the server when mounted configuration changes."""
import hashlib
import json
import sys
@@ -6,16 +6,12 @@ from pathlib import Path
import yaml
docs = list(yaml.safe_load_all(Path(sys.argv[1]).read_text()))
live_text = Path(sys.argv[2]).read_text().strip()
live = json.loads(live_text) if live_text else None
config = {d['metadata']['name']: d.get('data', {}) for d in docs if d['kind'] == 'ConfigMap' and d['metadata']['namespace'] == 'factorio'}
checksum = hashlib.sha256(json.dumps(config, sort_keys=True).encode()).hexdigest()
for doc in docs:
if doc['kind'] == 'Deployment' and doc['metadata']['name'] == 'factorio':
template = doc['spec']['template']
template['metadata'].setdefault('annotations', {})['factorio.brunner.ninja/config-revision'] = checksum
if live:
template['spec']['affinity'] = live['spec']['template']['spec']['affinity']
# The fresh PVC is an administrator bootstrap resource. CI never owns storage.
if doc['kind'] == 'PersistentVolumeClaim':
continue