Skip to content

fix2

fix2 #59

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: Create Python directories
run: |
sudo mkdir -p /Users/runner/hostedtoolcache
sudo chown -R $USER:staff /Users/runner/hostedtoolcache
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip' # Enable pip caching
cache-dependency-path: |
setup.py
pyproject.toml
- name: Install dependencies
run: |
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install .
- name: Run exo
run: |
ALL_NODE_IDS=$(for i in $(seq 0 ${{ strategy.job-total }} -1); do echo -n "${GITHUB_JOB}_${i},"; done | sed 's/,$//')
MY_NODE_ID="${GITHUB_JOB}_${{ strategy.job-index }}"
DEBUG_DISCOVERY=7 DEBUG=7 exo --node-id="${MY_NODE_ID}" --filter-node-ids="${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}"