diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index fecb0166d..38d80908d 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -129,6 +129,21 @@ jobs: fetch-depth: 0 ref: ${{ github.event.inputs.branch }} persist-credentials: false + - name: Python | Setup + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Python | Install bump2version + run: | + python -m pip install --upgrade pip + pip install bump2version + - name: Python | Bump Version Release + id: bump_version + run: | + cur_dir=$GITHUB_WORKSPACE + cd ${{ matrix.package_dir }} + bump2version release --no-commit --allow-dirty + cd ${cur_dir} - name: Docker | Tag id: docker_tag run: | diff --git a/.github/workflows/pre-release-filter.yml b/.github/workflows/pre-release-filter.yml index 0070ad0a6..c46383f91 100644 --- a/.github/workflows/pre-release-filter.yml +++ b/.github/workflows/pre-release-filter.yml @@ -37,9 +37,6 @@ jobs: PACKAGE_DIRS="" COMPANION_FILES="VERSION .bumpversion.cfg" - # TODO: Remove this line and its effects after debugging - ALLOWED_DIRS="segmentation/imagej-threshold-apply-tool segmentation/imagej-threshold-huang-tool" - # Get the names of all the files tracked by git in the repo ALL_FILES=$(git ls-tree --full-tree -r --name-only HEAD) @@ -54,13 +51,6 @@ jobs: continue fi - # Check if the package directory is allowed - if [[ ! "$ALLOWED_DIRS" == *"$pkg_dir"* ]] - then - echo "Skipping $pkg_dir" - continue - fi - # Check if the file is a pyproject.toml file if [[ "$(basename ${file})" = *"pyproject"* ]] then diff --git a/clustering/k-means-clustering-tool/Dockerfile b/clustering/k-means-clustering-tool/Dockerfile index 6d8db17a8..1d0d53a9e 100644 --- a/clustering/k-means-clustering-tool/Dockerfile +++ b/clustering/k-means-clustering-tool/Dockerfile @@ -9,12 +9,17 @@ ENV POLUS_LOG="INFO" # Work directory defined in the base container WORKDIR ${EXEC_DIR} -COPY pyproject.toml ${EXEC_DIR} -COPY VERSION ${EXEC_DIR} -COPY README.md ${EXEC_DIR} -COPY src ${EXEC_DIR}/src +# TODO: Change the tool_dir to the tool directory +ENV TOOL_DIR="clustering/k-means-clustering-tool" -RUN pip3 install ${EXEC_DIR} --no-cache-dir +# Copy the repository into the container +RUN mkdir image-tools +COPY . ${EXEC_DIR}/image-tools -ENTRYPOINT ["python3", "-m", "polus.images.clustering.k_means"] +# Install the tool +RUN pip3 install "${EXEC_DIR}/image-tools/${TOOL_DIR}" --no-cache-dir + +# Set the entrypoint +# TODO: Change the entrypoint to the tool entrypoint +ENTRYPOINT ["python3", "-m", "polus.images.clustering.k_means_clustering"] CMD ["--help"] diff --git a/clustering/k-means-clustering-tool/build-docker.sh b/clustering/k-means-clustering-tool/build-docker.sh index 275ef5941..4dedab2f6 100644 --- a/clustering/k-means-clustering-tool/build-docker.sh +++ b/clustering/k-means-clustering-tool/build-docker.sh @@ -1,4 +1,23 @@ + #!/bin/bash +# Change the name of the tool here +tool_dir="clustering" +tool_name="k-means-clustering-tool" + +# The version is read from the VERSION file version=$(\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/segmentation/imagej-threshold-apply-tool/README.md b/segmentation/imagej-threshold-apply-tool/README.md index dffe32f21..1598ef49d 100644 --- a/segmentation/imagej-threshold-apply-tool/README.md +++ b/segmentation/imagej-threshold-apply-tool/README.md @@ -1,4 +1,4 @@ -# ImageJ threshold apply (v0.5.0) +# ImageJ threshold apply (v0.5.1-dev0) This plugin applies a constant manual threshold value to an input collection. (Thresholding)[https://en.wikipedia.org/wiki/Thresholding_(image_processing)] converts all pixel values in an image to either 1 or 0 depending on diff --git a/segmentation/imagej-threshold-apply-tool/VERSION b/segmentation/imagej-threshold-apply-tool/VERSION index 8f0916f76..6f9bb2cc0 100644 --- a/segmentation/imagej-threshold-apply-tool/VERSION +++ b/segmentation/imagej-threshold-apply-tool/VERSION @@ -1 +1 @@ -0.5.0 +0.5.1-dev0 diff --git a/segmentation/imagej-threshold-apply-tool/build-docker.sh b/segmentation/imagej-threshold-apply-tool/build-docker.sh index f56879000..a7bcca74f 100755 --- a/segmentation/imagej-threshold-apply-tool/build-docker.sh +++ b/segmentation/imagej-threshold-apply-tool/build-docker.sh @@ -1,3 +1,4 @@ + #!/bin/bash # Change the name of the tool here diff --git a/segmentation/imagej-threshold-apply-tool/plugin.json b/segmentation/imagej-threshold-apply-tool/plugin.json index 7086b1642..9b1e6a8f7 100644 --- a/segmentation/imagej-threshold-apply-tool/plugin.json +++ b/segmentation/imagej-threshold-apply-tool/plugin.json @@ -1,6 +1,6 @@ { "name": "ImageJ threshold apply", - "version": "0.5.0", + "version": "0.5.1-dev0", "title": "ImageJ threshold apply", "description": "This plugin applies a constant or manual threshold to an input collection.", "author": "Nick Schaub (nick.schaub@nih.gov), Anjali Taneja, Benjamin Houghton (benjamin.houghton@axleinfo.com), Najib Ishaq (najib.ishaq@nih.gov)", @@ -8,7 +8,7 @@ "repository": "https://github.com/polusai/image-tools", "website": "https://ncats.nih.gov/preclinical/core/informatics", "citation": "", - "containerId": "polusai/imagej-threshold-apply-tool:0.5.0", + "containerId": "polusai/imagej-threshold-apply-tool:0.5.1-dev0", "baseCommand": [ "python3", "-m", diff --git a/segmentation/imagej-threshold-apply-tool/pyproject.toml b/segmentation/imagej-threshold-apply-tool/pyproject.toml index f3222d0af..d91bc7789 100644 --- a/segmentation/imagej-threshold-apply-tool/pyproject.toml +++ b/segmentation/imagej-threshold-apply-tool/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polus-images-segmentation-imagej-threshold-apply" -version = "0.5.0" +version = "0.5.1-dev0" description = "" authors = [ "Nick Schaub ", diff --git a/segmentation/imagej-threshold-apply-tool/src/polus/images/segmentation/imagej_threshold_apply/__init__.py b/segmentation/imagej-threshold-apply-tool/src/polus/images/segmentation/imagej_threshold_apply/__init__.py index d27db33c2..bc3e29434 100644 --- a/segmentation/imagej-threshold-apply-tool/src/polus/images/segmentation/imagej_threshold_apply/__init__.py +++ b/segmentation/imagej-threshold-apply-tool/src/polus/images/segmentation/imagej_threshold_apply/__init__.py @@ -1,7 +1,7 @@ """Provides the ImageJ Threshold Apply tool.""" -__version__ = "0.5.0" +__version__ = "0.5.1-dev0" import logging diff --git a/segmentation/imagej-threshold-huang-tool/.bumpversion.cfg b/segmentation/imagej-threshold-huang-tool/.bumpversion.cfg index 8b5937854..1ce4180d9 100644 --- a/segmentation/imagej-threshold-huang-tool/.bumpversion.cfg +++ b/segmentation/imagej-threshold-huang-tool/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.5.0 +current_version = 0.5.1-dev0 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/segmentation/imagej-threshold-huang-tool/Dockerfile b/segmentation/imagej-threshold-huang-tool/Dockerfile index 45ca97115..316a4600c 100644 --- a/segmentation/imagej-threshold-huang-tool/Dockerfile +++ b/segmentation/imagej-threshold-huang-tool/Dockerfile @@ -24,5 +24,5 @@ RUN pip3 install "${EXEC_DIR}/image-tools/${TOOL_DIR}" --no-cache-dir # Set the entrypoint # TODO: Change the entrypoint to the tool entrypoint -ENTRYPOINT ["python3", "-m", "polus.images.segmentation.imagej_threshold_hunag"] +ENTRYPOINT ["python3", "-m", "polus.images.segmentation.imagej_threshold_huang"] CMD ["--help"] diff --git a/segmentation/imagej-threshold-huang-tool/README.md b/segmentation/imagej-threshold-huang-tool/README.md index c9328a9f9..610c5a43b 100644 --- a/segmentation/imagej-threshold-huang-tool/README.md +++ b/segmentation/imagej-threshold-huang-tool/README.md @@ -1,4 +1,4 @@ -# ImageJ threshold huang (v0.5.0) +# ImageJ threshold huang (v0.5.1-dev0) This plugin implements Huang's threshold method proposed in Image Thresholding by Minimizing the Measures of Fuzziness, Huang (1995). This method determines an optimal thresholding value such that the fuzziness measure between the original image and its binary version is minimized. diff --git a/segmentation/imagej-threshold-huang-tool/VERSION b/segmentation/imagej-threshold-huang-tool/VERSION index 8f0916f76..6f9bb2cc0 100644 --- a/segmentation/imagej-threshold-huang-tool/VERSION +++ b/segmentation/imagej-threshold-huang-tool/VERSION @@ -1 +1 @@ -0.5.0 +0.5.1-dev0 diff --git a/segmentation/imagej-threshold-huang-tool/build-docker.sh b/segmentation/imagej-threshold-huang-tool/build-docker.sh index 385291273..61c8655a9 100755 --- a/segmentation/imagej-threshold-huang-tool/build-docker.sh +++ b/segmentation/imagej-threshold-huang-tool/build-docker.sh @@ -1,3 +1,4 @@ + #!/bin/bash # Change the name of the tool here diff --git a/segmentation/imagej-threshold-huang-tool/plugin.json b/segmentation/imagej-threshold-huang-tool/plugin.json index 1df599b1d..d1ae89edb 100644 --- a/segmentation/imagej-threshold-huang-tool/plugin.json +++ b/segmentation/imagej-threshold-huang-tool/plugin.json @@ -1,6 +1,6 @@ { "name": "ImageJ threshold huang", - "version": "0.5.0", + "version": "0.5.1-dev0", "title": "ImageJ threshold huang", "description": "This plugin implements Huang's threshold method by Huang Wang.", "author": "Nick Schaub (nick.schaub@nih.gov), Anjali Taneja, Benjamin Houghton (benjamin.houghton@axleinfo.com), Najib Ishaq (najib.ishaq@nih.gov)", @@ -8,7 +8,7 @@ "repository": "https://github.com/polusai/image-tools", "website": "https://ncats.nih.gov/preclinical/core/informatics", "citation": "", - "containerId": "polusai/imagej-threshold-huang-tool:0.5.0", + "containerId": "polusai/imagej-threshold-huang-tool:0.5.1-dev0", "inputs": [ { "name": "inpDir", diff --git a/segmentation/imagej-threshold-huang-tool/pyproject.toml b/segmentation/imagej-threshold-huang-tool/pyproject.toml index c9e367eaf..52963e9d6 100644 --- a/segmentation/imagej-threshold-huang-tool/pyproject.toml +++ b/segmentation/imagej-threshold-huang-tool/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polus-images-segmentation-imagej-threshold-huang" -version = "0.5.0" +version = "0.5.1-dev0" description = "" authors = [ "Nick Schaub ", diff --git a/segmentation/imagej-threshold-huang-tool/src/polus/images/segmentation/imagej_threshold_huang/__init__.py b/segmentation/imagej-threshold-huang-tool/src/polus/images/segmentation/imagej_threshold_huang/__init__.py index 403f84916..b8fe93a5d 100644 --- a/segmentation/imagej-threshold-huang-tool/src/polus/images/segmentation/imagej_threshold_huang/__init__.py +++ b/segmentation/imagej-threshold-huang-tool/src/polus/images/segmentation/imagej_threshold_huang/__init__.py @@ -1,7 +1,7 @@ """Provides the ImageJ Threshold Huang tool.""" -__version__ = "0.5.0" +__version__ = "0.5.1-dev0" import logging diff --git a/segmentation/imagej-threshold-ij1-tool/Dockerfile b/segmentation/imagej-threshold-ij1-tool/Dockerfile index 1be31ef19..4230350d3 100644 --- a/segmentation/imagej-threshold-ij1-tool/Dockerfile +++ b/segmentation/imagej-threshold-ij1-tool/Dockerfile @@ -9,28 +9,20 @@ ENV POLUS_LOG="INFO" # Work directory defined in the base container WORKDIR ${EXEC_DIR} -# ImageJ setup +# Initialize ImageJ RUN python3 -c "import imagej; imagej.init('sc.fiji:fiji:2.1.1+net.imagej:imagej-legacy:0.37.4')" -# Install the ImageJ Threshold Apply tool -COPY imagej-threshold-apply-tool ${EXEC_DIR}/imagej-threshold-apply-tool -RUN pip3 install ${EXEC_DIR}/imagej-threshold-apply-tool --no-cache-dir +# TODO: Change the tool_dir to the tool directory +ENV TOOL_DIR="segmentation/imagej-threshold-ij1-tool" -RUN mkdir ${EXEC_DIR}/imagej-threshold-ij1-tool -WORKDIR ${EXEC_DIR}/imagej-threshold-ij1-tool +# Copy the repository into the container +RUN mkdir image-tools +COPY . ${EXEC_DIR}/image-tools -# Install the python package -COPY pyproject.toml . -COPY VERSION . -COPY README.md . -COPY src ./src -COPY tests ./tests - -RUN pip3 install ${EXEC_DIR}/imagej-threshold-ij1-tool --no-cache-dir - -RUN pip3 install scikit-image pytest pytest-sugar pytest-json-report --no-cache-dir -RUN python3 -X faulthandler -m pytest --json-report --json-report-summary -v -p no:faulthandler -RUN cat .report.json +# Install the tool +RUN pip3 install "${EXEC_DIR}/image-tools/${TOOL_DIR}" --no-cache-dir +# Set the entrypoint +# TODO: Change the entrypoint to the tool entrypoint ENTRYPOINT ["python3", "-m", "polus.images.segmentation.imagej_threshold_ij1"] CMD ["--help"] diff --git a/segmentation/imagej-threshold-ij1-tool/build-docker.sh b/segmentation/imagej-threshold-ij1-tool/build-docker.sh index a4e43fb55..d42022e99 100755 --- a/segmentation/imagej-threshold-ij1-tool/build-docker.sh +++ b/segmentation/imagej-threshold-ij1-tool/build-docker.sh @@ -1,8 +1,23 @@ + #!/bin/bash -cp -r ../imagej-threshold-apply-tool . +# Change the name of the tool here +tool_dir="segmentation" +tool_name="imagej-threshold-ij1-tool" +# The version is read from the VERSION file version=$(