From 088745336e8e2cd46199afb903dc77a45063d00f Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Fri, 3 Apr 2026 22:57:34 +0200 Subject: [PATCH] infra: wire feature-cache-pvc into compile-and-train pipeline Co-Authored-By: Claude Opus 4.6 (1M context) --- .../k8s/argo/compile-and-train-template.yaml | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/infra/k8s/argo/compile-and-train-template.yaml b/infra/k8s/argo/compile-and-train-template.yaml index 060c3c589..d97ecef21 100644 --- a/infra/k8s/argo/compile-and-train-template.yaml +++ b/infra/k8s/argo/compile-and-train-template.yaml @@ -63,7 +63,7 @@ spec: - name: trades-data-dir value: /data/futures-baseline-trades - name: feature-cache-dir - value: /workspace/feature-cache + value: /feature-cache - name: tx-cost-bps value: "0.1" - name: tick-size @@ -88,6 +88,9 @@ spec: - name: cargo-target-cuda persistentVolumeClaim: claimName: cargo-target-cuda + - name: feature-cache + persistentVolumeClaim: + claimName: feature-cache-pvc volumeClaimTemplates: - metadata: @@ -302,17 +305,19 @@ spec: echo "ERROR: precompute_features not found in /workspace/bin/" exit 1 fi - # Write to /workspace/ (writable emptyDir) — /data/ PVC is read-only $BINARY \ --data-dir /data/futures-baseline \ --mbp10-data-dir /data/futures-baseline-mbp10 \ --trades-data-dir /data/futures-baseline-trades \ - --output-dir /workspace/feature-cache \ + --output-dir /feature-cache \ --symbol ES.FUT \ --yes volumeMounts: - name: training-data mountPath: /data + readOnly: true + - name: feature-cache + mountPath: /feature-cache - name: workspace mountPath: /workspace resources: @@ -425,6 +430,8 @@ spec: value: ":4096:8" - name: CARGO_TARGET_DIR value: /workspace + - name: FOXHUNT_FEATURE_CACHE_DIR + value: "{{workflow.parameters.feature-cache-dir}}" args: - | set -e @@ -441,10 +448,7 @@ spec: mkdir -p /workspace/output/hyperopt - # Feature cache auto-invalidates via content hash — no manual clearing needed. - # The cache key includes data paths + MBP-10 + trades dirs, so stale caches - # are automatically skipped when data changes. - echo "=== Feature cache: $(ls /workspace/.foxhunt_feature_cache/*.bin 2>/dev/null | wc -l) cached files ===" + echo "=== Feature cache: $(ls ${FOXHUNT_FEATURE_CACHE_DIR}/*.fxcache 2>/dev/null | wc -l) fxcache files ===" MODEL="{{workflow.parameters.model}}" case "$MODEL" in @@ -492,6 +496,9 @@ spec: - name: training-data mountPath: /data readOnly: true + - name: feature-cache + mountPath: /feature-cache + readOnly: true # ── train-best: full training with best hyperparams ── - name: train-best @@ -573,6 +580,9 @@ spec: - name: training-data mountPath: /data readOnly: true + - name: feature-cache + mountPath: /feature-cache + readOnly: true # ── evaluate: run evaluation on trained model ── - name: evaluate @@ -637,6 +647,9 @@ spec: - name: training-data mountPath: /data readOnly: true + - name: feature-cache + mountPath: /feature-cache + readOnly: true # ── upload-results: push artifacts to GitLab packages ── - name: upload-results