This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
DOC: fix documents url #1370
Workflow file for this run
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: continuous build - gpu | |
on: [push, pull_request_target] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
unittest-gpu: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Linux dependencies | |
run: sudo apt-get install libopenblas-dev | |
- name: Setup python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.7 | |
architecture: x64 | |
- name: Install Other Dependencies | |
run: | | |
python -m pip install --quiet --upgrade pip | |
python -m pip install --quiet boto3 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Test project on AWS Batch(For push) | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
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 . \ | |
--saved-output coverage.xml \ | |
--save-path coverage.xml \ | |
--remote https://github.com/${{ github.repository }} \ | |
--command "python3 -m pip install pytest-forked && python3 -m pytest --forked --cov=. --cov-config=./.coveragerc --cov-report=xml --durations=50 --device="gpu" --runslow ./tests/" \ | |
--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: | | |
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.sha }} \ | |
--work-dir . \ | |
--saved-output coverage.xml \ | |
--save-path coverage.xml \ | |
--remote https://github.com/${{ github.event.pull_request.head.repo.full_name }} \ | |
--command "python3 -m pip install pytest-forked && python3 -m pytest --forked --cov=. --cov-config=./.coveragerc --cov-report=xml --durations=50 --device="gpu" --runslow ./tests/" \ | |
--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/{}/coverage.xml | |
cat jobid.log | xargs -i aws s3 cp s3://gluon-nlp-dev/batch/{}/coverage.xml ./coverage.xml | |
- name: Upload Cloud Watch Log Stream | |
if: ${{ failure() || success() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Test_Logs | |
path: ./batch_job.log | |