diff --git a/.github/workflows/test-native.yml b/.github/workflows/test-native.yml index 6310b2aa..ef31992f 100644 --- a/.github/workflows/test-native.yml +++ b/.github/workflows/test-native.yml @@ -978,6 +978,15 @@ jobs: done echo "::warning::could not pre-warm the embedding model after 3 attempts; the dataset step will retry" + # The tiny Stack Overflow dataset with its vectors: embedding it takes 8 minutes on linux and 12 to 16 on macOS and Windows + # (the longest step of the nightly run), and the bytes are the same every night. scripts/run_examples.sh reuses the + # directory when it holds the marker file it writes after a complete download. The key changes with download_data.py. + - name: Cache the Stack Overflow Tiny dataset + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: examples/data/stackoverflow-tiny + key: so-tiny-vectors-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('examples/download_data.py') }} + - name: Download datasets run: bash scripts/run_examples.sh datasets diff --git a/.github/workflows/test-python-examples.yml b/.github/workflows/test-python-examples.yml index 6f8e2ee2..bc928b5d 100644 --- a/.github/workflows/test-python-examples.yml +++ b/.github/workflows/test-python-examples.yml @@ -467,6 +467,15 @@ jobs: done echo "::warning::could not pre-warm the embedding model after 3 attempts; the dataset step will retry" + # The tiny Stack Overflow dataset with its vectors: embedding it takes 8 minutes on linux and 12 to 16 on macOS and Windows + # (the longest step of the nightly run), and the bytes are the same every night. scripts/run_examples.sh reuses the + # directory when it holds the marker file it writes after a complete download. The key changes with download_data.py. + - name: Cache the Stack Overflow Tiny dataset + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: examples/data/stackoverflow-tiny + key: so-tiny-vectors-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('examples/download_data.py') }} + - name: Download datasets shell: bash run: | diff --git a/scripts/run_examples.sh b/scripts/run_examples.sh index 92e2eab8..3872227d 100755 --- a/scripts/run_examples.sh +++ b/scripts/run_examples.sh @@ -81,14 +81,28 @@ datasets() { fetch movielens-small movielens-small fi - if echo "$examples" | grep -qE '(^|[[:space:]])(07_stackoverflow_tables_oltp|08_stackoverflow_tables_olap|09_stackoverflow_graph_oltp|10_stackoverflow_graph_olap|13_stackoverflow_hybrid_queries)\.py([[:space:]]|$)'; then + # The tiny Stack Overflow dataset with its vectors takes 8 to 16 minutes to embed on a runner and is the same bytes every night + # (pinned dump, pinned model). The workflows cache examples/data/stackoverflow-tiny, keyed on download_data.py; this marker says + # the cached directory is the complete one (vectors included), which also serves the no-vector examples. + tiny_marker="data/stackoverflow-tiny/.ci-vectors-complete" + tiny_cached=0 + if [ -f "$tiny_marker" ]; then + tiny_cached=1 + echo "♻️ Reusing the cached Stack Overflow Tiny dataset (with vectors)" + fi + + if [ "$tiny_cached" -eq 0 ] && echo "$examples" | grep -qE '(^|[[:space:]])(07_stackoverflow_tables_oltp|08_stackoverflow_tables_olap|09_stackoverflow_graph_oltp|10_stackoverflow_graph_olap|13_stackoverflow_hybrid_queries)\.py([[:space:]]|$)'; then echo "📥 Downloading Stack Overflow Tiny dataset (no vectors)..." fetch stackoverflow-tiny-novec stackoverflow-tiny --no-vectors fi - if echo "$examples" | grep -qE '(^|[[:space:]])(11_vector_index_build|12_vector_search)\.py([[:space:]]|$)'; then + if [ "$tiny_cached" -eq 0 ] && echo "$examples" | grep -qE '(^|[[:space:]])(11_vector_index_build|12_vector_search)\.py([[:space:]]|$)'; then echo "📥 Downloading Stack Overflow Tiny dataset (with vectors)..." fetch stackoverflow-tiny stackoverflow-tiny + case " $SKIPPED_DATASETS " in + *" stackoverflow-tiny "*) ;; + *) touch "$tiny_marker" ;; + esac fi # HAND THE SKIP LIST TO THE NEXT STEP.