mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-02 07:47:58 +00:00
fix(svc-ai-ollama): let the package-cache probe check /v2/ on registry.ollama.ai
The svc-cache-package CLI probe GETs every declared route path through the frontend and fails on 502/503/504. registry.ollama.ai declared no paths, so the probe asked for /, which upstream now answers with 503; Nexus relays an upstream 5xx as its own 503, so package#0 (CI run 40979252521) failed with 'registry.ollama.ai/ on port 443 answered 503'. The host now declares /v2/, the registry API root every ollama pull goes through (manifests and blobs); upstream answers it with 404, which Nexus relays as 404 and the probe accepts. On a TLS host the frontend still proxies the whole host through location /, because upstreams.conf.j2 reads routes only for plain-HTTP listeners: the rendered upstreams.conf is byte-identical before and after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f013b50875
commit
334b643911
2 files changed
+29
-2
No files matched your search
+26
-1
@@ -12,7 +12,11 @@ import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from utils.cache.render import _write
|
||||
from utils.cache.hosts import host_records
|
||||
from utils.cache.render import _write, upstreams_conf
|
||||
|
||||
OLLAMA_HOST = "registry.ollama.ai"
|
||||
OLLAMA_REPO = "raw-ollama-registry"
|
||||
|
||||
|
||||
class TestWrite(unittest.TestCase):
|
||||
@@ -63,5 +67,26 @@ class TestWrite(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
class TestOllamaRegistry(unittest.TestCase):
|
||||
def test_the_probe_requests_a_path_under_v2(self) -> None:
|
||||
self.assertEqual(
|
||||
host_records()[OLLAMA_HOST]["routes"],
|
||||
[{"path": "/v2/", "repo": OLLAMA_REPO}],
|
||||
f"{OLLAMA_HOST} answers 503 on its bare root, so the package-cache "
|
||||
"probe must request a path under /v2/, which it serves",
|
||||
)
|
||||
|
||||
def test_the_tls_frontend_still_proxies_the_whole_host(self) -> None:
|
||||
block = next(
|
||||
block
|
||||
for block in upstreams_conf().split("server {")
|
||||
if f"server_name {OLLAMA_HOST};" in block
|
||||
)
|
||||
|
||||
self.assertIn("location / {", block)
|
||||
self.assertIn(f"/repository/{OLLAMA_REPO}/;", block)
|
||||
self.assertNotIn("location /v2/", block)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user