Make targets¶
The Makefile at the repository root wraps the common commands. Run
make on its own to list the targets. The tools each target needs are
listed in Developer tools.
On the bench host, install make with the other packages (see
Bench host).
| Target | Runs | Notes |
|---|---|---|
make help (or just make) |
Prints every target with its description | The default target. Descriptions come from each target's ## comment in the Makefile. |
make sync |
uv sync |
Add UV_NO_DEV=1 to skip the dev group, as on the bench host. |
make bench |
uv run snap-asr-bench $SOURCE --targets $TARGETS --chunk-seconds $CHUNKS $ARGS, or with --manifest $MANIFEST in place of $SOURCE. With PLAN, --plan $PLAN in place of --targets and --chunk-seconds. |
Set SOURCE, MANIFEST or PLAN, and not both SOURCE and MANIFEST. See Variables. |
make push-hosts |
Copies the code to ~/$PUSH_DIR on each host in HOSTS, over SSH: in a Git checkout, Git's tracked files as they are in the working tree; otherwise the directory without the paths Deploy code via S3 leaves out, plus scratch/ and .envrc |
Without HOSTS, the hosts are each target's runner_host (or name) in TARGETS. Each SSH name must connect without prompts (SSH over Session Manager). Nothing on the hosts is deleted; each host records the commit it got in ~/$PUSH_DIR/.pushed. In a Git checkout it lists untracked files it didn't send, and stops if a tracked file is deleted but not committed. |
make score |
uv run snap-asr-bench-score $EVENTS $ARGS |
EVENTS is required. See Validate accuracy. |
make sync-manifest |
python3 scripts/sync-manifest.py $MANIFEST $DATA_DIR -- $ARGS: one aws s3 sync per S3 directory the manifest names, including only its files |
MANIFEST and DATA_DIR are required. Every s3:// cell is fetched, media and references alike, to its key under DATA_DIR without the bucket name: s3://bucket/takes/a.wav goes to $DATA_DIR/takes/a.wav. Unchanged files are skipped. ARGS go to each aws s3 sync, e.g. ARGS=--dryrun. Fails if a file isn't in S3. |
make docs |
uv run --group docs mkdocs serve --dev-addr $DOCS_HOST:$DOCS_PORT |
Serves these docs with live reload at http://127.0.0.1:8000/ by default. Use DOCS_PORT for another port. |
make docs-build |
uv run --group docs mkdocs build --strict |
Fails on broken links or nav warnings. |
make lint |
lint-py and lint-tf |
Every linter. |
make lint-py |
uvx ruff check and uvx ruff format --check |
Checks src, tests and sidecar. |
make lint-tf |
terraform fmt -check, terraform validate and tflint |
Checks terraform/. Runs terraform init -backend=false first, so the state isn't touched. Rules are in terraform/.tflint.hcl. |
make lint-fix |
uvx ruff check --fix |
Applies the lint fixes ruff can make safely. Fix the rest by hand. |
make format |
uvx ruff format and terraform fmt -recursive |
Rewrites Python in ruff's Black-compatible style and Terraform in its canonical style. |
make test |
uv run pytest |
|
make install-bench |
deploy/bench/mount-instance-store.sh, then UV_NO_DEV=1 uv sync |
Bench host. See Bench host. |
make install-nvidia |
install-vllm-nvidia and install-sidecar-nvidia |
g4dn, g7e or g6. Needs NVIDIA_HOST. |
make install-vllm-nvidia |
Creates the cache directories, pulls IMAGE from <host>.env (or <host>.local.env, if it sets one), installs and starts vllm.service, and installs the journald cap (deploy/systemd/journald-snap-asr-bench.conf: 2 days, 2 GB) |
Needs NVIDIA_HOST=g4dn or g7e. See NVIDIA hosts. |
make install-sidecar-nvidia |
Installs and starts asr-log-sidecar.service with deploy/nvidia/sidecar.env |
See Log sidecar. |
make install-trn2 |
install-vllm-trn2 and install-sidecar-trn2 |
trn2 host. |
make install-vllm-trn2 |
Creates the cache directories, logs in to ECR, pulls IMAGE from trn2.local.env (the shipped trn2.env has a placeholder), installs and starts vllm.service, and installs the journald cap (deploy/systemd/journald-snap-asr-bench.conf: 2 days, 2 GB) |
See Trainium host. |
make install-sidecar-trn2 |
Installs and starts asr-log-sidecar.service with deploy/trn2/sidecar.env |
|
make image-trn2 |
docker build of deploy/trn2/Dockerfile |
Tag snap-vllm-neuron:trn2-<fork>-<nki>-audio, prefixed with REGISTRY if set. See Container images. |
make image-client |
docker build -f deploy/client/Dockerfile . |
Tag snap-asr-bench-client:<git describe>, prefixed with REGISTRY if set. |
make ecr-login |
aws ecr get-login-password \| docker login |
Needs REGISTRY. The region is read from it. |
make image-push-trn2 |
ecr-login, image-trn2, then docker push |
Needs REGISTRY. |
make image-push-client |
ecr-login, image-client, then docker push |
Needs REGISTRY. Refuses if tracked files have uncommitted changes. |
make clean |
Removes site/, dist/, .mkdocs-team.yml, the pytest and ruff caches and __pycache__ folders. |
The install-* targets use sudo and run on the host they set up, from
~/snap-asr-bench. They're safe to re-run after a
code deploy: each one reinstalls the files and the
enable --now leaves a running service alone, so restart it to pick up changes
(sudo systemctl restart vllm asr-log-sidecar). The vLLM targets don't follow
the journal; run journalctl -u vllm -f afterwards.
Variables¶
Targets take their inputs as make variables on the command line:
| Variable | Default | Passed as |
|---|---|---|
SOURCE |
required for make bench, unless MANIFEST is set |
The input argument: a local path or s3://bucket/key. |
MANIFEST |
required for make bench, unless SOURCE is set, and for make sync-manifest |
--manifest: a local path or s3://bucket/key of a manifest CSV. |
DATA_DIR |
required for make sync-manifest |
Local directory the manifest's S3 files are copied into. |
PLAN |
empty | --plan: a benchmark plan. The plan then sets the inputs, targets and chunk lengths. TARGETS and CHUNKS are passed only when set on the make command line, and then override the plan. |
EVENTS |
required for make score |
One or more events.jsonl files, space-separated. |
TARGETS |
targets.toml |
--targets. For make push-hosts, where the hosts come from when HOSTS isn't set. |
HOSTS |
each target's runner_host (or name) in TARGETS |
SSH host names for make push-hosts, space-separated. |
PUSH_DIR |
snap-asr-bench |
Directory on each host for make push-hosts, relative to the SSH user's home. |
CHUNKS |
1,2,5 |
--chunk-seconds |
ARGS |
empty | Appended as-is. Use it for any other CLI option, or snap-asr-bench-score option for make score. For make sync-manifest, aws s3 sync options. |
NVIDIA_HOST |
required for the NVIDIA install targets | g4dn, g7e or g6. Picks deploy/nvidia/<host>.env. |
SERVICE_USER |
ec2-user |
Owner of /opt/snap-asr-bench. |
REGISTRY |
empty | ECR registry for the image targets, e.g. 123456789012.dkr.ecr.us-east-1.amazonaws.com. Required to push. |
DOCS_PORT |
8000 |
Port for make docs. |
DOCS_HOST |
127.0.0.1 |
Address make docs listens on. 0.0.0.0 makes the site reachable from other machines on the network. An SSM port forward doesn't need it, because it connects to 127.0.0.1 on the instance. |
TEAM_DOCS |
1 |
Has an effect only in a checkout that has team pages: 0 serves the docs without them. |
PLATFORM |
linux/amd64 |
docker build --platform. All hosts are x86-64. |
VLLM_NEURON_SHA, NKI_LIBRARY_SHA |
The ARG defaults in deploy/trn2/Dockerfile |
Fork commits for image-trn2. The tag uses their first 7 characters. |
Quote ARGS when it holds more than one word:
make bench SOURCE="s3://$BUCKET/inputs/sample.mp4" CHUNKS=1,2,5,10 ARGS="--pacing afap --repeats 2"
Use make -n bench ... to print the command without running it.