Skip to content

task run: staging floods command.log with s3 progress; docker installed on every launch (~50 s); 1 s phase timestamps #1072

Open

Description

@scttfrdmn

Three findings from running sclero images as spawn task run container tasks (spawn v0.128.2, us-west-2, c6i.large). Evidence is in spore-host/sclero results/g2/task-* and hstart-*.

  1. Staging floods command.log with progress output. pkg/taskproto/wrapper.go:215 (stage-in) and :275 (stage-out) run aws s3 cp with neither --no-progress nor --only-show-errors. With a multi-MB input, command.log fills with \r-separated progress lines, about 20 lines per file. That buries the task's own output and the phase markers. Fix: add --only-show-errors (or --no-progress) to both calls.
  2. Docker is installed on every task launch (wrapper.go:384, sudo dnf install -y docker). That takes 48–51 s on every launch (3 runs). It is about a third of launch-to-first-useful-command for a 6.2 GB image: the pull is about 85 s, and the whole launch about 152 s. Suggestions:
    • use an AMI with Docker pre-installed for task hosts;
    • or start the install in parallel with input stage-in;
    • or cache the docker rpm set.
  3. spawn_phase timestamps are at 1 s resolution (wrapper.go:128). That limits phase timing for short phases such as container start; we measured a 3.8–4.5 s container start. Suggestion: millisecond timestamps (date -u +%FT%T.%3NZ).

Also, a note rather than a bug: the task path has no hook for a user-supplied boot backstop, the equivalent of --user-data for spawn launch. TTL enforcement on task hosts therefore relies on spored alone. spored did terminate every one of our task instances itself; the gap is only that there's no defence-in-depth hook.

Activity

  1. added this to the v0.138.0 milestone on Oct 19, 2026
  2. scttfrdmn commented on Oct 20, 2026

    @scttfrdmn
    ContributorAuthor

    Status after #1239:

    • Item 1 (staging noise): done. Every wrapper aws s3 cp passes --no-progress, so command.log keeps one line per file plus errors.
    • Item 3 (1 s phase timestamps): done. spawn_phase now stamps %Y-%m-%dT%H:%M:%S.%3NZ (GNU date on AL2023). completion.json's started_at/ended_at are unchanged.
    • Item 2 (Docker installed on every launch): partly addressed, the main fix needs an owner decision.
      • Done: the Docker install now starts in the background before stage-in, and the wrapper waits for it before it starts the daemon, pulls or runs. A failed install is still instance_health (task run: a container task at default sizing fails, because Docker's install is OOM-killed on t4g.nano (and is classified app_error) #1180). Reasoning from E1's numbers (not measured): the install is ~66 s and staging is usually shorter, so a launch saves about the staging time, capped at the install time. A task with little or no input saves almost nothing.
      • Still open, the decision: whether to give task hosts an AMI with Docker pre-installed. That removes the ~66 s from every launch, not just the part that overlaps staging. Options:
        1. a spore.host-built task-host AMI (Docker + NVIDIA Container Toolkit, per arch and per region; needs build, publish and retirement processes, and a way to keep it patched);
        2. keep the stock AL2023 and cache the docker rpm set (e.g. in the results or artifact bucket);
        3. accept the remaining cost.
      • Nothing has been built. One unmeasured risk of the overlap: dnf and aws s3 cp now share memory, which at the 2 GiB container floor should fit. If dnf is killed, the result is instance_health (retryable), as before.
  3. modified the milestones: v0.138.0, Later on Oct 20, 2026
  4. modified the milestones: Later, Post-1.0 on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions