Skip to content

Commit

Permalink
temp tests
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
  • Loading branch information
wyli committed Feb 23, 2021
1 parent 8456856 commit 9cbfaa9
Showing 1 changed file with 150 additions and 149 deletions.
299 changes: 150 additions & 149 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,139 +5,140 @@ on:
push:
branches:
- master
- fix-dockerfile

jobs:
# caching of these jobs:
# - docker-20-03-py3-pip- (shared)
# - ubuntu py36 37 38-pip-
# - os-latest-pip (shared)
coverage-py3:
if: github.repository == 'Project-MONAI/MONAI'
container:
image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2
options: --gpus all
runs-on: [self-hosted, linux, x64, common]
steps:
- uses: actions/checkout@v2
- name: cache weekly timestamp
id: pip-cache
run: |
echo "::set-output name=datew::$(date '+%Y-%V')"
- name: cache for pip
uses: actions/cache@v2
id: cache
with:
path: |
~/.cache/pip
~/.cache/torch
key: docker-20-03-py3-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install the dependencies
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
python -m pip install torch==1.7.1 torchvision==0.8.2
python -m pip install -r requirements-dev.txt
- name: Run unit tests report coverage
run: |
python -m pip list
nvidia-smi
export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
echo $CUDA_VISIBLE_DEVICES
python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
BUILD_MONAI=1 ./runtests.sh --coverage
coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
file: ./coverage.xml

test-py3x:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: cache weekly timestamp
id: pip-cache
run: |
echo "::set-output name=datew::$(date '+%Y-%V')"
- name: cache for pip
uses: actions/cache@v2
id: cache
with:
path: |
~/.cache/pip
~/.cache/torch
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install the dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install torch==1.7.1 torchvision==0.8.2
python -m pip install -r requirements-dev.txt
- name: Run quick tests CPU ubuntu
run: |
python -m pip list
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
BUILD_MONAI=1 ./runtests.sh --quick
coverage xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
file: ./coverage.xml

