Spaces:
Sleeping
Sleeping
malteos commited on
verify-real: bootstrap cdxt on demand for the fetch step
Browse filescdx_toolkit is no longer a standing dev dependency, so the real-path fetch check
installs it on demand (mirroring the HF fetch job's runtime install) instead of
assuming it in the venv.
Claude-Session: https://claude.ai/code/session_01EKnXafnPtBVLvtxUfU2GkR
- scripts/verify_real.sh +8 -0
scripts/verify_real.sh
CHANGED
|
@@ -22,6 +22,14 @@ CC_INDEX_MODE=cdn CC_CRAWLS="$CRAWL" CC_DOMAINS="$DOMAIN" CC_HOSTNAMES="" \
|
|
| 22 |
CC_RANGES_OUT="$RANGES" $PY -m src.index_query
|
| 23 |
|
| 24 |
N=$(($(wc -l < "$RANGES") - 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
echo "== fetch: $N records from the commoncrawl bucket via hf-cdn =="
|
| 26 |
CDXT_UVLOOP=1 $CDXT -v repackage --target-source csv --csv-path "$RANGES" \
|
| 27 |
--warc-download-prefix hf://buckets/commoncrawl/commoncrawl --hf-reader cdn \
|
|
|
|
| 22 |
CC_RANGES_OUT="$RANGES" $PY -m src.index_query
|
| 23 |
|
| 24 |
N=$(($(wc -l < "$RANGES") - 1))
|
| 25 |
+
# The fetch step runs the real `cdxt repackage` CLI (as the HF fetch job does). cdxt
|
| 26 |
+
# is not a standing dev dependency — the estimate above uses the vendored SQL — so
|
| 27 |
+
# install it on demand here if it is missing, mirroring the job's runtime install.
|
| 28 |
+
if [ ! -x "$CDXT" ]; then
|
| 29 |
+
echo "== installing cdx_toolkit for the fetch step (not a standing dev dep) =="
|
| 30 |
+
uv pip install --python .venv \
|
| 31 |
+
"cdx_toolkit[hf] @ git+https://github.com/commoncrawl/cdx_toolkit.git@feat/warc-range-sources" uvloop
|
| 32 |
+
fi
|
| 33 |
echo "== fetch: $N records from the commoncrawl bucket via hf-cdn =="
|
| 34 |
CDXT_UVLOOP=1 $CDXT -v repackage --target-source csv --csv-path "$RANGES" \
|
| 35 |
--warc-download-prefix hf://buckets/commoncrawl/commoncrawl --hf-reader cdn \
|