Files
foxhunt/scripts/argo-precompute.sh
jgrusewski 55821af90d fix: argo-precompute.sh uses train workflow + regenerated v2 fxcache
Script rewritten to use argo submit --from=wftmpl/train with
train-epochs=0 — runs ensure-binary + ensure-fxcache only.
Local test fxcache regenerated with FXCACHE_VERSION=2, OFI_DIM=20.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 01:29:42 +02:00

53 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Regenerate fxcache on PVC — uses the train workflow's ensure-binary + ensure-fxcache steps.
# Submits a lightweight workflow that compiles the binary and regenerates the feature cache.
# No GPU needed — runs entirely on ci-compile-cpu.
#
# Usage: ./scripts/argo-precompute.sh [--branch main] [--watch]
set -euo pipefail
BRANCH="main"
WATCH=false
while [[ $# -gt 0 ]]; do
case "$1" in
--branch) BRANCH="$2"; shift 2;;
--watch) WATCH=true; shift;;
-h|--help)
echo "Usage: $0 [--branch <branch>] [--watch]"
echo ""
echo "Regenerates fxcache on PVC with current code."
echo "Uses ensure-binary + ensure-fxcache from the train workflow."
echo "Runs on ci-compile-cpu — no GPU required."
echo ""
echo "The fxcache auto-invalidates on version mismatch"
echo "(FXCACHE_VERSION in fxcache.rs). Old cache is deleted"
echo "and regenerated automatically."
exit 0;;
*) echo "Unknown option: $1"; exit 1;;
esac
done
echo "=== Argo Precompute fxcache ==="
echo " branch: $BRANCH"
echo ""
# Submit a training workflow with 0 epochs — it will compile + ensure-fxcache, then stop.
# hyperopt-trials=0 + train-epochs=0 means only ensure-binary + ensure-fxcache run.
WORKFLOW_NAME=$(argo submit -n foxhunt --from=wftmpl/train \
-p git-branch="$BRANCH" \
-p hyperopt-trials=0 \
-p train-epochs=0 \
-o name 2>&1)
echo "Submitted: $WORKFLOW_NAME"
echo " ensure-binary → ensure-fxcache (compile + regenerate)"
echo ""
echo "Monitor: kubectl -n foxhunt logs -f $WORKFLOW_NAME --tail=50"
if $WATCH; then
echo ""
echo "Watching..."
argo watch -n foxhunt "$WORKFLOW_NAME"
fi