Compare commits

...

6 commits

Author SHA1 Message Date
5f26ac7629 [NO TESTS] WIP 2024-09-20 14:24:49 -06:00
5f84042050 Oops. Negate. 2024-09-01 14:14:37 -06:00
824abbe176 Don't log spam when all printers are busy 2024-09-01 14:12:50 -06:00
a815bd6763 Sigh HTTP 200 failures 2024-09-01 14:08:52 -06:00
a6ee0440d0 Fix: Tolerate missing? 2024-09-01 14:06:36 -06:00
3065501f97 Use the cube of similarity
This has the effect of cranking up the similarity threshold dramatically
2024-08-31 21:42:16 -06:00
3 changed files with 15 additions and 5 deletions

View file

@ -25,6 +25,8 @@ hass {{ ttl }} IN A {{ link }}
k8s {{ ttl }} IN A {{ link }} k8s {{ ttl }} IN A {{ link }}
git {{ ttl }} IN A {{ link }} git {{ ttl }} IN A {{ link }}
sso {{ ttl }} IN A {{ link }} sso {{ ttl }} IN A {{ link }}
jelly {{ ttl }} IN A {{ link }}
podfetch {{ ttl }} IN A {{ link }}
{% endfor %} {% endfor %}
# Secrets service # Secrets service

View file

@ -12,4 +12,5 @@ cp Dockerfile "$tmpdir/"
cp -r "$zapp" "$tmpdir/" cp -r "$zapp" "$tmpdir/"
cd "${tmpdir}" cd "${tmpdir}"
docker build "$@" -f Dockerfile . docker build "$@" -f Dockerfile -t registry.tirefireind.us/arrdem/tentacles:latest .
docker push registry.tirefireind.us/arrdem/tentacles:latest

View file

@ -84,11 +84,16 @@ def poll_printers(app: App, db: Db) -> None:
"/api/plugin/bedready", "/api/plugin/bedready",
json={ json={
"command": "check_bed", "command": "check_bed",
"similarity": 0.94,
"reference": snapshots[0], "reference": snapshots[0],
}, },
) )
return status.get("bed_clear", True)
if "error" in status:
log.error(f"Printer {printer.id} failed to report bed readiness with {status!r}")
return False
similarity = status.get("similarity", 0.0) ** 3 # Cube it
return similarity > 0.9
printer_job = {} printer_job = {}
try: try:
@ -157,7 +162,8 @@ def assign_jobs(app: App, db: Db) -> None:
if job.printer_id: if job.printer_id:
continue continue
for printer in db.list_idle_printers(): idle = list(db.list_idle_printers())
for printer in idle:
if ( if (
job.analysis_id is not None job.analysis_id is not None
and printer.limit_x >= job.max_x and printer.limit_x >= job.max_x
@ -172,6 +178,7 @@ def assign_jobs(app: App, db: Db) -> None:
log.info(f"Mapped job {job.id} to printer {printer.id}") log.info(f"Mapped job {job.id} to printer {printer.id}")
break break
else: else:
if idle:
log.info(f"Could not map job {job!r}") log.info(f"Could not map job {job!r}")