hte-cli 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl

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.
hte_cli/cli.py CHANGED
@@ -281,26 +281,63 @@ def session_join(ctx, session_id: str, force_setup: bool):
281
281
 
282
282
  # Step 3: Run setup (skip if reconnecting without force)
283
283
  setup_start_time = time.monotonic()
284
- if not is_reconnect or force_setup:
285
- # Send setup_started event
286
- events.setup_started({"cli_version": __version__, "task_id": assignment["task_id"]})
284
+ images = []
285
+ pulled_images = []
286
+ cached_images = []
287
+ failed_images = []
287
288
 
288
- # Pull images if we have compose
289
+ if not is_reconnect or force_setup:
290
+ # Extract images from compose
289
291
  if compose_yaml:
290
292
  images = extract_images_from_compose(compose_yaml)
291
- if images:
292
- console.print(f"[bold]Pulling {len(images)} Docker image(s)...[/bold]")
293
- events.image_pull_started({})
294
- for img in images:
295
- short_name = img.split("/")[-1][:40]
296
- with console.status(f"[yellow]↓[/yellow] {short_name}") as status:
297
- success = pull_image_with_progress(img)
298
- if success:
299
- console.print(f" [green][/green] {short_name}")
300
- else:
301
- console.print(f" [red]✗[/red] {short_name} (failed)")
302
- events.image_pull_completed({})
303
- console.print()
293
+
294
+ # Send setup_started event
295
+ events.setup_started(images=images)
296
+
297
+ # Pull images if we have any
298
+ if images:
299
+ from hte_cli.image_utils import check_image_exists_locally
300
+
301
+ console.print(f"[bold]Pulling {len(images)} Docker image(s)...[/bold]")
302
+ pull_start = time.monotonic()
303
+
304
+ for img in images:
305
+ short_name = img.split("/")[-1][:40]
306
+
307
+ # Check if already cached
308
+ if check_image_exists_locally(img):
309
+ console.print(f" [green]✓[/green] {short_name} [dim](cached)[/dim]")
310
+ cached_images.append(img)
311
+ continue
312
+
313
+ # Need to pull - show progress
314
+ with console.status(f"[yellow]↓[/yellow] {short_name} [dim]connecting...[/dim]") as status:
315
+ def show_progress(image: str, line: str):
316
+ # Parse docker pull output for layer progress
317
+ # Lines look like: "abc123: Downloading [====> ] 10MB/50MB"
318
+ if ": " in line:
319
+ parts = line.split(": ", 1)
320
+ if len(parts) == 2:
321
+ layer_status = parts[1][:50] # Truncate
322
+ status.update(f"[yellow]↓[/yellow] {short_name} [dim]{layer_status}[/dim]")
323
+
324
+ success = pull_image_with_progress(img, on_progress=show_progress)
325
+
326
+ if success:
327
+ console.print(f" [green]✓[/green] {short_name} [dim](downloaded)[/dim]")
328
+ pulled_images.append(img)
329
+ else:
330
+ console.print(f" [red]✗[/red] {short_name} [dim](failed)[/dim]")
331
+ failed_images.append(img)
332
+
333
+ pull_duration = time.monotonic() - pull_start
334
+ events.image_pull_completed(
335
+ duration_seconds=pull_duration,
336
+ pulled=pulled_images,
337
+ cached=cached_images,
338
+ failed=failed_images,
339
+ )
340
+ console.print()
304
341
 
305
342
  # Send setup_completed - THIS STARTS THE TIMER ON SERVER
306
343
  total_setup = time.monotonic() - setup_start_time
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hte-cli
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Human Time-to-Completion Evaluation CLI
5
5
  Project-URL: Homepage, https://github.com/sean-peters-au/lyptus-mono
6
6
  Author: Lyptus Research
@@ -1,7 +1,7 @@
1
1
  hte_cli/__init__.py,sha256=fDGXp-r8bIoLtlQnn5xJ_CpwMhonvk9bGjZQsjA2mDI,914
2
2
  hte_cli/__main__.py,sha256=63n0gNGfskidWDU0aAIF2N8lylVCLYKVIkrN9QiORoo,107
3
3
  hte_cli/api_client.py,sha256=m42kfFZS72Nu_VuDwxRsLNy4ziCcvgk7KNWBh9gwqy0,9257
4
- hte_cli/cli.py,sha256=ppVNUPxQVen3R90UVkA33Cy35N7Un5sh42ml0dPz9nw,39368
4
+ hte_cli/cli.py,sha256=xXlsXfX-mXUHUszR55-u7bCftSgPszF-prm1-8Yfinw,40730
5
5
  hte_cli/config.py,sha256=42Xv__YMSeRLs2zhGukJkIXFKtnBtYCHnONfViGyt2g,3387
6
6
  hte_cli/errors.py,sha256=1J5PpxcUKBu6XjigMMCPOq4Zc12tnv8LhAsiaVFWLQM,2762
7
7
  hte_cli/events.py,sha256=Zn-mroqaLHNzdT4DFf8st1Qclglshihdc09dBfCN070,5522
@@ -9,7 +9,7 @@ hte_cli/image_utils.py,sha256=454yoZEI1duNYrZC8UjhfZzDRP4Nxdrf2TvnZ_54G1k,4439
9
9
  hte_cli/runner.py,sha256=DhC8FMjHwfLR193iP4thLDRZrNssYA9KH1WYKU2JKeg,13535
10
10
  hte_cli/scorers.py,sha256=sFoPJePRt-K191-Ga4cVmrldruJclYXTOLkU_C9nCDI,6025
11
11
  hte_cli/version_check.py,sha256=WVZyGy2XfAghQYdd2N9-0Qfg-7pgp9gt4761-PnmacI,1708
12
- hte_cli-0.2.1.dist-info/METADATA,sha256=r2fEYVYX0wHf-S2pD7ysYt-Ln8Js9wfulcl4RgTWob4,3767
13
- hte_cli-0.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
- hte_cli-0.2.1.dist-info/entry_points.txt,sha256=XbyEEi1H14DFAt0Kdl22e_IRVEGzimSzYSh5HlhKlFA,41
15
- hte_cli-0.2.1.dist-info/RECORD,,
12
+ hte_cli-0.2.3.dist-info/METADATA,sha256=WGhP-PeFCMDUsn5mj_1vXEbvALy1gx_hA5MvMWrwK-w,3767
13
+ hte_cli-0.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
14
+ hte_cli-0.2.3.dist-info/entry_points.txt,sha256=XbyEEi1H14DFAt0Kdl22e_IRVEGzimSzYSh5HlhKlFA,41
15
+ hte_cli-0.2.3.dist-info/RECORD,,