← Back to Pull requests

Say a Service is pulling its image while a Deploy downloads it (#2879) #3188

Closed
unknown closed this pull request without merging on Oct 23, 2026 05:31 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 04:50 UTC
Author

Fixes #2879

Summary

While a deploy downloads its images, ployz deploy now says so and names the image. Before, a multi-GB pull read only waiting 0/3 and still waiting: big (waiting 0/3) for minutes. waiting is also the word for a Service blocked on a dependency or on another Deployment, so a long pull looked like a stuck deploy.

-  big (depth 0): waiting 0/2
-  still waiting: big (waiting 0/2)
+  big (depth 0): waiting 0/2 (pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
+  still waiting: big (waiting 0/2, pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)

The CLI works this out from what the Config Store already records, with no new wire or Store state. The executor (deploy/exec, pull_images) pulls every image on every Server, then runs the plan's PrepareVolumes prelude, before any Server starts work on a Service. The Store records neither step (RowTracker skips rows with no Service name). So a Deployment that is Running, has its preview, has no build pending or building, and has no row past Pending (untargeted removal rows included) is pulling, or preparing Volumes when its plan has any.

  • frame (crates/ployz/src/handlers/deploy/progress.rs) then gives each waiting Service row the detail pulling <image>, with the image taken from the preview's operations. When the plan prepares Volumes, the detail reads pulling <image> or preparing Volumes. A Service under pull policy Never pulls nothing and gets no detail.

  • The plain still waiting: line (crates/ployz/src/ui/progress.rs) now carries a row's detail after its word, such as (waiting 0/2, pulling …). A row with no detail reads as before.

  • Once any Server starts work, the detail goes away. Services later in the depth order then read plain waiting, which is true again.

  • Docs: docs/user/troubleshooting/deployments.md, "Following a deploy in the CLI", says a deploy first downloads every image and how that reads.
  • Not in this PR

  • Byte or layer progress. ensure_image is a unary RPC to the daemon, so progress would need a streaming pull RPC. That's a wire change, which doesn't fit the soak or the stable promise.

  • The Cloud dashboard still shows its own waiting. This change covers only the CLI.

  • Cached images. A Service whose image is already on the Server still reads pulling <image> while other images download. Its own pull step is only a brief presence check, but the CLI can't tell it apart.
  • Stable promise

    No wire, Store, or daemon change. The derivation only reads rows the Store already records. Only CLI progress text changes: a detail on waiting rows during the pull, and the detail in still waiting: lines.

    DESIGN.md bets

    None changed. The CLI reads the same Store evidence. It names the stage the executor is in, which the evidence already implies.

    Evidence

  • Rung 2, crate units. Each new test was written first and failed before the change.

  • - handlers::deploy::progress::a_service_whose_servers_pull_its_image_says_so. A Running Deployment with a run_container for pytorch/pytorch:2.5.1 and its only row pending has the detail pulling pytorch/pytorch:2.5.1. Before: None.
    - a_service_that_never_pulls_does_not_say_it_is_pulling. Under Never, there's no detail.
    - once_a_server_starts_work_no_service_is_pulling. With web running, neither web nor the still-pending api has a detail.
    - a_removal_that_started_ends_the_pull. An untargeted removal that's running ends it.
    - a_deploy_that_prepares_volumes_does_not_claim_only_a_pull. The detail is pulling … or preparing Volumes.
    - ui::progress::tests::heartbeat_names_what_a_waiting_row_is_doing: still waiting: web on alpha (pending, pulling pytorch/pytorch:2.5.1).
    - All 71 progress tests in ployz pass, and cargo clippy -p ployz --all-targets --all-features is clean.
  • Real Machines. Incus, 2 Standalone Machines, this checkout's daemon and CLI. The steps were service add big --image pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime, set big.replicas=2 'big.startCommand=sleep infinity', then deploy, with plain output timestamped:

  •   +1s   big (depth 0): waiting 0/2 (pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
      +31s  still waiting: big (waiting 0/2, pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
      +61s  still waiting: big (waiting 0/2, pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
      +91s  still waiting: big (waiting 0/2, pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
      +121s still waiting: big (waiting 0/2, pulling pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime)
      +126s big (depth 0): booting 0/2
      +129s big (depth 0): booting 1/2
      +130s big (depth 0): switching 2/2
      +132s big (depth 0): switched 2/2
      1 deployed · across 2 servers
      

    The pull detail held for the whole ~125 s download and cleared as soon as the Servers started work. This ran on the first commit. The review fixes only narrow the rule (no Volumes, and a Missing pull policy, here), so this run's output is unchanged.

    Review

  • Round 1 (Codex + Opus).

  • - BUG (Codex): the PrepareVolumes prelude runs after the pulls, and the Store doesn't record it, so volume prep read pulling. Fixed: the detail says or preparing Volumes when the plan has any.
    - BUG (Codex): a Never Service read pulling while another downloaded. Fixed: no detail under Never. Cached Missing images are left as a gap, noted above.
    - BUG (Opus, plausible): untargeted removal rows didn't end the stage. Fixed.
    - GAP (Codex): the negative test didn't prove the stage clears globally. Replaced with a two-Service test.
    - NIT (Opus): a doc comment had been split from runtime_row. Restored.
    - Opus confirmed that the CLI-local runner records the all-Pending first snapshot, that built-image pushes happen before Prepared, and that queued and cancelling states are excluded. The still waiting: change doesn't regress other details.
  • Round 2 (Codex, fix diff). No BUG-class findings.
  • Merge Danger

    Door: two-way

    Blast Radius: CLI deploy progress text

    Only the CLI's progress text changes, and only while a running Deployment's rows all wait.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: nick-potts Review duration: 40m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.75) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #3188"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.5% · Safe to merge
    32.5%
    Repository