install: # pip install from github url
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: cache weekly timestamp
id: pip-cache
run: |
echo "::set-output name=datew::$(date '+%Y-%V')"
- name: cache for pip
uses: actions/cache@v2
id: cache
with:
path: |
~/.cache/pip
~/.cache/torch
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install the default branch no build
run: |
BUILD_MONAI=0 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
python -c 'import monai; monai.config.print_config()'
cd $(python -c 'import monai; import os; print(os.path.dirname(monai.__file__))')
ls .
pip uninstall -y monai
- name: Install the default branch with build
run: |
BUILD_MONAI=1 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
python -c 'import monai; monai.config.print_config()'
- uses: actions/checkout@v2
with:
ref: master
- name: Quick test installed
run: |
cd $GITHUB_WORKSPACE
rm -rf monai/
ls -al .
python -m pip install -r requirements-min.txt
python -m tests.min_tests
env:
QUICKTEST: True
# # caching of these jobs:
# # - docker-20-03-py3-pip- (shared)
# # - ubuntu py36 37 38-pip-
# # - os-latest-pip (shared)
# coverage-py3:
# if: github.repository == 'Project-MONAI/MONAI'
# container:
# image: nvcr.io/nvidia/pytorch:20.03-py3 # CUDA 10.2
# options: --gpus all
# runs-on: [self-hosted, linux, x64, common]
# steps:
# - uses: actions/checkout@v2
# - name: cache weekly timestamp
# id: pip-cache
# run: |
# echo "::set-output name=datew::$(date '+%Y-%V')"
# - name: cache for pip
# uses: actions/cache@v2
# id: cache
# with:
# path: |
# ~/.cache/pip
# ~/.cache/torch
# key: docker-20-03-py3-pip-${{ steps.pip-cache.outputs.datew }}
# - name: Install the dependencies
# run: |
# which python
# python -m pip install --upgrade pip wheel
# python -m pip uninstall -y torch torchvision
# python -m pip install torch==1.7.1 torchvision==0.8.2
# python -m pip install -r requirements-dev.txt
# - name: Run unit tests report coverage
# run: |
# python -m pip list
# nvidia-smi
# export CUDA_VISIBLE_DEVICES=$(python -m tests.utils)
# echo $CUDA_VISIBLE_DEVICES
# python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))"
# python -c 'import torch; print(torch.rand(5,3, device=torch.device("cuda:0")))'
# BUILD_MONAI=1 ./runtests.sh --coverage
# coverage xml
# - name: Upload coverage
# uses: codecov/codecov-action@v1
# with:
# fail_ci_if_error: true
# file: ./coverage.xml
#
# test-py3x:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: [3.6, 3.7, 3.8]
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: cache weekly timestamp
# id: pip-cache
# run: |
# echo "::set-output name=datew::$(date '+%Y-%V')"
# - name: cache for pip
# uses: actions/cache@v2
# id: cache
# with:
# path: |
# ~/.cache/pip
# ~/.cache/torch
# key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ steps.pip-cache.outputs.datew }}
# - name: Install the dependencies
# run: |
# python -m pip install --upgrade pip wheel
# python -m pip install torch==1.7.1 torchvision==0.8.2
# python -m pip install -r requirements-dev.txt
# - name: Run quick tests CPU ubuntu
# run: |
# python -m pip list
# python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
# BUILD_MONAI=1 ./runtests.sh --quick
# coverage xml
# - name: Upload coverage
# uses: codecov/codecov-action@v1
# with:
# fail_ci_if_error: false
# file: ./coverage.xml
#
# install: # pip install from github url
# runs-on: ubuntu-latest
# steps:
# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: cache weekly timestamp
# id: pip-cache
# run: |
# echo "::set-output name=datew::$(date '+%Y-%V')"
# - name: cache for pip
# uses: actions/cache@v2
# id: cache
# with:
# path: |
# ~/.cache/pip
# ~/.cache/torch
# key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
# - name: Install the default branch no build
# run: |
# BUILD_MONAI=0 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
# python -c 'import monai; monai.config.print_config()'
# cd $(python -c 'import monai; import os; print(os.path.dirname(monai.__file__))')
# ls .
# pip uninstall -y monai
# - name: Install the default branch with build
# run: |
# BUILD_MONAI=1 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI
# python -c 'import monai; monai.config.print_config()'
# - uses: actions/checkout@v2
# with:
# ref: master
# - name: Quick test installed
# run: |
# cd $GITHUB_WORKSPACE
# rm -rf monai/
# ls -al .
# python -m pip install -r requirements-min.txt
# python -m tests.min_tests
# env:
# QUICKTEST: True

local_docker:
if: github.repository == 'Project-MONAI/MONAI'
Expand All @@ -146,7 +147,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
ref: master
ref: fix-dockerfile
- name: docker_build
run: |
# build and run original docker image for local registry
Expand All @@ -162,20 +163,20 @@ jobs:
echo "${{ secrets.DOCKER_PW }}" | docker login -u projectmonai --password-stdin
docker push projectmonai/monai:latest
docker logout
docker:
if: github.repository == 'Project-MONAI/MONAI'
needs: local_docker
container:
image: localhost:5000/local_monai:latest
runs-on: [self-hosted, linux, x64, common]
steps:
- name: Import
run: |
python -c 'import monai; monai.config.print_config()'
cd /opt/monai
ls -al
ngc --version
python -m tests.min_tests
env:
QUICKTEST: True
#
# docker:
# if: github.repository == 'Project-MONAI/MONAI'
# needs: local_docker
# container:
# image: localhost:5000/local_monai:latest
# runs-on: [self-hosted, linux, x64, common]
# steps:
# - name: Import
# run: |
# python -c 'import monai; monai.config.print_config()'
# cd /opt/monai
# ls -al
# ngc --version
# python -m tests.min_tests
# env:
# QUICKTEST: True

0 comments on commit 9cbfaa9

Please sign in to comment.