use env file #18
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: Daily Accuracy Benchmark | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# Runs daily at 2:00 AM, Beijing time. | ||
- cron: '0 18 * * *' # This is UTC time | ||
jobs: | ||
accuracy_benchmark: | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Create .env file | ||
run: | | ||
echo "OSS_AK_ID=${{ secrets.OSS_AK_ID }}" >> .env | ||
echo "OSS_AK_SECRET=${{ secrets.OSS_AK_SECRET }}" >> .env | ||
echo "OSS_ENDPOINT=${{ secrets.OSS_ENDPOINT }}" >> .env | ||
echo "M6_TENANT=${{ secrets.M6_TENANT }}" >> .env | ||
echo "MIT_SPIDER_TOKEN=${{ secrets.MIT_SPIDER_TOKEN }}" >> .env | ||
echo "MIT_SPIDER_URL=${{ secrets.MIT_SPIDER_URL }}" >> .env | ||
- name: Perform the accuracy benchmark | ||
run: | | ||
docker pull $UT_IMAGE | ||
echo 'Running accuracy benchmark...' | ||
docker run \ | ||
-v $PWD:$PWD \ | ||
-w $PWD \ | ||
--net host \ | ||
--ipc host \ | ||
--shm-size 80G \ | ||
-t --rm \ | ||
--gpus all \ | ||
--env-file .env \ | ||
$UT_IMAGE bash -c ' \ | ||
git config --global --add safe.directory $PWD && \ | ||
pip install -e . && \ | ||
cd benchmarks/accuracy && NPROC_PER_NODE=4 bash ./run.sh' | ||
- name: Clean up .env | ||
run: rm -f .env | ||
env: | ||
UT_IMAGE: ${{ secrets.UT_IMAGE }} |