fix #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: [ '*' ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ '*' ] | |
env: | |
PYTHON_VERSION: "3.12" | |
TOKENIZERS_PARALLELISM: "false" | |
PYTHONPATH: "." | |
jobs: | |
check_local_runner: | |
strategy: | |
matrix: | |
cpu: ['M3', 'M4'] | |
include: | |
- benchmark_timeout: 500 | |
runs-on: ['self-hosted', 'macOS', '${{ matrix.cpu }}'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
# First, find where python3.12 is installed | |
which python3.12 || echo "python3.12 not in PATH" | |
# Add common Python installation locations to PATH | |
export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH" | |
# Now try to create the venv with explicit python3.12 | |
python3.12 -m venv env || { | |
echo "Failed to find python3.12. Checking installation locations:" | |
ls -l /usr/local/bin/python* /opt/homebrew/bin/python* 2>/dev/null || true | |
exit 1 | |
} | |
source env/bin/activate | |
pip install --upgrade pip | |
pip install . | |
- name: Run exo | |
run: | | |
ALL_NODE_IDS=$(for i in $(seq ${{ strategy.job-total }} -1 0); do echo -n "${GITHUB_JOB}_${i},"; done | sed 's/,$//') | |
MY_NODE_ID="${GITHUB_JOB}_${{ strategy.job-index }}" | |
source env/bin/activate | |
DEBUG_DISCOVERY=7 DEBUG=7 exo --node-id="${MY_NODE_ID}" --node-id-filter="${ALL_NODE_IDS}" --chatgpt-api-port 52415 --disable-tui > output1.log 2>&1 & | |
PID1=$! | |
tail -f output1.log & | |
TAIL1=$! | |
trap 'kill $TAIL1' EXIT | |
for i in {1..100}; do | |
nodes=$(curl http://localhost:52415/topology | jq '.nodes | length') | |
if [ "$nodes" -eq "${{ strategy.job-total }}" ]; then | |
break | |
fi | |
sleep 5 | |
done | |
if ! kill -0 $PID1 2>/dev/null; then | |
echo "Instance (PID $PID1) died unexpectedly. Log output:" | |
cat output1.log | |
exit 1 | |
fi | |
if [ "${{ strategy.job-index }}" -eq "0" ]; then | |
python .github/bench.py | |
else | |
sleep ${{ matrix.benchmark_timeout }} | |
fi | |
kill $PID1 | |
- name: Test | |
run: | | |
echo "GITHUB_JOB: ${GITHUB_JOB}, GITHUB_RUN_ID: ${GITHUB_RUN_ID}, GITHUB_RUN_NUMBER: ${GITHUB_RUN_NUMBER}, GITHUB_WORKFLOW: ${GITHUB_WORKFLOW}" |