Skip to content

Commit

Permalink
ci: Updated actions, dockerfiles, and build-docker scripts
Browse files Browse the repository at this point in the history
Bump version: 0.5.0 → 0.5.1-dev0

fix: CI bump version before building docker image

ci: ict.yml/yaml in tests actions

wip: updated docker files and build scripts

ci: removing manual filter from release actions

fix: installing iamgej in dockerfiles

fix: removing imagej stuff from non-imagej tools

fix: dockerfile for theia

build: pinning numpy under 2.0 for some tools

chore: deleted tools that have been moved into tabulsr-tools
  • Loading branch information
nishaq503 committed Jul 15, 2024
1 parent 70b4583 commit d36e8f5
Show file tree
Hide file tree
Showing 133 changed files with 1,780 additions and 990 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/pre-release-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
17 changes: 11 additions & 6 deletions clustering/k-means-clustering-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
21 changes: 20 additions & 1 deletion clustering/k-means-clustering-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -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=$(<VERSION)
docker build . -t polusai/k-means-clustering-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
15 changes: 10 additions & 5 deletions clustering/outlier-removal-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ FROM polusai/bfio:2.3.3
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".arrow"

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}
# TODO: Change the tool_dir to the tool directory
ENV TOOL_DIR="clustering/outlier-removal-tool"

RUN pip3 install ${EXEC_DIR} --no-cache
# Copy the repository into the container
RUN mkdir image-tools
COPY . ${EXEC_DIR}/image-tools

# 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.outlier_removal"]
CMD ["--help"]
21 changes: 20 additions & 1 deletion clustering/outlier-removal-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

#!/bin/bash

# Change the name of the tool here
tool_dir="clustering"
tool_name="outlier-removal-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/outlier-removal-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
18 changes: 12 additions & 6 deletions features/nyxus-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ FROM polusai/bfio:2.3.3
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
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="features/nyxus-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.features.nyxus_plugin"]
# 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.features.nyxus"]
CMD ["--help"]
21 changes: 20 additions & 1 deletion features/nyxus-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

#!/bin/bash

# Change the name of the tool here
tool_dir="features"
tool_name="nyxus-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/nyxus-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
16 changes: 11 additions & 5 deletions features/pixel-segmentation-eval-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ FROM polusai/bfio:2.1.9
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
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="features/pixel-segmentation-eval-tool"

RUN pip3 install ${EXEC_DIR} --no-cache-dir
# Copy the repository into the container
RUN mkdir image-tools
COPY . ${EXEC_DIR}/image-tools

# 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.features.pixel_segmentation_eval"]
CMD ["--help"]
21 changes: 20 additions & 1 deletion features/pixel-segmentation-eval-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

#!/bin/bash

# Change the name of the tool here
tool_dir="features"
tool_name="pixel-segmentation-eval-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/pixel-segmentation-eval-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
16 changes: 11 additions & 5 deletions features/region-segmentation-eval-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ FROM polusai/bfio:2.1.9
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
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="features/region-segmentation-eval-tool"

RUN pip3 install ${EXEC_DIR} --no-cache-dir
# Copy the repository into the container
RUN mkdir image-tools
COPY . ${EXEC_DIR}/image-tools

# 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.features.region_segmentation_eval"]
CMD ["--help"]
21 changes: 20 additions & 1 deletion features/region-segmentation-eval-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

#!/bin/bash

# Change the name of the tool here
tool_dir="features"
tool_name="region-segmentation-eval-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/region-segmentation-eval-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
17 changes: 11 additions & 6 deletions formats/arrow-to-tabular-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ FROM polusai/bfio:2.1.9
ENV EXEC_DIR="/opt/executables"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
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}
RUN pip3 install --index-url https://test.pypi.org/simple/ filepattern==2.2.7
COPY src ${EXEC_DIR}/src
# TODO: Change the tool_dir to the tool directory
ENV TOOL_DIR="formats/arrow-to-tabular-tool"

RUN pip3 install ${EXEC_DIR} --no-cache-dir
# Copy the repository into the container
RUN mkdir image-tools
COPY . ${EXEC_DIR}/image-tools

# 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.formats.arrow_to_tabular"]
CMD ["--help"]
21 changes: 20 additions & 1 deletion formats/arrow-to-tabular-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@

#!/bin/bash

# Change the name of the tool here
tool_dir="formats"
tool_name="arrow-to-tabular-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/arrow-to-tabular-tool:${version}
tag="polusai/${tool_name}:${version}"
echo "Building docker image with tag: ${tag}"

# The current directory and the repository root are saved in variables
cur_dir=$(pwd)
repo_root=$(git rev-parse --show-toplevel)

# The Dockerfile and .dockerignore files are copied to the repository root before building the image
cd ${repo_root}
cp ./${tool_dir}/${tool_name}/Dockerfile .
cp .gitingore .dockerignore
docker build . -t ${tag}
rm Dockerfile .dockerignore
cd ${cur_dir}
17 changes: 11 additions & 6 deletions formats/file-renaming-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ FROM polusai/bfio:2.1.9

# environment variables defined in polusai/bfio
ENV EXEC_DIR="/opt/executables"
ENV POLUS_LOG="INFO"
ENV POLUS_IMG_EXT=".ome.tif"
ENV POLUS_TAB_EXT=".csv"
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="formats/file-renaming-tool"

# Copy the repository into the container
RUN mkdir image-tools
COPY . ${EXEC_DIR}/image-tools

RUN pip3 install ${EXEC_DIR} --no-cache-dir
# 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.formats.file_renaming"]
CMD ["--help"]
Loading

0 comments on commit d36e8f5

Please sign in to comment.