diff --git a/utils/omero-download-tool/Dockerfile b/utils/omero-download-tool/Dockerfile index 1d4694b18..e01228132 100644 --- a/utils/omero-download-tool/Dockerfile +++ b/utils/omero-download-tool/Dockerfile @@ -1,4 +1,4 @@ -FROM polusai/bfio:2.3.6 +FROM continuumio/miniconda3 # environment variables defined in polusai/bfio ENV EXEC_DIR="/opt/executables" @@ -6,6 +6,14 @@ ENV POLUS_IMG_EXT=".ome.tif" ENV POLUS_TAB_EXT=".csv" ENV POLUS_LOG="INFO" +ARG OMERO_USERNAME +ARG OMERO_PASSWORD +ENV OMERO_USERNAME=$OMERO_USERNAME +ENV OMERO_PASSWORD=$OMERO_PASSWORD + + +ARG conda_env=myenv + # Work directory defined in the base container WORKDIR ${EXEC_DIR} @@ -15,6 +23,11 @@ COPY VERSION ${EXEC_DIR} COPY README.md ${EXEC_DIR} COPY src ${EXEC_DIR}/src +RUN conda env create -f environment.yml + +ENV PATH /opt/conda/envs/myenv/bin:$PATH +RUN /bin/bash -c "source activate myenv" + RUN pip3 install ${EXEC_DIR} --no-cache-dir ENTRYPOINT ["python3", "-m", "polus.images.utils.omero_download"] diff --git a/utils/omero-download-tool/README.md b/utils/omero-download-tool/README.md index 08f3e9713..1d9e8ce21 100644 --- a/utils/omero-download-tool/README.md +++ b/utils/omero-download-tool/README.md @@ -41,4 +41,5 @@ This plugin takes 2 input arguments and ## Sample docker command: -```docker run -v /home/ec2-user/data/:/home/ec2-user/data/ polusai/omero-download-tool:0.1.0-dev0 --dataType="plate" --id=108 --outDir=/home/ec2-user/data/output``` +```bash +docker run -e OMERO_USERNAME=$OMERO_USERNAME -e OMERO_PASSWORD=$OMERO_PASSWORD -v /home/ec2-user/data/:/home/ec2-user/data/ polusai/omero-download-tool:0.1.0-dev0 --dataType="plate" --id=108 --outDir=/home/ec2-user/data/output``` diff --git a/utils/omero-download-tool/environment.yml b/utils/omero-download-tool/environment.yml index 5e9b50687..d34752596 100644 --- a/utils/omero-download-tool/environment.yml +++ b/utils/omero-download-tool/environment.yml @@ -3,13 +3,11 @@ channels: - defaults - conda-forge dependencies: - - python=3.9 - - numpy=1.21.0 + - python==3.9.18 + - numpy==1.21.0 + - bfio=* - ome:omero-py - - requests=* - - tqdm=* - pydantic=* - - cryptography=* - pip - pip: - preadator==0.4.0-dev2 diff --git a/utils/omero-download-tool/pyproject.toml b/utils/omero-download-tool/pyproject.toml index ece62a309..894c4acd2 100644 --- a/utils/omero-download-tool/pyproject.toml +++ b/utils/omero-download-tool/pyproject.toml @@ -10,6 +10,10 @@ packages = [{include = "polus", from = "src"}] [tool.poetry.dependencies] python = "3.9.18" +bfio = {version = "^2.3.6", extras = ["all"]} +numpy = "1.21.0" +typer = "^0.7.0" +pydantic = "^2.5.3" [[tool.poetry.source]] name = "test" @@ -30,3 +34,8 @@ ruff = "^0.0.270" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +pythonpath = [ + "." +]