1
- name : Pytest- Daily
1
+ name : Daily
2
2
on :
3
3
schedule :
4
4
- cron : ' 30 2 * * *' # 2:30 every day
7
7
- dev
8
8
- main
9
9
- release/**
10
- workflow_call :
11
10
workflow_dispatch :
12
11
# Cancel old runs when a new commit is pushed to the same branch if not on main or dev
13
12
concurrency :
14
13
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15
14
cancel-in-progress : ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
16
15
jobs :
17
- pytest-cpu :
18
- timeout-minutes : 45
19
- runs-on : ubuntu-20.04
20
- if : github.repository_owner == 'mosaicml'
16
+ daily-pytest-cpu :
17
+ uses : ./.github/workflows/pytest-cpu.yaml
21
18
strategy :
22
- fail-fast : false
23
19
matrix :
24
20
include :
25
21
- name : ' cpu-3.8-1.11'
@@ -63,71 +59,30 @@ jobs:
63
59
markers : ' daily and (remote or not remote) and not gpu and not vision and doctest'
64
60
pytest_command : ' coverage run -m pytest tests/test_docs.py'
65
61
name : ${{ matrix.name }}
66
- container : ${{ matrix.container }}
67
- steps :
68
- - uses : actions/checkout@v2
69
- - name : Setup
70
- run : |
71
- set -ex
72
- export PATH=/composer-python:$PATH
73
- python -m pip install --upgrade 'pip<23' wheel
74
- python -m pip install --upgrade .[all]
75
- - name : Run Tests
76
- id : tests
77
- run : |
78
- set -ex
79
- export PATH=/composer-python:$PATH
80
- export WANDB_API_KEY='${{ secrets.WANDB_API_KEY }}'
81
- export WANDB_ENTITY='mosaicml-public-integration-tests'
82
- export WANDB_PROJECT="integration-tests-${{ github.sha }}"
83
- export AWS_ACCESS_KEY_ID='${{ secrets.AWS_ACCESS_KEY_ID }}'
84
- export AWS_SECRET_ACCESS_KEY='${{ secrets.AWS_SECRET_ACCESS_KEY }}'
85
- export S3_BUCKET='mosaicml-internal-integration-testing'
86
- export COMMON_ARGS="-v --durations=20 -m '${{ matrix.markers }}' --s3_bucket '$S3_BUCKET'"
87
-
88
- # Necessary to run git diff for doctests
89
- git config --global --add safe.directory /__w/composer/composer
90
-
91
- make test PYTEST='${{ matrix.pytest_command }}' EXTRA_ARGS="$COMMON_ARGS --codeblocks"
92
- make test-dist PYTEST='${{ matrix.pytest_command }}' EXTRA_ARGS="$COMMON_ARGS" WORLD_SIZE=2
93
-
94
- python -m coverage combine
95
- - uses : actions/upload-artifact@v3
96
- with :
97
- name : coverage-${{ github.sha }}-${{ matrix.name }}
98
- path : .coverage
62
+ if : github.repository_owner == 'mosaicml'
63
+ with :
64
+ container : ${{ matrix.container }}
65
+ name : ${{ matrix.name }}
66
+ pytest-command : ${{ matrix.pytest_command }}
67
+ pytest-markers : ${{ matrix.markers }}
68
+ pytest-s3-bucket : ' mosaicml-internal-integration-testing'
69
+ pytest-wandb-entity : ' mosaicml-public-integration-tests'
70
+ pytest-wandb-project : " integration-tests-${{ github.sha }}"
71
+ secrets :
72
+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
73
+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
74
+ wandb-api-key : ${{ secrets.WANDB_API_KEY }}
99
75
coverage :
100
- needs : [ pytest-cpu ]
101
- timeout-minutes : 30
102
- runs-on : ubuntu-20.04
76
+ uses : ./.github/workflows/coverage.yaml
77
+ name : Coverage Results
103
78
if : github.repository_owner == 'mosaicml'
104
- steps :
105
- - name : Checkout
106
- uses : actions/checkout@v2
107
- - name : Setup
108
- run : |
109
- set -ex
110
- python -m pip install --upgrade 'pip<23' wheel
111
- pip install coverage[toml]==6.5.0
112
- - name : Download artifacts
113
- uses : actions/download-artifact@v3
114
- with :
115
- path : artifacts
116
- - name : Generate coverage report
117
- run : |
118
- set -ex
119
-
120
- # Flatten the coverage files
121
- ls artifacts | while read x; do mv artifacts/$x/.coverage .coverage.$x; done
79
+ needs : [ daily-pytest-cpu ]
80
+ with :
81
+ download-path : artifacts
122
82
123
- python -m coverage combine
124
- python -m coverage report
125
- pytest-gpu :
126
- timeout-minutes : 45
127
- runs-on : ubuntu-20.04
128
- if : github.repository_owner == 'mosaicml'
83
+ daily-pytest-gpu :
84
+ uses : ./.github/workflows/pytest-gpu.yaml
129
85
strategy :
130
- fail-fast : false
131
86
matrix :
132
87
# Unlike CPU tests, we run daily tests together with GPU tests to minimize launch time
133
88
# on MCLOUD and not eat up all GPUs at once
@@ -149,33 +104,13 @@ jobs:
149
104
markers : ' (daily or not daily) and (remote or not remote) and gpu and (vision or doctest)'
150
105
pytest_command : ' coverage run -m pytest'
151
106
name : ${{ matrix.name }}
152
- env :
153
- MOSAICML_API_KEY : ${{ secrets.MCLOUD_API_KEY }}
154
- steps :
155
- - name : Checkout Repo
156
- uses : actions/checkout@v2
157
- - name : Setup Python
158
- uses : actions/setup-python@v2
159
- with :
160
- python-version : 3.9
161
- - name : Cache pip
162
- uses : actions/cache@v2
163
- with :
164
- # This path is specific to Ubuntu
165
- path : ~/.cache/pip
166
- # Look to see if there is a cache hit for the corresponding requirements file
167
- key : ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
168
- restore-keys : |
169
- ${{ runner.os }}-pip-
170
- ${{ runner.os }}-
171
- - name : Setup MCLI
172
- run : |
173
- set -ex
174
- python -m pip install --upgrade mosaicml-cli
175
- mcli init --mcloud
176
- mcli version
177
- - name : Submit Run
178
- id : tests
179
- run : |
180
- set -ex
181
- python .github/mcp/mcp_pytest.py --image '${{ matrix.container }}' --git_commit $GITHUB_SHA --pytest_markers '${{ matrix.markers }}' --pytest_command '${{ matrix.pytest_command }}'
107
+ if : github.repository_owner == 'mosaicml'
108
+ with :
109
+ container : ${{ matrix.container }}
110
+ mcloud-timeout : 1800
111
+ name : ${{ matrix.name }}
112
+ pytest-command : ${{ matrix.pytest_command }}
113
+ pytest-markers : ${{ matrix.markers }}
114
+ python-version : 3.9
115
+ secrets :
116
+ mcloud-api-key : ${{ secrets.MCLOUD_API_KEY }}
0 commit comments