-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Yu-AnChen/master
Compress output image files
- Loading branch information
Showing
10 changed files
with
381 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Note for creating/building docker image for palom ([reference](https://micromamba-docker.readthedocs.io/en/latest/advanced_usage.html#advanced-usages)) | ||
|
||
1. Create reference env on micromamba's docker image | ||
|
||
```bash | ||
# Run bash in micromamba docker image with bind volume for writing out env | ||
# lock file | ||
docker run -it --rm --platform linux/amd64 -v "$(pwd)":/data mambaorg/micromamba:1.4.9 bash | ||
``` | ||
|
||
```bash | ||
# Manually install known deps in `palom` env | ||
micromamba create -y -n palom python=3.10 "scikit-image<0.20" scikit-learn "zarr<2.15" tifffile imagecodecs matplotlib tqdm scipy dask numpy loguru=0.5.3 "ome-types>0.3" "pydantic<2" pint napari-lazy-openslide yamale fire termcolor dask-image -c conda-forge | ||
# Use `pip install --dry-run` to verify, would only expect to see `opencv`, | ||
# and `palom` | ||
micromamba activate palom | ||
python -m pip install --dry-run palom | ||
# output: Would install opencv-python-4.8.0.76 palom-2023.8.1 | ||
# if the above checks out, export micromamba env as lock file | ||
micromamba env export --explicit > /data/docker-env.lock | ||
# pip install the rest of the packages, note: use `opencv-python-headless` | ||
# instead of `opencv-python` | ||
python -m pip install --no-deps palom==2023.8.1 opencv-python-headless==4.8.0.76 | ||
# Test the environment | ||
python -c "import cv2; cv2.blur" | ||
``` | ||
|
||
1. When building the docker image, specify `--platform linux/amd64` | ||
|
||
```bash | ||
docker build --platform linux/amd64 --tag test-s3seg-large . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
FROM python:3.10 | ||
FROM mambaorg/micromamba:1.4.9 | ||
|
||
RUN python -m pip install \ | ||
palom>=2022.9.1 \ | ||
dask[dataframe] \ | ||
dask-image \ | ||
ome_types | ||
RUN python -m pip uninstall opencv-python -y | ||
RUN python -m pip install opencv-python-headless | ||
COPY --chown=$MAMBA_USER:$MAMBA_USER docker-env.lock /tmp/docker-env.lock | ||
RUN micromamba install --name base --yes --file /tmp/docker-env.lock \ | ||
&& micromamba clean --trash -aflp --yes | ||
|
||
COPY S3segmenter.py ./app/S3segmenter.py | ||
COPY save_tifffile_pyramid.py ./app/save_tifffile_pyramid.py | ||
COPY watershed.py ./app/watershed.py | ||
COPY s3seg_qc.py ./app/s3seg_qc.py | ||
COPY s3seg_util.py ./app/s3seg_util.py | ||
COPY ignored_args.py ./app/ignored_args.py | ||
# pip install packages that are not available/problematic on conda-forge | ||
RUN /opt/conda/bin/python -m pip install \ | ||
--no-deps \ | ||
opencv-python-headless==4.8.0.76 \ | ||
palom==2023.8.1 \ | ||
&& /opt/conda/bin/python -m pip cache purge | ||
|
||
# copy scripts to /app/ | ||
COPY / /app/ | ||
|
||
# add conda path to PATH to allow entrypoint overwrite | ||
ENV PATH="${PATH}:/opt/conda/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION = '1.5.5' |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters