Repository navigation
Try a job before paying for it: krater run and smoke tests - #77
Merged
Merged
Conversation
…ests `krater run` runs a job on this computer in Docker, set up as a Krater machine does (entrypoint sh, sh -c in the image's workdir, linux/amd64, the KRATER_* variables and folders, KRATER_LOCAL=1). It takes submit's options and job files, runs one job of a sweep (--index), mounts a local --input-dir as $KRATER_INPUT_DIR, passes project secrets set in this shell by name, and explains exit codes 125/126/127/137. Free, and no sign-in unless given a project. `krater submit --smoke` (and the job form's "Smoke test first") queues a smoke test: the runner sets KRATER_SMOKE=1, stops the command after N minutes (default 5, at most 30) of it running, and reports smoke_stopped, which Krater counts as a pass. A command that fails sooner fails as usual. The scheduler's backstop, the budget hold and the estimate use N + 10 minutes; the job keeps its max runtime, so `krater rerun --no-smoke` queues the full run. A sweep's smoke test queues its first job only; a smoke test waits at most an hour unless told otherwise; against an older Krater the CLI cancels the job at once. Migration b7e3f1a9c2d5 adds compute_jobs.smoke_minutes (nullable). CLI 0.4.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… backstop allows for inputs; members' guide Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adambomb210
force-pushed
the
claude/local-and-smoke-runs
branch
from
November 13, 2026 12:02
ed43a1e to
71eb81b
Compare
…ear-text logging) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two cheap ways to find a job's mistakes before paying for the whole run.
krater run: on your own computer, freeRuns a job in Docker, set up as a Krater machine sets it up (
cli/src/krater_cli/local.py):--entrypoint shandsh -c <command>in the image's working directory, on--platform linux/amd64;KRATER_*variables, plusKRATER_LOCAL=1;krater-local/<name>/outputsandcheckpointsmounted at/krater/....It takes
submit's options and job files, ignoring price and GPU options. It also has:--indexto pick which sweep job runs;--input-dirfor a local folder that stands in for$KRATER_INPUT_DIR(read-only);--resumed,--local-gpuand--docker podman;--smoke, which stops the command after N minutes, as on Krater.Project secrets that are set in the shell are passed by name (
-e NAME, so values never appear in argv). Secrets that aren't set are listed. It explains exit codes 125, 126, 127 and 137, and needs no sign-in unless given a project.krater submit --smoke: on the real machine, for a few centsThe form has the same option as a tick box, "Smoke test first".
--smoke-minutes Nsets the length (1–30, default 5).How a smoke test runs:
smoke_secondsfrom/startand setsKRATER_SMOKE=1./exitwithsmoke_stopped: true.What else changes:
krater/services/smoke.py), plus a minute per GB of inputs. The budget hold and the estimate use the same figure.krater rerun <job> --no-smoketherefore queues exactly the full run, and--smokemakes any rerun a smoke test.submitwithout--smoke.krater jobsmarks it, and "Run again" keeps the tick.Migration
b7e3f1a9c2d5adds the nullable columncompute_jobs.smoke_minutes; it only adds. CLI is now 0.4.0. Docs are updated indocs/compute/cli.md,docs/compute/runner.mdand the members' guide (new section "Trying it before paying", plusKRATER_SMOKEandKRATER_LOCALin the variables table).If this is reverted: the old code would run any queued smoke jobs as full-length jobs. They keep the member's max runtime, and the old runner has no timer.
Checked
vetandtest -racepass,gofmtis clean, and there are 3 new tests (the timer stops and reports, an earlier failure is the command's own, andKRATER_SMOKEis unset otherwise).alembic upgrade headandalembic checkare clean.krater runwas tried live with Docker Desktop:--smoke-minutes 1: SIGTERM at 60 s, "Smoke test passed", exit 0, no container left.smoke_stoppedto a real portal. That needs one paid staging run (about a cent:sleep 600with--smoke-minutes 1).🤖 Generated with Claude Code