poly-hammer-worker 0.1.1.dev10__tar.gz → 0.1.1.dev12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: poly-hammer-worker
3
- Version: 0.1.1.dev10
3
+ Version: 0.1.1.dev12
4
4
  Summary: Poly Hammer self-hosted GPU worker agent
5
5
  License-Expression: MIT
6
6
  Requires-Python: >=3.13
@@ -87,6 +87,10 @@ def discover_local_images(
87
87
  continue
88
88
 
89
89
  image_ref = _best_tag(image)
90
+ if not image_ref:
91
+ logger.debug("Skipping untagged image %s", image.short_id)
92
+ continue
93
+
90
94
  service_id = ph_labels["service-id"]
91
95
  min_cuda_version: str | None = ph_labels.get("min-cuda-version")
92
96
 
@@ -142,13 +146,12 @@ def discover_local_images(
142
146
  return results
143
147
 
144
148
 
145
- def _best_tag(image: Any) -> str:
146
- """Return the most useful tag for an image, or fall back to short ID."""
149
+ def _best_tag(image: Any) -> str | None:
150
+ """Return the most useful tag for an image, or None if untagged."""
147
151
  tags = image.tags
148
152
  if tags:
149
153
  return tags[0]
150
- short_id = image.short_id
151
- return short_id.replace("sha256:", "") if short_id else "<untagged>"
154
+ return None
152
155
 
153
156
 
154
157
  def _parse_int(value: str) -> int:
@@ -289,11 +289,24 @@ def _execute_job(
289
289
  elapsed = time.monotonic() - start_time
290
290
 
291
291
  # ---- Report completion ------------------------------------------------
292
+ # The container uploads to S3 via the presigned URL but doesn't
293
+ # echo the key back in its result JSON. Fall back to the s3_key
294
+ # from the job payload so the backend can store it.
295
+ result_url = result.get("result_url") or job.get("s3_key", "")
296
+
297
+ # Build result_metadata: use explicit field if present, otherwise
298
+ # collect useful top-level fields the container emitted.
299
+ result_metadata = result.get("result_metadata") or {
300
+ k: v
301
+ for k, v in result.items()
302
+ if k not in ("type", "status", "result_url", "result_metadata")
303
+ }
304
+
292
305
  portal.complete_job(
293
306
  job_id,
294
307
  elapsed_seconds=elapsed,
295
- result_url=result.get("result_url"),
296
- result_metadata=result.get("result_metadata"),
308
+ result_url=result_url,
309
+ result_metadata=result_metadata,
297
310
  )
298
311
  console.print(f" [green]Completed in {elapsed:.1f}s[/green]")
299
312
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "poly-hammer-worker"
3
- version = "0.1.1.dev10"
3
+ version = "0.1.1.dev12"
4
4
  description = "Poly Hammer self-hosted GPU worker agent"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"