Fix runner download from Gitea CDN
Controller CI / test (push) Successful in 1s

This commit is contained in:
2026-10-02 14:00:32 +08:00
parent e78a247612
commit 6251fde4c1
2 changed files with 30 additions and 1 deletions
+3 -1
View File
@@ -26,6 +26,7 @@ RUNNER_URL = (
"https://dl.gitea.com/gitea-runner/3.5.0/gitea-runner-3.5.0-linux-amd64"
)
RUNNER_SHA256 = "16dc5c89ad5ac5496369642f01ed29c9bb130a2512e16a8cc3b400d9d0bfea73"
RUNNER_USER_AGENT = "ces-autodl-controller/1.0"
RUNNER_LABELS = ["ubuntu-latest:host", "ces-ci:host", "gpu:host"]
MODEL_FILES = [
"config.json",
@@ -256,7 +257,8 @@ def ensure_runner(paths: Paths) -> Path:
if paths.runner_cache.is_file() and sha256(paths.runner_cache) == RUNNER_SHA256:
return paths.runner_cache
paths.runner_cache.parent.mkdir(parents=True, exist_ok=True)
with urllib.request.urlopen(RUNNER_URL, timeout=300) as response, tempfile.NamedTemporaryFile(
request = urllib.request.Request(RUNNER_URL, headers={"User-Agent": RUNNER_USER_AGENT})
with urllib.request.urlopen(request, timeout=300) as response, tempfile.NamedTemporaryFile(
dir=paths.runner_cache.parent, delete=False
) as temporary:
while chunk := response.read(1024 * 1024):