| name: deploy |
|
|
| on: |
| |
| push: |
| branches: |
| - master |
|
|
| jobs: |
| |
| |
| |
| |
| coverage-py3: |
| container: |
| image: nvcr.io/nvidia/pytorch:20.03-py3 |
| options: --gpus all |
| runs-on: [self-hosted, linux, x64] |
| 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 |
| 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.4 torchvision==0.5.0 |
| 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")))' |
| ./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@v1 |
| 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 |
| 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.4 torchvision==0.5.0 |
| 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))' |
| ./runtests.sh --quick |
| coverage xml |
| - name: Upload coverage |
| uses: codecov/codecov-action@v1 |
| with: |
| fail_ci_if_error: false |
| file: ./coverage.xml |
|
|
| min-dep-py3: |
| runs-on: ${{ matrix.os }} |
| strategy: |
| fail-fast: false |
| matrix: |
| os: [windows-latest, macOS-latest, ubuntu-latest] |
| timeout-minutes: 20 |
| steps: |
| - uses: actions/checkout@v2 |
| - name: Set up Python 3.x |
| uses: actions/setup-python@v1 |
| with: |
| python-version: '3.x' |
| - name: Prepare pip wheel |
| run: | |
| which python |
| python -m pip install --upgrade pip wheel |
| - name: cache weekly timestamp |
| id: pip-cache |
| run: | |
| echo "::set-output name=datew::$(date '+%Y-%V')" |
| echo "::set-output name=dir::$(pip cache dir)" |
| shell: bash |
| - name: cache for pip |
| uses: actions/cache@v2 |
| id: cache |
| with: |
| path: ${{ steps.pip-cache.outputs.dir }} |
| key: ${{ matrix.os }}-latest-pip-${{ steps.pip-cache.outputs.datew }} |
| - if: runner.os == 'windows' |
| name: Install torch cpu from pytorch.org (Windows only) |
| run: | |
| python -m pip install torch==1.4 -f https://download.pytorch.org/whl/cpu/torch_stable.html |
| python -m pip install torchvision==0.5.0 |
| - name: Install the dependencies |
| run: | |
| # min. requirements for windows instances |
| python -m pip install torch==1.4 torchvision==0.5.0 |
| python -c "f=open('requirements-dev.txt', 'r'); txt=f.readlines(); f.close(); print(txt); f=open('requirements-dev.txt', 'w'); f.writelines(txt[1:5]); f.close()" |
| cat "requirements-dev.txt" |
| python -m pip install -r requirements-dev.txt |
| python -m pip list |
| python setup.py develop # to compile extensions using the system native torch |
| - name: Run quick tests (CPU ${{ runner.os }}) |
| run: | |
| python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' |
| python -m tests.min_tests |
| env: |
| QUICKTEST: True |
|
|
| install: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Set up Python 3.7 |
| uses: actions/setup-python@v1 |
| with: |
| python-version: 3.7 |
| - 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 |
| key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }} |
| - name: Install the default branch |
| run: | |
| pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI |
| - name: Import |
| run: | |
| python -c 'import monai; monai.config.print_config()' |
| - name: Uninstall |
| run: | |
| pip uninstall -y monai |
| |
| docker: |
| container: |
| image: docker://projectmonai/monai:latest |
| runs-on: [self-hosted, linux, x64] |
| steps: |
| - name: Import |
| run: | |
| python -c 'import monai; monai.config.print_config()' |
| cd /opt/monai |
| ls -al |
| ngc --version |
| |