Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Dockerfiles and build scripts, pinning pyarrow, and fixing some pre-commit issues #13

Merged
merged 7 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/workflows/tool-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,14 @@ env:

on:
workflow_dispatch:
inputs:
num-commits:
description: "The of commits to check for updated packages. If 0, the action will check all commits on the branch. For any larger value, the action will check the last n commits for any updated packages."
required: true
default: 1
type: number
ignore-missing-dev:
description: "If true, the action will ignore packages that do not have a dev version. Otherwise, the action will fail if any package does not have a dev version."
required: true
default: true
type: boolean

permissions:
contents: write

jobs:
tools-release:
name: Call workflow from image-tools
name: Tool Release
uses: polusai/image-tools/.github/workflows/package-release.yml@master
with:
num-commits: ${{ github.event.inputs.num-commits }}
ignore-missing-dev: ${{ github.event.inputs.ignore-missing-dev }}
repo_name: "tabular-tools"
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/tool-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ permissions:

jobs:
tools-tests:
name: Call workflow from image-tools
name: Tool Tests
uses: polusai/image-tools/.github/workflows/package-tests.yml@master
3 changes: 2 additions & 1 deletion clustering/feature-subsetting-tool/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.1-dev0
current_version = 0.2.2-dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
Expand All @@ -21,6 +21,7 @@ search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:plugin.json]

[bumpversion:file:README.md]

[bumpversion:file:VERSION]
Expand Down
179 changes: 179 additions & 0 deletions clustering/feature-subsetting-tool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# vscode
.vscode

# test data directory
data

# local manifests
src/polus/plugins/_plugins/manifests/*

# allow python scripts inside manifests dir
!src/polus/plugins/_plugins/manifests/*.py

#macOS
*.DS_Store


#husky
node_modules
14 changes: 9 additions & 5 deletions clustering/feature-subsetting-tool/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +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/feature-subsetting-tool"

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

# Install the tool
RUN pip3 install "${EXEC_DIR}/tabular-tools/${TOOL_DIR}" --no-cache-dir

# Set the entrypoint
# TODO: Change the entrypoint to the tool entrypoint
ENTRYPOINT ["python3", "-m", "polus.tabular.clustering.feature_subsetting"]
CMD ["--help"]
2 changes: 1 addition & 1 deletion clustering/feature-subsetting-tool/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Feature Data Subset(v0.2.1-dev0)
# Feature Data Subset(v0.2.2-dev0)

This WIPP plugin subsets data based on a given feature. It works in conjunction with the `polus-feature-extraction-plugin`, where the feature extraction plugin can be used to extract the features such as the mean intensity of every image in the input image collection.

Expand Down
2 changes: 1 addition & 1 deletion clustering/feature-subsetting-tool/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1-dev0
0.2.2-dev0
20 changes: 19 additions & 1 deletion clustering/feature-subsetting-tool/build-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/bin/bash

# TODO: Change the name of the tool here
tool_dir="clustering"
tool_name="feature-subsetting-tool"

# The version is read from the VERSION file
version=$(<VERSION)
docker build . -t polusai/feature-subsetting-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}
6 changes: 3 additions & 3 deletions clustering/feature-subsetting-tool/plugin.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "Feature Subsetting",
"version": "0.2.1-dev0",
"version": "0.2.2-dev0",
"title": "Feature Subsetting",
"description": "Subset data using a given feature.",
"author": "Gauhar Bains (gauhar.bains@labshare.org) and Hamdah Shafqat Abbasi (hamdahshafqat.abbasi@nih.gov)",
"institution": "National Center for Advancing Translational Sciences, National Institutes of Health",
"repository": "https://github.com/PolusAI/tabular-tools",
"website": "https://ncats.nih.gov/preclinical/core/informatics",
"citation": "",
"containerId": "polusai/feature-subsetting-plugin:0.2.1-dev0",
"containerId": "polusai/feature-subsetting-plugin:0.2.2-dev0",
"baseCommand": [
"python3",
"-m",
Expand Down Expand Up @@ -170,4 +170,4 @@
"required": "False"
}
}
}
}
3 changes: 2 additions & 1 deletion clustering/feature-subsetting-tool/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "polus-tabular-clustering-feature-subsetting"
version = "0.2.1-dev0"
version = "0.2.2-dev0"
description = "Subset data using a given feature."
authors = [
"Gauhar Bains <gauhar.bains@labshare.org>",
Expand All @@ -15,6 +15,7 @@ filepattern = "^2.0.4"
typer = "^0.7.0"
tqdm = "^4.64.1"
vaex = "^4.17.0"
pyarrow = ">=16.0,<17.0"


[tool.poetry.group.dev.dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Feature Subsetting Tool."""

__version__ = "0.2.1-dev0"
__version__ = "0.2.2-dev0"
3 changes: 2 additions & 1 deletion clustering/hdbscan-clustering-tool/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.8-dev1
current_version = 0.4.9-dev0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<dev>\d+))?
Expand All @@ -23,6 +23,7 @@ replace = version = "{new_version}"
[bumpversion:file:plugin.json]

[bumpversion:file:VERSION]

[bumpversion:file:README.md]

[bumpversion:file:src/polus/tabular/clustering/hdbscan_clustering/__init__.py]
Loading
Loading