Unverified Commit 2299d238 authored by Yifan Xiong's avatar Yifan Xiong Committed by GitHub
Browse files

CI/CD - Speedup CPU pipeline (#61)

Speedup Azure pipeline for CPU unit test.
parent 2a7ab691
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
trigger:
- main
container:
image: python:3.7
steps:
- script: |
python3 -m pip install .[test,torch]
displayName: Install dependencies
- script: |
python3 setup.py lint
displayName: Run code lint
- script: |
python3 setup.py test
displayName: Run unit tests
timeoutInMinutes: 10
env:
SB_TEST_CUDA: '0'
- script: |
bash <(curl -s https://codecov.io/bash) -cF cpu-unit-test
displayName: Report coverage results
env:
CODECOV_TOKEN: $(codecovToken)
...@@ -21,6 +21,7 @@ steps: ...@@ -21,6 +21,7 @@ steps:
- script: | - script: |
python3 setup.py test python3 setup.py test
displayName: Run unit tests displayName: Run unit tests
timeoutInMinutes: 10
- script: | - script: |
bash <(curl -s https://codecov.io/bash) -cF cuda-unit-test bash <(curl -s https://codecov.io/bash) -cF cuda-unit-test
displayName: Report coverage results displayName: Report coverage results
......
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
resources:
- repo: self
variables:
imageName: test
tag: '$(Build.BuildId)'
steps:
- task: Docker@2
displayName: Build uni-test Docker for SuperBench testing
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/test.dockerfile'
repository: $(imageName)
tags: |
$(tag)
- script: |
ci_env=`bash <(curl -s https://codecov.io/env)`
docker run $ci_env --entrypoint /bin/bash $(imageName):$(tag) -c 'bash <(curl -s https://codecov.io/bash) -cF cpu-unit-test'
displayName: Report coverage results
env:
CODECOV_TOKEN: $(codecovToken)
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
FROM ubuntu:18.04
# Install the python3.7 and pip
RUN apt-get update && apt-get install -y \
git \
curl \
python3.7-dev \
python3-pip
# Change default python3 version to python3.7
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 10
# Create workspace
WORKDIR /superbench
COPY . /superbench
# Upgrade pip and install dependencies
RUN python3 -m pip install --upgrade pip setuptools && \
python3 -m pip install .[test,torch]
# Lint code
RUN python3 setup.py lint
# Test code
RUN SB_TEST_CUDA=0 python3 setup.py test
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment