#!/usr/bin/env bash # E7 · las medidas del pre-registro, en orden: m1 (DuckDB, primera implementación: el módulo de la web), m2 (Python sin DuckDB, # segunda implementación y muestras), m3 (DuckDB, contrastes con unified y con el crudo de la PLACSP), m4 (veredictos). # Contenedores sin red, solo lectura de los datos, -m 8g / 6g, uno detrás de otro. Uso: medidas/correr.sh [m1|m2|m3|m4|todo] set -euo pipefail E7=/web-e7; W=/; V2=/; T=$E7/tmp MONT=(-v $W/app:/app/app:ro -v $W/etl:/app/etl:ro -v $V2/unified_20261025:/data/unified:ro -v $V2/unified_20261025.identidad:/data/unified.identidad:ro -v $V2/unified_20261025.vinculos:/data/unified.vinculos:ro -v $T/rel/unified_20261025.relaciones:/data/unified.relaciones:ro -v /e3_eforms/run/sat2/unified_20261025.licitadores:/data/unified.licitadores:ro -v /web-licpub/salidas/licitadores_publicos_20261025e:/data/unified.licitadores_publicos:ro -v $T/pr_sat/unified_20261025.sobres:/data/unified.sobres:ro -v $V2/aggregations_20261025/indicadores:/data/indicadores:ro -v $E7:/e7) paso=${1:-todo} if [ "$paso" = m1 ] || [ "$paso" = todo ]; then docker run --rm --name e7-m1 -m 8g --memory-swap 8g --cpus 3 --network none --user 1000:1000 "${MONT[@]}" -w /app \ :latest timeout 1800 python3 /e7/medidas/m1_base.py fi if [ "$paso" = m2 ] || [ "$paso" = todo ]; then python3 -I $E7/medidas/m2_segunda.py; fi if [ "$paso" = m3 ] || [ "$paso" = todo ]; then docker run --rm --name e7-m3 -m 6g --memory-swap 6g --cpus 3 --network none --user 1000:1000 "${MONT[@]}" \ -v $V2/raw_preserved/20261025/nacional/salida:/crudo:ro -w /app :latest timeout 1800 python3 /e7/medidas/m3_cotejo.py fi if [ "$paso" = m4 ] || [ "$paso" = todo ]; then python3 -I $E7/medidas/m4_veredicto.py; fi