diff --git a/.github/workflows/unittests-gpu.yml b/.github/workflows/unittests-gpu.yml index 86c02d1267..1fcdc7bfe6 100644 --- a/.github/workflows/unittests-gpu.yml +++ b/.github/workflows/unittests-gpu.yml @@ -39,17 +39,58 @@ 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-GPU-Test-${{ github.ref }} \ + --source-ref ${{ github.ref }} \ + --work-dir tools/batch \ + --save-path temp \ + --remote https://github.com/${{ github.repository }} \ + --command "./batch_states/test.sh" \ + --wait | tee > batch_job.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-GPU-Test-PR#${{ github.event.number }} \ + --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" \ + --wait | tee > batch_job.log + + - name: Wait for job and copy files from AWS s3 + if: ${{ failure() || success() }} + run: | + head -100 batch_job.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 + + - name: Upload coverage to Codecov + if: ${{ failure() || success() }} + uses: codecov/codecov-action@v1.0.10 + with: + env_vars: OS,PYTHON + file: ./coverage.xml - - name: Upload log file for AWS Batch test results + - name: Upload Cloud Watch Log Stream + if: ${{ failure() || success() }} uses: actions/upload-artifact@v2 with: - name: GPU_Test_Results - path: script.log + name: Test_Logs + path: ./batch_job.log diff --git a/tools/batch/docker/gluon_nlp_cpu_job.sh b/tools/batch/docker/gluon_nlp_cpu_job.sh index 91684ad5e4..3045209c4f 100644 --- a/tools/batch/docker/gluon_nlp_cpu_job.sh +++ b/tools/batch/docker/gluon_nlp_cpu_job.sh @@ -19,8 +19,8 @@ fi; git fetch origin $SOURCE_REF:working git checkout working -python3 -m pip install -U --pre "mxnet>=2.0.0b20200802" -f https://dist.mxnet.io/python -pip3 install -v -e .[extras] +python3 -m pip install -U --quiet --pre "mxnet>=2.0.0b20200802" -f https://dist.mxnet.io/python +python3 -m pip install --quiet -e .[extras] cd $WORK_DIR /bin/bash -o pipefail -c "$COMMAND" diff --git a/tools/batch/docker/gluon_nlp_job.sh b/tools/batch/docker/gluon_nlp_job.sh index 4e1f03d578..65bad7ccce 100755 --- a/tools/batch/docker/gluon_nlp_job.sh +++ b/tools/batch/docker/gluon_nlp_job.sh @@ -19,8 +19,8 @@ fi; git fetch origin $SOURCE_REF:working git checkout working -python3 -m pip install -U --pre "mxnet-cu102>=2.0.0b20200802" -f https://dist.mxnet.io/python -pip3 install -v -e .[extras] +python3 -m pip install -U --quiet --pre "mxnet-cu102>=2.0.0b20200802" -f https://dist.mxnet.io/python +python3 -m pip install --quiet -e .[extras] cd $WORK_DIR /bin/bash -o pipefail -c "$COMMAND"