-
Notifications
You must be signed in to change notification settings - Fork 535
[CI] Add Codecov and Test Logs #1349
Changes from 9 commits
078b031
55ec073
72da3da
1d53c10
878b790
a03d8a8
1ac85cb
2737888
6838434
803bb0b
97a78ca
6c09790
f9a607f
07b880e
5a2f9fa
a247c93
38b77f6
cab4c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,17 +39,62 @@ jobs: | |
- name: Test project on AWS Batch(For push) | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
python ./tools/batch/submit-job.py --region us-east-1 --job-type g4dn.4x --source-ref ${{ github.ref }} --work-dir tools/batch --remote https://github.com/${{ github.repository }} --command "./batch_states/test.sh" --wait | tee > script.log | ||
echo "Start submitting job" | ||
python ./tools/batch/submit-job.py --region us-east-1 \ | ||
--job-type g4dn.4x \ | ||
--name GluonNLP-${{ github.ref }}-${{ github.run_id }} \ | ||
--source-ref ${{ github.ref }} \ | ||
--work-dir tools/batch \ | ||
--save-path temp \ | ||
--remote https://github.com/${{ github.repository }} \ | ||
--command "./batch_states/test.sh | tee > ./script.log" \ | ||
--wait | tee > temp.log | ||
|
||
|
||
- name: Test project on AWS Batch(For pull request) | ||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} | ||
run: | | ||
python ./tools/batch/submit-job.py --region us-east-1 --job-type g4dn.4x --source-ref ${{ github.event.pull_request.head.ref }} --work-dir tools/batch --remote https://github.com/${{ github.event.pull_request.head.repo.full_name }} --command "./batch_states/test.sh" --wait | tee > script.log | ||
echo "Start submitting job" | ||
python ./tools/batch/submit-job.py --region us-east-1 \ | ||
--job-type g4dn.4x \ | ||
--name GluonNLP-${{ github.ref }}-${{ github.run_id }} \ | ||
--source-ref ${{ github.event.pull_request.head.ref }} \ | ||
--work-dir tools/batch \ | ||
--save-path temp \ | ||
--remote https://github.com/${{ github.event.pull_request.head.repo.full_name }} \ | ||
--command "./batch_states/test.sh | tee > ./script.log" \ | ||
--wait | tee > temp.log | ||
|
||
- name: Wait for job and copy files from AWS s3 | ||
if: ${{ failure() || success() }} | ||
run: | | ||
head -100 temp.log | grep -oP -m 1 'jobId: \K(.*)' > jobid.log | ||
|
||
echo "Job ID is" | ||
cat jobid.log | ||
|
||
cat jobid.log | xargs -i python ./tools/batch/wait-job.py --job-id {} | ||
|
||
echo "Copy Codecov file" | ||
cat jobid.log | xargs -i aws s3api wait object-exists --bucket gluon-nlp-dev --key batch/{}/temp/coverage.xml | ||
cat jobid.log | xargs -i aws s3 cp s3://gluon-nlp-dev/batch/{}/temp/coverage.xml ./coverage.xml | ||
|
||
echo "Copy log file" | ||
cat jobid.log | xargs -i aws s3api wait object-exists --bucket gluon-nlp-dev --key batch/{}/temp/script.log | ||
cat jobid.log | xargs -i aws s3 cp s3://gluon-nlp-dev/batch/{}/temp/script.log ./script.log | ||
|
||
- name: Upload coverage to Codecov | ||
if: ${{ failure() || success() }} | ||
uses: codecov/[email protected] | ||
with: | ||
env_vars: OS,PYTHON | ||
file: ./coverage.xml | ||
|
||
- name: Upload log file for AWS Batch test results | ||
if: ${{ failure() || success() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe have an output folder where tests can dump outputs to, and then always expose that folder as artifact? This should help simplify maintenance for managing build artifacts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean redirect the test results as stdout and stderr to different files in a folder and then upload this folder as build artifact so that the developers can access it through github workflow's artifacts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes exactly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For me, I think both look fine and we may merge this is first and improve later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's the existing practice in 0.x but doesn't work well as it doesn't capture errors outside the immediate test execution. Instead, we need to capture the full cloudwatch log. |
||
name: GPU_Test_Results | ||
path: script.log | ||
path: ./script.log | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the ref contain PR number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For push event,
${{ github.ref }}
will only contain the branch name the pr merged to, like 'master'.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having the PR number in the job name will help identify them in AWS batch