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>
This commit is contained in:
jgrusewski
2026-04-17 01:29:42 +02:00
parent 61c4b043c6
commit 55821af90d
2 changed files with 26 additions and 51 deletions

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bash
# Regenerate fxcache on PVC from MBP-10 + trades data.
# 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
@@ -12,7 +15,14 @@ while [[ $# -gt 0 ]]; do
--watch) WATCH=true; shift;;
-h|--help)
echo "Usage: $0 [--branch <branch>] [--watch]"
echo " Regenerates fxcache on PVC with OFI_DIM=20 (20 microstructure features)"
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
@@ -22,56 +32,21 @@ echo "=== Argo Precompute fxcache ==="
echo " branch: $BRANCH"
echo ""
WORKFLOW=$(cat <<EOF | kubectl -n foxhunt create -f - -o name
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: precompute-fxcache-
spec:
entrypoint: precompute
volumes:
- name: training-data
persistentVolumeClaim:
claimName: training-data-pvc
templates:
- name: precompute
nodeSelector:
k8s.scaleway.com/pool-name: ci-compile-cpu
container:
image: rg.fr-par.scw.cloud/foxhunt/ci-builder:latest
command: ["/bin/bash", "-c"]
args:
- |
set -ex
cd /workspace
git clone --depth 1 --branch ${BRANCH} ssh://root@100.90.76.85:2222/root/foxhunt.git .
rm -f /mnt/training-data/feature-cache/*.fxcache
SQLX_OFFLINE=true cargo build -p ml --release --example precompute_features
echo "yes" | SQLX_OFFLINE=true ./target/release/examples/precompute_features \\
--data-dir /mnt/training-data/futures-baseline \\
--mbp10-data-dir /mnt/training-data/futures-baseline-mbp10 \\
--trades-data-dir /mnt/training-data/futures-baseline-trades
echo "=== Precompute complete ==="
ls -lh /mnt/training-data/feature-cache/*.fxcache
xxd /mnt/training-data/feature-cache/*.fxcache | head -2
volumeMounts:
- name: training-data
mountPath: /mnt/training-data
resources:
requests:
cpu: "4"
memory: "16Gi"
limits:
cpu: "8"
memory: "32Gi"
timeout: "30m"
EOF
)
# 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"
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 "Watching logs..."
sleep 5
kubectl -n foxhunt logs -f "$WORKFLOW" --tail=50
echo ""
echo "Watching..."
argo watch -n foxhunt "$WORKFLOW_NAME"
fi