colossalai
69 строк · 2.2 Кб
1name: Test Example on Schedule
2on:
3# run at 00:00 of every Sunday(singapore time) so here is UTC time Saturday 16:00
4schedule:
5- cron: '0 16 * * 6'
6workflow_dispatch:
7
8jobs:
9# This is for all files' weekly check. Specifically, this job is to find all the directories.
10matrix_preparation:
11if: github.repository == 'hpcaitech/ColossalAI'
12name: Prepare matrix for weekly check
13runs-on: ubuntu-latest
14outputs:
15matrix: ${{ steps.setup-matrix.outputs.matrix }}
16steps:
17- name: 📚 Checkout
18uses: actions/checkout@v3
19
20- name: setup matrix
21id: setup-matrix
22run: |
23res=`python .github/workflows/scripts/example_checks/check_example_weekly.py`
24all_loc=$( IFS=',' ; echo "${res[*]}" )
25echo "Found the examples: $all_loc"
26echo "matrix={\"directory\":$(echo "$all_loc")}" >> $GITHUB_OUTPUT
27
28weekly_check:
29if: github.repository == 'hpcaitech/ColossalAI'
30name: Weekly check all examples
31needs: matrix_preparation
32runs-on: [self-hosted, gpu]
33strategy:
34fail-fast: false
35matrix: ${{fromJson(needs.matrix_preparation.outputs.matrix)}}
36container:
37image: hpcaitech/pytorch-cuda:2.1.0-12.1.0
38timeout-minutes: 10
39steps:
40- name: 📚 Checkout
41uses: actions/checkout@v3
42
43- name: Install Colossal-AI
44run: |
45BUILD_EXT=1 pip install -v .
46
47- name: Traverse all files
48run: |
49example_dir=${{ matrix.directory }}
50echo "Testing ${example_dir} now"
51cd "${PWD}/examples/${example_dir}"
52bash test_ci.sh
53env:
54NCCL_SHM_DISABLE: 1
55
56- name: Notify Lark
57id: message-preparation
58if: ${{ failure() }}
59run: |
60url=$SERVER_URL/$REPO/actions/runs/$RUN_ID
61msg="Example tests failed for $EXAMPLE_DIR, please visit $url for details"
62echo $msg
63python .github/workflows/scripts/send_message_to_lark.py -m "$msg" -u $WEBHOOK_URL
64env:
65SERVER_URL: ${{github.server_url }}
66REPO: ${{ github.repository }}
67RUN_ID: ${{ github.run_id }}
68WEBHOOK_URL: ${{ secrets.LARK_NOTIFICATION_WEBHOOK_URL }}
69EXAMPLE_DIR: ${{ matrix.directory }}
70