blumeops/mise-tasks/frigate-export-model
Erich Blume 260b7ca520 Fix dagger call hanging in mise tasks on interactive terminals (#256)
## Summary

- Add `--progress=plain` to all `dagger call` invocations in mise tasks to prevent SIGTTOU hangs

## Root cause

Mise runs task scripts in a child process group that is not the terminal's foreground group. When `dagger call` detects a TTY (inherited from the interactive shell), it tries to render its TUI progress display, which requires terminal ioctls. Since the process is not in the foreground group, the kernel sends SIGTTOU, stopping the process indefinitely.

This only manifests when running from an interactive terminal (e.g. `pre-commit run --all-files` in fish/wezterm). CI and piped contexts are unaffected since there's no TTY.

## Changes

- `mise-tasks/validate-workflows` — add `--progress=plain`
- `mise-tasks/frigate-export-model` — add `--progress=plain`
- `mise-tasks/provision-ringtail` — add `--progress=plain`

## Test plan

- [x] `pre-commit run --all-files` completes without hanging
- [ ] Verify in interactive fish/wezterm terminal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/256
2026-02-23 14:15:58 -08:00

55 lines
1.9 KiB
Bash
Executable file

#!/usr/bin/env bash
#MISE description="Export YOLOv9 model weights to ONNX for Frigate NVR via Dagger"
#USAGE flag "--model-size <size>" default="c" help="Model variant: s (small), c (compact), e (extra-large)"
#USAGE flag "--input-size <pixels>" default="640" help="Input resolution (width=height)"
#USAGE flag "--deploy" help="Copy exported model to sifaka NAS frigate share"
set -euo pipefail
MODEL_SIZE="${usage_model_size:-c}"
INPUT_SIZE="${usage_input_size:-640}"
DEPLOY="${usage_deploy:-false}"
OUTPUT_FILE="yolov9-${MODEL_SIZE}-${INPUT_SIZE}.onnx"
echo "Exporting YOLOv9-${MODEL_SIZE} (${INPUT_SIZE}x${INPUT_SIZE}) via Dagger..."
echo ""
dagger call --progress=plain export-yolov-9 \
--model-size="$MODEL_SIZE" \
--input-size="$INPUT_SIZE" \
export --path="$OUTPUT_FILE"
SIZE=$(du -h "$OUTPUT_FILE" | cut -f1)
echo ""
echo "Exported: ${OUTPUT_FILE} (${SIZE})"
if [[ "$DEPLOY" == "true" ]]; then
DEST="sifaka:/volume1/frigate/models/${OUTPUT_FILE}"
echo "Copying to ${DEST}..."
scp -O "$OUTPUT_FILE" "$DEST"
echo "Deployed."
echo ""
echo "Update argocd/manifests/frigate/configmap.yaml:"
echo " model:"
echo " model_type: yolo-generic"
echo " width: ${INPUT_SIZE}"
echo " height: ${INPUT_SIZE}"
echo " input_tensor: nchw"
echo " input_dtype: float"
echo " path: /media/frigate/models/${OUTPUT_FILE}"
echo " labelmap_path: /labelmap/coco-80.txt"
else
echo ""
echo "To deploy to Frigate NAS:"
echo " scp ${OUTPUT_FILE} sifaka:/volume1/frigate/models/"
echo ""
echo "Then update argocd/manifests/frigate/configmap.yaml:"
echo " model:"
echo " model_type: yolo-generic"
echo " width: ${INPUT_SIZE}"
echo " height: ${INPUT_SIZE}"
echo " input_tensor: nchw"
echo " input_dtype: float"
echo " path: /media/frigate/models/${OUTPUT_FILE}"
echo " labelmap_path: /labelmap/coco-80.txt"
fi