From d91cec2101b3a5ccdab1763f37abe154ef7ca870 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 10 Jun 2026 09:21:35 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=97=20ci:=20Cache=20and=20Authenticate?= =?UTF-8?q?=20HF=20Model=20Downloads=20in=20GitNexus=20Index=20(#13653)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gitnexus-index.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/gitnexus-index.yml b/.github/workflows/gitnexus-index.yml index 26b0a06098..fb54888082 100644 --- a/.github/workflows/gitnexus-index.yml +++ b/.github/workflows/gitnexus-index.yml @@ -180,12 +180,29 @@ jobs: fetch-depth: 1 persist-credentials: false + # HuggingFace throttles anonymous model downloads from shared GHA + # runner IPs (429s or stalled transfers). Cache the embedding model + # across runs so warm runs never touch HF at all. + - name: Cache HuggingFace embedding model + if: steps.flags.outputs.enable_embeddings == 'true' + uses: actions/cache@v4 + with: + path: ${{ runner.temp }}/hf-cache + key: hf-model-snowflake-arctic-embed-xs-v1 + - name: Run GitNexus Analyze working-directory: ${{ runner.temp }} env: ENABLE_EMBEDDINGS: ${{ steps.flags.outputs.enable_embeddings }} FORCE: ${{ inputs.force }} GITNEXUS_BIN: ${{ runner.temp }}/gitnexus-cli/node_modules/.bin/gitnexus + # Fail soft in ~2 min on stalled downloads instead of eating the + # 25-min job budget; HF_TOKEN lifts the anonymous rate limit on + # cold-cache runs (empty when the secret is unset — safe no-op). + HF_DOWNLOAD_TIMEOUT_MS: '60000' + HF_HOME: ${{ runner.temp }}/hf-cache + HF_MAX_ATTEMPTS: '2' + HF_TOKEN: ${{ secrets.HF_TOKEN }} NPM_CONFIG_AUDIT: false NPM_CONFIG_CACHE: ${{ runner.temp }}/gitnexus-npm-cache NPM_CONFIG_FUND: false