Skip to content

Commit

Permalink
updated docker file for environmental variables
Browse files Browse the repository at this point in the history
  • Loading branch information
hamshkhawar committed Apr 23, 2024
1 parent 30d5f2b commit 704d345
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
15 changes: 14 additions & 1 deletion utils/omero-download-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
FROM polusai/bfio:2.3.6
FROM continuumio/miniconda3

# environment variables defined in polusai/bfio
ENV EXEC_DIR="/opt/executables"
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}

Expand All @@ -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"]
Expand Down
3 changes: 2 additions & 1 deletion utils/omero-download-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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```
8 changes: 3 additions & 5 deletions utils/omero-download-tool/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions utils/omero-download-tool/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -30,3 +34,8 @@ ruff = "^0.0.270"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
pythonpath = [
"."
]

0 comments on commit 704d345

Please sign in to comment.