diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml deleted file mode 100644 index c3d8a4c3b1..0000000000 --- a/.github/workflows/cron.yml +++ /dev/null @@ -1,238 +0,0 @@ -name: crons - -on: - schedule: - - cron: "0 2 * * *" # at 02:00 UTC - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - cron-gpu: - 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] - strategy: - matrix: - pytorch-version: [1.5.1, 1.6.0, 1.7.1, 1.8.1, latest] - steps: - - uses: actions/checkout@v2 - - name: Install the dependencies - run: | - which python - python -m pip install --upgrade pip wheel - python -m pip uninstall -y torch torchvision - if [ ${{ matrix.pytorch-version }} == "latest" ]; then - python -m pip install torch torchvision - elif [ ${{ matrix.pytorch-version }} == "1.5.1" ]; then - python -m pip install torch==1.5.1 torchvision==0.6.1 - elif [ ${{ matrix.pytorch-version }} == "1.6.0" ]; then - python -m pip install torch==1.6.0 torchvision==0.7.0 - elif [ ${{ matrix.pytorch-version }} == "1.7.1" ]; then - python -m pip install torch==1.7.1 torchvision==0.8.2 - elif [ ${{ matrix.pytorch-version }} == "1.8.1" ]; then - python -m pip install torch==1.8.1 torchvision==0.9.1 - fi - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - 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 --unittests # unit tests with coverage report - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - if pgrep python; then pkill python; fi - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-pt-image: - if: github.repository == 'Project-MONAI/MONAI' - strategy: - matrix: - container: ["pytorch:21.02", "pytorch:21.06"] # 21.02 for backward comp. - container: - image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - uses: actions/checkout@v2 - - name: Install APT dependencies - run: | - apt-get update - DEBIAN_FRONTEND="noninteractive" apt-get install -y libopenslide0 - - name: Install Python dependencies - run: | - which python - python -m pip install --upgrade pip wheel - python -m pip install -r requirements-dev.txt - python -m pip list - - name: Run tests report coverage - run: | - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - 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 --unittests # unit tests with coverage report - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - if pgrep python; then pkill python; fi - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-pip: - # pip install monai[all] and use it to run unit tests - if: github.repository == 'Project-MONAI/MONAI' - strategy: - matrix: - container: ["pytorch:21.02", "pytorch:21.06"] # 21.02 for backward comp. - container: - image: nvcr.io/nvidia/${{ matrix.container }}-py3 # testing with the latest pytorch base image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Install the dependencies - run: | - which python - python -m pip install --upgrade pip wheel twine - python -m pip list - - name: Run tests report coverage - run: | - pip uninstall monai - pip list | grep -iv monai - git fetch --depth=1 origin +refs/tags/*:refs/tags/* - root_dir=$PWD - echo "$root_dir" - set -e - - # build tar.gz and wheel - bash runtests.sh --clean # clear any existing dev temp files - python -m pip uninstall -y torch torchvision - python setup.py check -m -s - python setup.py sdist bdist_wheel - python -m twine check dist/* - - # move packages to a temp dir - tmp_dir=$(mktemp -d) - cp dist/monai* "$tmp_dir" - rm -r build dist monai.egg-info - cd "$tmp_dir" - ls -al - - # install from tar.gz - name=$(ls *.tar.gz | head -n1) - echo $name - python -m pip install $name[all] - python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown" - python -c 'import monai; print(monai.__file__)' - - # run tests - cp $root_dir/requirements*.txt "$tmp_dir" - cp -r $root_dir/tests "$tmp_dir" - pwd - ls -al - - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - python -c "import torch; print(torch.__version__); print('{} of GPUs available'.format(torch.cuda.device_count()))" - - python -m pip install -r requirements-dev.txt - PYTHONPATH="$tmp_dir":$PYTHONPATH BUILD_MONAI=1 python ./tests/runner.py -p 'test_((?!integration).)' # unit tests - if pgrep python; then pkill python; fi - - cron-docker: - if: github.repository == 'Project-MONAI/MONAI' - container: - image: localhost:5000/local_monai:dockerhub # use currently latest, locally available dockerhub image - options: "--gpus all" - runs-on: [self-hosted, linux, x64, common] - steps: - - name: Run tests report coverage - # The docker image process has done the compilation. - # BUILD_MONAI=1 is necessary for triggering the USE_COMPILED flag. - run: | - cd /opt/monai - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - 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")))' - ngc --version - BUILD_MONAI=1 ./runtests.sh --coverage --pytype --unittests # unit tests with pytype checks, coverage report - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - if pgrep python; then pkill python; fi - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - cron-tutorial-notebooks: - if: github.repository == 'Project-MONAI/MONAI' - needs: cron-gpu # so that monai itself is verified first - container: - image: nvcr.io/nvidia/pytorch:21.06-py3 # testing with the latest pytorch base image - options: "--gpus all --ipc=host" - runs-on: [self-hosted, linux, x64, common] - steps: - - uses: actions/checkout@v2 - - name: Install MONAI - id: monai-install - run: | - which python - python -m pip install --upgrade pip wheel - python -m pip install -r requirements-dev.txt - BUILD_MONAI=0 python setup.py develop # install monai - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - echo "::set-output name=devices::$CUDA_VISIBLE_DEVICES" - - name: Checkout tutorials and install their requirements - run: | - cd /opt - git clone --depth 1 --branch master --single-branch https://github.com/Project-MONAI/tutorials.git # latest commit of master branch - cd tutorials - python -m pip install -r requirements.txt - - name: Run tutorial notebooks - timeout-minutes: 150 - run: | - export CUDA_VISIBLE_DEVICES=${{ steps.monai-install.outputs.devices }} - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - cd /opt/tutorials - $(pwd)/runner.sh - if pgrep python; then pkill python; fi diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml deleted file mode 100644 index 295d4814c8..0000000000 --- a/.github/workflows/setupapp.yml +++ /dev/null @@ -1,161 +0,0 @@ -name: deploy - -on: - # full tests for all the important branches - push: - branches: - - dev - - main - - releasing/* - - feature/* - -concurrency: - # automatically cancel the previously triggered workflows when there's a newer version - group: deploy-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - # caching of these jobs: - # - docker-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-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.9.0 torchvision==0.10.0 - python -m pip install -r requirements-dev.txt - - name: Run unit tests report coverage - run: | - python -m pip list - export LAUNCH_DELAY=$[ $RANDOM % 16 * 60 ] - echo "Sleep $LAUNCH_DELAY" - sleep $LAUNCH_DELAY - nvidia-smi - export CUDA_VISIBLE_DEVICES=$(python -m tests.utils) - echo $CUDA_VISIBLE_DEVICES - trap 'if pgrep python; then pkill python; fi;' ERR - python -c $'import torch\na,b=torch.zeros(1,device="cuda:0"),torch.zeros(1,device="cuda:1");\nwhile True:print(a,b)' > /dev/null & - 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 --unittests # unit tests with coverage report - BUILD_MONAI=1 ./runtests.sh --coverage --net # integration tests with coverage report - coverage xml - if pgrep python; then pkill python; fi - shell: bash - - name: Upload coverage - uses: codecov/codecov-action@v1 - with: - fail_ci_if_error: false - file: ./coverage.xml - - test-py3x: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.6, 3.7, 3.8, 3.9] - 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.9.0 torchvision==0.10.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))' - BUILD_MONAI=1 ./runtests.sh --quick --unittests - 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, the default branch is dev - 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 (dev branch only) - if: github.ref == 'refs/heads/dev' - 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 (dev branch only) - if: github.ref == 'refs/heads/dev' - run: | - BUILD_MONAI=1 pip install git+https://github.com/Project-MONAI/MONAI#egg=MONAI - python -c 'import monai; monai.config.print_config()' - - name: Get the test cases (dev branch only) - if: github.ref == 'refs/heads/dev' - uses: actions/checkout@v2 - with: - ref: dev - - name: Quick test installed (dev branch only) - if: github.ref == 'refs/heads/dev' - 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