From 5cb2ee66825a94f6e76ea42d00aba2853ee3ed01 Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Thu, 2 Dec 2021 10:29:01 -0800 Subject: [PATCH 1/5] Update video for Tutorial 4 and 5 Signed-off-by: Gigon Bae --- docs/source/getting_started/tutorials/04_mis_tutorial.md | 6 ++++++ docs/source/getting_started/tutorials/05_full_tutorial.md | 6 ++++++ run | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/source/getting_started/tutorials/04_mis_tutorial.md b/docs/source/getting_started/tutorials/04_mis_tutorial.md index 766eacbc..d90dbce1 100644 --- a/docs/source/getting_started/tutorials/04_mis_tutorial.md +++ b/docs/source/getting_started/tutorials/04_mis_tutorial.md @@ -12,6 +12,12 @@ The environment from the previous section (** + + +``` + ```{raw} html

diff --git a/docs/source/getting_started/tutorials/05_full_tutorial.md b/docs/source/getting_started/tutorials/05_full_tutorial.md index a89b2a1e..67c98524 100644 --- a/docs/source/getting_started/tutorials/05_full_tutorial.md +++ b/docs/source/getting_started/tutorials/05_full_tutorial.md @@ -12,6 +12,12 @@ The environment from the previous section (** + + +``` + ```{raw} html

diff --git a/run b/run index 7ddc5d67..986e1d89 100755 --- a/run +++ b/run @@ -302,7 +302,7 @@ get_package_info() { install_python_dev_deps() { if [ -n "${VIRTUAL_ENV}" ] || [ -n "${CONDA_PREFIX}" ]; then - run_command ${MONAI_PY_EXE} -m pip install -q -U setuptools pip wheel build + run_command ${MONAI_PY_EXE} -m pip install -q -U 'setuptools<58.3' pip wheel build run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-dev.txt run_command ${MONAI_PY_EXE} -m pip install -q -r ${TOP}/requirements-examples.txt @@ -916,7 +916,7 @@ setup_gen_docs() { # Remove existing files in dist/docs run_command rm -rf ${output_folder}/* # Remove existing _autosummary folder - run command rm -rf ${TOP}/docs/source/modules/_autosummary + run_command rm -rf ${TOP}/docs/source/modules/_autosummary # Symbolic link notebooks folder from 'docs/source/notebooks' to 'notebooks' run_command rm -rf ${TOP}/docs/source/notebooks From e1542bfd58a0ebedd4bec0e99d4792121eb6317e Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 25 Jan 2022 10:51:10 -0800 Subject: [PATCH 2/5] Add release note for v0.2.1 Signed-off-by: Gigon Bae --- README.md | 4 +++ .../tutorials/04_mis_tutorial.md | 4 +-- .../tutorials/05_full_tutorial.md | 4 +-- docs/source/release_notes/index.md | 1 + docs/source/release_notes/v0.2.1.md | 31 +++++++++++++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 docs/source/release_notes/v0.2.1.md diff --git a/README.md b/README.md index a9b6c7bb..9c085086 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,10 @@ YouTube Video: - [Spleen Organ Segmentation - Jupyter Notebook Tutorial](https://www.youtube.com/watch?v=cqDVxzYt9lY) - [Spleen Organ Segmentation - Deep Dive](https://www.youtube.com/watch?v=nivgfD4pwWE) +### [4) Deploying Segmentation app with MONAI Inference Service (MIS)](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/04_mis_tutorial.html) + +### [5) Building and deploying Segmentation app with MONAI Inference Service (MIS)](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/05_full_tutorial.html) + ### [Examples](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/examples.html) has example apps that you can see. diff --git a/docs/source/getting_started/tutorials/04_mis_tutorial.md b/docs/source/getting_started/tutorials/04_mis_tutorial.md index d90dbce1..e6236b6e 100644 --- a/docs/source/getting_started/tutorials/04_mis_tutorial.md +++ b/docs/source/getting_started/tutorials/04_mis_tutorial.md @@ -12,11 +12,11 @@ The environment from the previous section (** -``` +``` --> ```{raw} html

diff --git a/docs/source/getting_started/tutorials/05_full_tutorial.md b/docs/source/getting_started/tutorials/05_full_tutorial.md index 67c98524..2785d91b 100644 --- a/docs/source/getting_started/tutorials/05_full_tutorial.md +++ b/docs/source/getting_started/tutorials/05_full_tutorial.md @@ -12,11 +12,11 @@ The environment from the previous section (** -``` +``` --> ```{raw} html

diff --git a/docs/source/release_notes/index.md b/docs/source/release_notes/index.md index 16d42e05..1e4ca20b 100644 --- a/docs/source/release_notes/index.md +++ b/docs/source/release_notes/index.md @@ -11,6 +11,7 @@ ```{toctree} :maxdepth: 1 +v0.2.1 v0.2.0 ``` diff --git a/docs/source/release_notes/v0.2.1.md b/docs/source/release_notes/v0.2.1.md new file mode 100644 index 00000000..6ba671f7 --- /dev/null +++ b/docs/source/release_notes/v0.2.1.md @@ -0,0 +1,31 @@ +# Version 0.2.1 (January 25, 2022) + +This is a patch release of [v0.2](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/release_notes/v0.2.0.html#). + +Please visit [GETTING STARTED](/getting_started/index) guide and follow tutorials. + +You can learn more about SDK usage through [DEVELOPING WITH SDK](/developing_with_sdk/index). + +Please let us know how you like it and what could be improved by [submitting an issue](https://github.com/Project-MONAI/monai-deploy-app-sdk/issues/new/choose) or [asking questions](https://github.com/Project-MONAI/monai-deploy-app-sdk/discussions)😀 + +## What's new + +As per MONAI Core's [Python 3.6 drop](https://github.com/Project-MONAI/MONAI/pull/3536), drop the support for Python 3.6 from MONAI Deploy App SDK. + +- Drop Python 3.6 support [#248](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/248) by [@gigony](https://github.com/gigony) + +## What's fixed/updated + +- Fixed minor dependencies for fresh deployment [#208](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/208) by [@vikashg](https://github.com/vikashg) +- Fix minor typo in chapter 4 notebook [#209](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/209) by [@KavinKrishnan](https://github.com/KavinKrishnan) +- Bump numpy >= 1.20 to avoid MKL error in conda env, and add --upgrade for pip install app sdk [#211](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/211) by [@MMelQin](https://github.com/MMelQin) +- Update notebooks with cloning repo and building MIS container [#214](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/214) by [@KavinKrishnan](https://github.com/KavinKrishnan) +- Update notebooks with cloning repo and building MIS container [#215](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/215) by [@KavinKrishnan](https://github.com/KavinKrishnan) +- Change the model name in the Spleen seg example dataset to model.ts [#222](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/222) by [@MMelQin](https://github.com/MMelQin) +- Remove developer names/aliases from notebooks and documentation [#225](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/225) by [@KavinKrishnan](https://github.com/KavinKrishnan) +- Fixed empty documentation on docs.monai [#233](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/233) by [@vikashg](https://github.com/vikashg) +- Handle exception case with missing DICOM Rescale Intercept and Slope attributes [#236](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/236) by [@MMelQin](https://github.com/MMelQin) +- Fix IPython detection routine [#237](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/237) by [@gigony](https://github.com/gigony) +- Use Python 3.7 for JupyterLab [#241](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/241) by [@gigony](https://github.com/gigony) +- Update gdown command and missing package [#246](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/246) by [@gigony](https://github.com/gigony) +- Do not upgrade packages when packaging [#247](https://github.com/Project-MONAI/monai-deploy-app-sdk/pull/247) by [@gigony](https://github.com/gigony) From 174b3eb59a4fbf203d45302eb77a4f80c7f0ef34 Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 25 Jan 2022 10:54:02 -0800 Subject: [PATCH 3/5] =?UTF-8?q?Bump=20version:=200.2.0=20=E2=86=92=200.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gigon Bae --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b0313a7b..ae23419f 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.0 +current_version = 0.2.1 parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?Pa|b|rc)(?P\d+))? serialize = {major}.{minor}.{patch}{release}{build} From 47625db975f712522be64608b9a5108b4084a442 Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 25 Jan 2022 15:36:05 -0800 Subject: [PATCH 4/5] Fix numpy vulnerability: CVE-2021-33430 Signed-off-by: Gigon Bae --- docs/requirements.txt | 2 +- .../apps/ai_livertumor_seg_app/livertumor_seg_operator.py | 2 +- examples/apps/ai_spleen_seg_app/spleen_seg_operator.py | 2 +- examples/apps/ai_unetr_seg_app/unetr_seg_operator.py | 2 +- examples/apps/deply_app_on_aarch64_interim.md | 2 +- monai/deploy/operators/monai_seg_inference_operator.py | 2 +- monai/deploy/packager/templates.py | 2 +- notebooks/tutorials/03_segmentation_app.ipynb | 6 +++--- notebooks/tutorials/05_full_tutorial.ipynb | 6 +++--- requirements.txt | 2 +- setup.cfg | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 006ec30e..9b36d855 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ Sphinx==4.1.2 sphinx-autobuild==2021.3.14 myst-parser==0.15.2 -numpy==1.19.5 +numpy==1.21 # CVE-2021-33430 matplotlib==3.3.4 ipywidgets==7.6.4 pandas==1.1.5 diff --git a/examples/apps/ai_livertumor_seg_app/livertumor_seg_operator.py b/examples/apps/ai_livertumor_seg_app/livertumor_seg_operator.py index d9eb371d..e47af940 100644 --- a/examples/apps/ai_livertumor_seg_app/livertumor_seg_operator.py +++ b/examples/apps/ai_livertumor_seg_app/livertumor_seg_operator.py @@ -34,7 +34,7 @@ @md.input("image", Image, IOType.IN_MEMORY) @md.output("seg_image", Image, IOType.IN_MEMORY) @md.output("saved_images_folder", DataPath, IOType.DISK) -@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.20", "nibabel"]) +@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.21", "nibabel"]) class LiverTumorSegOperator(Operator): """Performs liver and tumor segmentation using a DL model with an image converted from a DICOM CT series. diff --git a/examples/apps/ai_spleen_seg_app/spleen_seg_operator.py b/examples/apps/ai_spleen_seg_app/spleen_seg_operator.py index 9eb896c0..b3f83185 100644 --- a/examples/apps/ai_spleen_seg_app/spleen_seg_operator.py +++ b/examples/apps/ai_spleen_seg_app/spleen_seg_operator.py @@ -34,7 +34,7 @@ @md.input("image", Image, IOType.IN_MEMORY) @md.output("seg_image", Image, IOType.IN_MEMORY) -@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.20", "nibabel"]) +@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.21", "nibabel"]) class SpleenSegOperator(Operator): """Performs Spleen segmentation with a 3D image converted from a DICOM CT series. diff --git a/examples/apps/ai_unetr_seg_app/unetr_seg_operator.py b/examples/apps/ai_unetr_seg_app/unetr_seg_operator.py index a9a90113..785bb0e6 100644 --- a/examples/apps/ai_unetr_seg_app/unetr_seg_operator.py +++ b/examples/apps/ai_unetr_seg_app/unetr_seg_operator.py @@ -35,7 +35,7 @@ @md.input("image", Image, IOType.IN_MEMORY) @md.output("seg_image", Image, IOType.IN_MEMORY) @md.output("saved_images_folder", DataPath, IOType.DISK) -@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.20", "nibabel"]) +@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.21", "nibabel"]) class UnetrSegOperator(Operator): """Performs multi-organ segmentation using UNETR model with an image converted from a DICOM CT series. diff --git a/examples/apps/deply_app_on_aarch64_interim.md b/examples/apps/deply_app_on_aarch64_interim.md index afc8f5ec..0eb8b9fe 100644 --- a/examples/apps/deply_app_on_aarch64_interim.md +++ b/examples/apps/deply_app_on_aarch64_interim.md @@ -31,7 +31,7 @@ Without using the MONAI Deploy App SDK Packager to automatically detect the depe monai>=0.6.0 monai-deploy-app-sdk>=0.1.0 nibabel -numpy>=1.20 +numpy>=1.21 pydicom>=1.4.2 torch>=1.5 ``` diff --git a/monai/deploy/operators/monai_seg_inference_operator.py b/monai/deploy/operators/monai_seg_inference_operator.py index 0515ad5b..47d42d4d 100644 --- a/monai/deploy/operators/monai_seg_inference_operator.py +++ b/monai/deploy/operators/monai_seg_inference_operator.py @@ -43,7 +43,7 @@ @md.input("image", Image, IOType.IN_MEMORY) @md.output("seg_image", Image, IOType.IN_MEMORY) -@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.20"]) +@md.env(pip_packages=["monai==0.6.0", "torch>=1.5", "numpy>=1.21"]) class MonaiSegInferenceOperator(InferenceOperator): """This segmentation operator uses MONAI transforms and Sliding Window Inference. diff --git a/monai/deploy/packager/templates.py b/monai/deploy/packager/templates.py index ffdaab6c..ad0a98e2 100644 --- a/monai/deploy/packager/templates.py +++ b/monai/deploy/packager/templates.py @@ -12,7 +12,7 @@ COMMON_FOOTPRINT = """ USER root - RUN pip install --no-cache-dir --upgrade setuptools==57.4.0 pip==21.2.4 wheel==0.37.0 monai-deploy-app-sdk==0.2.0 + RUN pip install --no-cache-dir --upgrade setuptools==57.4.0 pip==21.2.4 wheel==0.37.0 numpy>=1.21 RUN mkdir -p /etc/monai/ \\ && mkdir -p /opt/monai/ \\ diff --git a/notebooks/tutorials/03_segmentation_app.ipynb b/notebooks/tutorials/03_segmentation_app.ipynb index 18548b5b..38ec4b62 100644 --- a/notebooks/tutorials/03_segmentation_app.ipynb +++ b/notebooks/tutorials/03_segmentation_app.ipynb @@ -99,7 +99,7 @@ "# Install MONAI and other necessary image processing packages for the application\n", "!python -c \"import monai\" || pip install -q \"monai\"\n", "!python -c \"import torch\" || pip install -q \"torch>=1.5\"\n", - "!python -c \"import numpy\" || pip install -q \"numpy>=1.20\"\n", + "!python -c \"import numpy\" || pip install -q \"numpy>=1.21\"\n", "!python -c \"import nibabel\" || pip install -q \"nibabel>=3.2.1\"\n", "!python -c \"import pydicom\" || pip install -q \"pydicom>=1.4.2\"\n", "!python -c \"import SimpleITK\" || pip install -q \"SimpleITK>=2.0.0\"\n", @@ -747,7 +747,7 @@ "source": [ "@md.input(\"image\", Image, IOType.IN_MEMORY)\n", "@md.output(\"seg_image\", Image, IOType.IN_MEMORY)\n", - "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.20\", \"nibabel\"])\n", + "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.21\", \"nibabel\"])\n", "class SpleenSegOperator(Operator):\n", " \"\"\"Performs Spleen segmentation with a 3D image converted from a DICOM CT series.\n", " \"\"\"\n", @@ -1069,7 +1069,7 @@ "\n", "@md.input(\"image\", Image, IOType.IN_MEMORY)\n", "@md.output(\"seg_image\", Image, IOType.IN_MEMORY)\n", - "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.20\", \"nibabel\", \"typeguard\"])\n", + "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.21\", \"nibabel\", \"typeguard\"])\n", "class SpleenSegOperator(Operator):\n", " \"\"\"Performs Spleen segmentation with a 3D image converted from a DICOM CT series.\n", " \"\"\"\n", diff --git a/notebooks/tutorials/05_full_tutorial.ipynb b/notebooks/tutorials/05_full_tutorial.ipynb index 0b76018a..6b2b4024 100644 --- a/notebooks/tutorials/05_full_tutorial.ipynb +++ b/notebooks/tutorials/05_full_tutorial.ipynb @@ -89,7 +89,7 @@ "# Install MONAI and other necessary image processing packages for the application\n", "!python -c \"import monai\" || pip install -q \"monai\"\n", "!python -c \"import torch\" || pip install -q \"torch>=1.5\"\n", - "!python -c \"import numpy\" || pip install -q \"numpy>=1.20\"\n", + "!python -c \"import numpy\" || pip install -q \"numpy>=1.21\"\n", "!python -c \"import nibabel\" || pip install -q \"nibabel>=3.2.1\"\n", "!python -c \"import pydicom\" || pip install -q \"pydicom>=1.4.2\"\n", "!python -c \"import SimpleITK\" || pip install -q \"SimpleITK>=2.0.0\"\n", @@ -739,7 +739,7 @@ "source": [ "@md.input(\"image\", Image, IOType.IN_MEMORY)\n", "@md.output(\"seg_image\", Image, IOType.IN_MEMORY)\n", - "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.20\", \"nibabel\"])\n", + "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.21\", \"nibabel\"])\n", "class SpleenSegOperator(Operator):\n", " \"\"\"Performs Spleen segmentation with a 3D image converted from a DICOM CT series.\n", " \"\"\"\n", @@ -1017,7 +1017,7 @@ "\n", "@md.input(\"image\", Image, IOType.IN_MEMORY)\n", "@md.output(\"seg_image\", Image, IOType.IN_MEMORY)\n", - "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.20\", \"nibabel\", \"typeguard\"])\n", + "@md.env(pip_packages=[\"monai==0.6.0\", \"torch>=1.5\", \"numpy>=1.21\", \"nibabel\", \"typeguard\"])\n", "class SpleenSegOperator(Operator):\n", " \"\"\"Performs Spleen segmentation with a 3D image converted from a DICOM CT series.\n", " \"\"\"\n", diff --git a/requirements.txt b/requirements.txt index 4fdf65d9..74252c9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy>=1.17 +numpy>=1.21 # CVE-2021-33430 networkx>=2.4 colorama>=0.4.1 typeguard>=2.12.1 diff --git a/setup.cfg b/setup.cfg index a4a30a6f..09761522 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ python_requires = >= 3.7 # setup_requires = # cucim install_requires = - numpy>=1.17 + numpy>=1.21 # CVE-2021-33430 networkx>=2.4 colorama>=0.4.1 typeguard>=2.12.1 From 5a8a3273d3fc99785b4f4cc242d96bd6265626f7 Mon Sep 17 00:00:00 2001 From: Gigon Bae Date: Tue, 25 Jan 2022 16:11:18 -0800 Subject: [PATCH 5/5] Use local MONAI App Sdk module when packaging The functionaly was removed by #199. This patch revert it. --- monai/deploy/packager/templates.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/monai/deploy/packager/templates.py b/monai/deploy/packager/templates.py index ad0a98e2..53c929cb 100644 --- a/monai/deploy/packager/templates.py +++ b/monai/deploy/packager/templates.py @@ -12,7 +12,7 @@ COMMON_FOOTPRINT = """ USER root - RUN pip install --no-cache-dir --upgrade setuptools==57.4.0 pip==21.2.4 wheel==0.37.0 numpy>=1.21 + RUN pip install --no-cache-dir --upgrade setuptools==57.4.0 pip==21.3.1 wheel==0.37.0 numpy>=1.21 RUN mkdir -p /etc/monai/ \\ && mkdir -p /opt/monai/ \\ @@ -34,9 +34,17 @@ && rm -rf {executor_dir}/executor_pkg \\ && chmod +x {executor_dir}/monai-exec - ENV PATH=/home/root/.local/bin:$PATH + ENV PATH=/root/.local/bin:$PATH - RUN pip install --no-cache-dir -r {map_requirements_path} + RUN pip install --no-cache-dir --user -r {map_requirements_path} + + # Override monai-deploy-app-sdk module + COPY ./monai-deploy-app-sdk /root/.local/lib/python3.8/site-packages/monai/deploy/ + RUN echo "User site package location: $(python3 -m site --user-site)" \\ + && [ "$(python3 -m site --user-site)" != "/root/.local/lib/python3.8/site-packages" ] \\ + && mkdir -p $(python3 -m site --user-site)/monai/deploy \\ + && cp -r /root/.local/lib/python3.8/site-packages/monai/deploy/* $(python3 -m site --user-site)/monai/deploy/ \\ + || true COPY ./map/app.json /etc/monai/ COPY ./map/pkg.json /etc/monai/