Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-evaluation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
# Uses base repo's script (safe - not from PR)
echo "Preparing dataset..."
mkdir -p dataset
uv run python scripts/process_datasets/prep_datasets.py
scripts/process_datasets/prepare_datasets.sh

- name: Enable Swap Space
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regrade-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: |
set -euo pipefail
mkdir -p dataset
uv run python scripts/process_datasets/prep_datasets.py
scripts/process_datasets/prepare_datasets.sh

- name: Enable swap space
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Prepare dataset
env:
ROUTERARENA_DATASET_DIR: ${{ github.workspace }}/dataset
run: uv run python scripts/process_datasets/prep_datasets.py
run: scripts/process_datasets/prepare_datasets.sh

- name: Checkout website repo
uses: actions/checkout@v5
Expand Down
26 changes: 26 additions & 0 deletions scripts/process_datasets/prepare_datasets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: Copyright contributors to the RouterArena project
# SPDX-License-Identifier: Apache-2.0
#
# Run prep_datasets.py with a time limit, retrying a few times. The Hugging Face
# downloads it makes occasionally stall without failing, which used to hang CI jobs
# until their own timeout; a stalled attempt is now stopped and retried.
#
# Usage: scripts/process_datasets/prepare_datasets.sh
# PREP_TIMEOUT seconds per attempt (default 900)
# PREP_ATTEMPTS number of attempts (default 3)
set -euo pipefail

timeout_s="${PREP_TIMEOUT:-900}"
attempts="${PREP_ATTEMPTS:-3}"
for attempt in $(seq 1 "$attempts"); do
if timeout --kill-after=30 "$timeout_s" uv run python scripts/process_datasets/prep_datasets.py; then
exit 0
fi
echo "Dataset preparation attempt $attempt of $attempts failed or timed out." >&2
if [[ "$attempt" -lt "$attempts" ]]; then
sleep 15
fi
done
echo "Dataset preparation failed after $attempts attempts." >&2
exit 1
Loading