Files
tea/deploy/verify.sh
T
AlbertoPMDM 4956f36d80 serving (MLflow), HK1K verification command and the tea-verify DaskJob
- serving: plans and biomarkers as MLflow "models from code" (standalone
  wrapper files), code_paths = only the module's package + contracts;
  plan.json artifact and plan params; biomarker models pin plan_uri and
  plan_hash. privacy: no study codes / dates / paths, binary artifacts
  refused, baselines from fewer than 5 children refused.
- verify: python -m tea_modulo.verify hk1k lists HK1K in a worker task, runs
  the pipeline remotely (line 50 Hz), checks the remote run equals a plain
  sequential run in one task, summarizes the posterior rhythm by age group
  (groups < 5 suppressed) and writes the summary under processed/usuarios/.
  Any input prefix but raw/eeg-helsinki/ is refused.
- deploy: Dockerfile.verify (dask:1.1 + antropy, fhir.resources, meegkit,
  pytest; tea-modulo from the local checkout), .dockerignore keeping .venv,
  eeg/ and any signal or patient file out, dask-verify.yaml (own 2x4-worker
  cluster, no eeg-data PVC, keys only on workers), verify.sh.

Tests: MLflow round trips on sqlite, model loads with only its own code in
a fresh interpreter, privacy refusals, verify guards.
2026-11-18 20:24:03 -06:00

23 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build, push and run the tea-verify DaskJob for the current commit.
# deploy/verify.sh build + push + apply
# deploy/verify.sh --logs follow the job pod's log
# deploy/verify.sh --delete remove the DaskJob
set -euo pipefail
cd "$(dirname "$0")/.."
REG=192.168.20.18:5000
case "${1:-}" in
--logs) pod=$(kubectl get pods -l dask.org/cluster-name=tea-verify,dask.org/component=job -o name | head -1)
exec kubectl logs -f "${pod:-job/tea-verify}" ;;
--delete) exec kubectl delete daskjob tea-verify --ignore-not-found ;;
esac
if [ -n "$(git status --porcelain --ignore-submodules=none)" ]; then
echo "uncommitted changes: commit first, so the image tag is a real commit" >&2; exit 1
fi
C=$(git rev-parse --short HEAD)
docker build -f deploy/Dockerfile.verify --build-arg TEA_COMMIT="$C" -t "$REG/tea-verify:$C" .
docker push "$REG/tea-verify:$C"
kubectl delete daskjob tea-verify --ignore-not-found
sed "s/tea-verify:COMMIT/tea-verify:$C/g" deploy/dask-verify.yaml | kubectl apply -f -
echo "applied tea-verify:$C — follow with: deploy/verify.sh --logs"