From 845685625befe6003bc8f178738f4c93ab226fb5 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 23 Feb 2021 09:27:44 +0000 Subject: [PATCH 1/3] update dockerfile Signed-off-by: Wenqi Li --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d0384c7bee..47976b97b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,8 @@ WORKDIR /opt/monai COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/ RUN cp /tmp/requirements.txt /tmp/req.bak \ && awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \ - && python -m pip install --no-cache-dir --use-feature=2020-resolver -r /tmp/requirements-dev.txt + && python -m pip install --upgrade --no-cache-dir pip \ + && python -m pip install --no-cache-dir -r /tmp/requirements-dev.txt # compile ext and remove temp files # TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276) From 9cbfaa981164113134bb3201648040ad7bc368a1 Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 23 Feb 2021 09:28:09 +0000 Subject: [PATCH 2/3] temp tests Signed-off-by: Wenqi Li --- .github/workflows/setupapp.yml | 299 +++++++++++++++++---------------- 1 file changed, 150 insertions(+), 149 deletions(-) diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index 7656eb4828..5378e0bf0c 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -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' @@ -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 @@ -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 From 09b90f061eafe175fc7134f53fb7bd377fc9dfed Mon Sep 17 00:00:00 2001 From: Wenqi Li Date: Tue, 23 Feb 2021 10:06:06 +0000 Subject: [PATCH 3/3] Revert "temp tests" This reverts commit 9cbfaa981164113134bb3201648040ad7bc368a1. Signed-off-by: Wenqi Li --- .github/workflows/setupapp.yml | 299 ++++++++++++++++----------------- 1 file changed, 149 insertions(+), 150 deletions(-) diff --git a/.github/workflows/setupapp.yml b/.github/workflows/setupapp.yml index 5378e0bf0c..7656eb4828 100644 --- a/.github/workflows/setupapp.yml +++ b/.github/workflows/setupapp.yml @@ -5,140 +5,139 @@ 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' @@ -147,7 +146,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: fix-dockerfile + ref: master - name: docker_build run: | # build and run original docker image for local registry @@ -163,20 +162,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