Skip to content

Commit

Permalink
Merge branch 'ray_cluster_functionality' of https://github.com/choose…
Browse files Browse the repository at this point in the history
…happy/HistoQC into ray_cluster_functionality
  • Loading branch information
jacksonjacobs1 committed Mar 21, 2024
2 parents cd81a56 + 6a1618e commit 7be2861
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 27 deletions.
33 changes: 8 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
# Dockerfile for HistoQC.
# This Dockerfile uses two stages. In the first, the project's python dependencies are
# installed. This requires a C compiler. In the second stage, the HistoQC directory and
# the python environment are copied over. We do not require a C compiler in the second
# stage, and so we can use a slimmer base image.

FROM python:3.8 AS builder
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /opt/HistoQC
COPY . .
# Create virtual environment for this project. This makes it easier to copy the Python
# installation into the second stage of the build.
ENV PATH="/opt/HistoQC/venv/bin:$PATH"
RUN python -m venv venv \
&& python -m pip install --no-cache-dir setuptools wheel \
&& python -m pip install --no-cache-dir -r requirements.txt \
&& python -m pip install --no-cache-dir . \
# We force this so there is no error even if the dll does not exist.
&& rm -f libopenslide-0.dll

FROM rayproject/ray-ml:latest-gpu
ARG DEBIAN_FRONTEND=noninteractive
USER root
Expand All @@ -29,12 +10,14 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt/HistoQC
COPY --from=builder /opt/HistoQC/ .

RUN pip install .
COPY . .
# install
RUN pip install --no-cache-dir setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir . \
&& rm -f libopenslide-0.dll

USER ray
WORKDIR /data

# CMD ["bash"]
CMD [ "python", "-m", "histoqc", "--help" ]
CMD ["bash"]

2 changes: 1 addition & 1 deletion histoqc/BaseImage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
import os
import os, re
import numpy as np
import zlib, dill
from distutils.util import strtobool
Expand Down
1 change: 1 addition & 0 deletions histoqc/import_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .openslide import openslide
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
for f in glob.iglob(f"histoqc/data/{folder}/**/*", recursive=True)
if os.path.isfile(f)
]

import_wrapper_files = [
os.path.relpath(f, "histoqc/import_wrapper_files/")
for f in glob.iglob(f"histoqc/import_wrapper_files/**/*", recursive=True)
if os.path.isfile(f)
]
setup(
use_scm_version={
# duplicated config from pyproject.toml; keep in sync
Expand All @@ -28,5 +32,6 @@
'histoqc.config': ['*.ini'],
'histoqc.data': data_files,
'histoqc.ui': ui_files,
'histoqc.import_wrapper': import_wrapper_files
}
)

0 comments on commit 7be2861

Please sign in to comment.