Skip to content

fix(task): quiet S3 staging, millisecond phase markers, Docker install overlaps stage-in (#1072) - #1239

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1072-task-log-noise
Oct 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1072-task-log-noise

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Refs #1072. This fixes items 1 and 3 and does the low-risk part of item 2. The issue stays open for the task-host AMI decision, which needs the owner; see the comment on #1072.

What

  1. Quiet staging. Every aws s3 cp in the wrapper, the pooled job script and the flush script now starts with aws s3 cp --no-progress. That covers stage-in, stage-out (including the provenance fallback), and the command.log, completion.json and .exitcode uploads. I chose --no-progress over --only-show-errors so the one download:/upload: line per file stays alongside the errors.
  2. Millisecond phase markers. spawn_phase stamps with taskproto.PhaseTimestampFormat = +%Y-%m-%dT%H:%M:%S.%3NZ (GNU date, which AL2023 ships). started_at/ended_at in completion.json are left as they are, since adapters and the cost estimate parse them.
  3. Docker install overlaps stage-in (container tasks). The command -v docker || sudo dnf install -y docker subshell starts in the background right after the env exports and before stage-in. Its output goes to a file. writeContainerRun then does wait "$DOCKER_INSTALL_PID" || RUNTIME_RC=$?, prints the install log as one block, and only after that starts the daemon, sets up the GPU toolkit, pulls and runs. The 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 classification is unchanged: a failed install is instance_health. The stage-in failure branch also waits, so a background dnf is never left running. That matters for a pooled worker's next job, which would hit the dnf lock, and for test children.

Expected effect, reasoned from E1 numbers and not measured: the install is ~66 s on every launch and staging is usually shorter, so time before docker pull goes from install plus staging to roughly the longer of the two. Risk: dnf and aws s3 cp now share memory. At the 2 GiB container floor that should fit but hasn't been measured. If dnf is OOM-killed, the result is instance_health (retryable), the same as before.

Gates (each watched failing against a revert that compiles)

  • TestWrapperS3CopiesAreQuiet: discovers aws s3 cp|sync invocations in the host, container, pooled and flush scripts. The regex is anchored at command position, so the words in the 'uploading untagged with aws s3 cp' message don't count. Each invocation must carry the flag, and the test fails if discovery finds nothing or misses the stage-in or stage-out copies. Fails when s3Cp is reverted to aws s3 cp.
  • TestWrapperPhaseTimestampsHaveMilliseconds: runs the wrapper under bash and parses every spawn: [...] stamp with 2006-01-02T15:04:05.000Z. Fails when the format is reverted. The stand-in date (installStandInDate) is the real date when it's GNU (Linux CI), gdate otherwise, and failing both a shim that fills %3N with 000.
  • TestWrapperDockerInstallOverlapsStageIn: fake aws, dnf, docker and systemctl append to one event log. The stage-in copy waits (bounded) for dnf-begin, and dnf waits (bounded) for stage-in, so only a parallel install produces dnf-begin < stage-in < dnf-end. dnf then holds for up to 1 s and finishes early only if the wrapper touches Docker. It has three cases: install succeeds, install killed (137), and stage-in fails. Failures seen against each revert:
    • install moved back inline: overlap failure in all 3 cases;
    • wait removed: systemctl ran before the Docker install finished;
    • wait || true (exit status dropped): the daemon was started after the install failed. Note that without this assertion the revert still came out instance_health, because the later docker-info check catches it;
    • the stage-in failure branch's wait removed: missing events (no dnf-end).
  • Existing 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 gates (TestGenerateWrapper_ContainerRuntimeFailureIsNotAppError, ...CommandFailureStaysAppError) pass unchanged.

Checks

make check: everything passes except check-build-tags, which fails the same way on unmodified main on this machine (/private/tmp paths). make lint reports 0 issues. make check-docs is clean, since no help text changed. semgrep scan --config=auto --error . is clean (two bare // nosemgrep on test exec calls). api/public-surface.txt has PhaseTimestampFormat added. No AWS calls were made.

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…l overlaps stage-in (#1072)

- Every wrapper/flush aws s3 cp passes --no-progress (one line per file and
  errors stay; the progress meter goes).
- spawn_phase stamps with date -u +%Y-%m-%dT%H:%M:%S.%3NZ (GNU date on
  AL2023); started_at/ended_at keep their form.
- A container task starts dnf install docker in the background before
  stage-in and waits for it before the daemon, pull or run. A failed install
  is still instance_health; a failed stage-in still waits for it.

Refs #1072
@scttfrdmn
scttfrdmn force-pushed the fix/1072-task-log-noise branch from c97c020 to 941bc00 Compare October 20, 2026 17:02
@scttfrdmn
scttfrdmn merged commit d4007fb into main Oct 20, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1072-task-log-noise branch October 20, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant