mvd001/cyberset / scripts /graphs /finalize_graphs.sh
mvd001's picture
download
raw
1.28 kB
#!/usr/bin/env bash
# Runs after the shard loop exits: refresh graph docs + bucket card, then sync ONLY graphs/, README.md and the graph/card scripts.
# usage: finalize_graphs.sh <shard_loop_pid>
cd /workspace/security-dataset; L=logs/graphs/finalize.log
while kill -0 "$1" 2>/dev/null; do sleep 120; done
echo "[$(date '+%F %T')] shard loop exited; finalizing" >> $L
tail -1 work/graphs/shards.jsonl >> $L
.venv/bin/python scripts/graphs/make_graph_docs.py >> $L 2>&1
cp data/code/STATS.md work/graphs/code_STATS.bak && touch -r data/code/STATS.md work/graphs/code_STATS.bak
.venv/bin/python scripts/publish/make_card.py >> $L 2>&1
cp work/graphs/code_STATS.bak data/code/STATS.md && touch -r work/graphs/code_STATS.bak data/code/STATS.md # not ours; keep as published
.venv/bin/python scripts/publish/secret_scan.py >> $L 2>&1 || { echo "FINAL_FAILED secret_scan" >> $L; exit 1; }
.venv/bin/hf sync ./data hf://buckets/mvd001/cyberset --include "README.md" --include "scripts/graphs/*" --include "scripts/publish/make_card.py" --exclude "*box-store-snap*" >> $L 2>&1
bash scripts/graphs/publish_graphs.sh final >> $L 2>&1
.venv/bin/python scripts/publish/verify_bucket.py "" >> $L 2>&1 && echo "FINAL_OK [$(date '+%F %T')]" >> $L || echo "FINAL_VERIFY_MISMATCH (see above)" >> $L

Xet Storage Details

Size:
1.28 kB
·
Xet hash:
f685e56cdda72d96d1f38bc130d83cd9946edad192aa459a8f531700588959a2

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.