@@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
1616 build-essential && \
1717 apt-get clean && rm -rf /var/lib/apt/lists/*
1818
19- RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest -Linux-x86_64.sh -O ~/miniconda.sh && \
19+ RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py312_25.3.1-1 -Linux-x86_64.sh -O ~/miniconda.sh && \
2020 chmod +x ~/miniconda.sh && \
2121 bash ~/miniconda.sh -b -p /app/miniconda && \
2222 rm ~/miniconda.sh && \
@@ -28,11 +28,14 @@ ENV PATH="/app/miniconda/bin:$PATH"
2828ENV PYTHONPATH="/app/miniconda/lib/python3.12/site-packages:${PYTHONPATH:-}"
2929
3030# Install uv & mamba
31- RUN pip3 install --no-cache-dir uv==0.5.21
32- RUN conda install -c conda-forge mamba -y
31+ RUN --mount=type=cache,target=/root/.cache/pip \
32+ pip3 install --no-cache-dir uv==0.5.21
33+ RUN --mount=type=cache,target=/app/miniconda/pkgs \
34+ conda install -c conda-forge mamba -y
3335
3436# Install R and kernels in the crow_env environment
35- RUN mamba install -c conda-forge -y \
37+ RUN --mount=type=cache,target=/app/miniconda/pkgs \
38+ mamba install -c conda-forge -y \
3639 r-base=4.3.3 \
3740 r-recommended=4.3 \
3841 r-irkernel=1.3.2 \
@@ -83,10 +86,13 @@ RUN mamba install -c conda-forge -y \
8386 statsmodels=0.14.4 \
8487 umap-learn=0.5.7
8588
86- RUN python -m ipykernel install --user --name python3 --display-name "Python 3 (ipykernel)"
87- RUN R -e 'IRkernel::installspec(name = "R", displayname = "R (4.3.3)")'
89+ RUN --mount=type=cache,target=/app/miniconda/pkgs \
90+ python -m ipykernel install --user --name python3 --display-name "Python 3 (ipykernel)"
91+ RUN --mount=type=cache,target=/app/miniconda/pkgs \
92+ R -e 'IRkernel::installspec(name = "R", displayname = "R (4.3.3)")'
8893
89- RUN mamba install -c conda-forge -c bioconda -y \
94+ RUN --mount=type=cache,target=/app/miniconda/pkgs \
95+ mamba install -c conda-forge -c bioconda -y \
9096 biokit=0.5.0 \
9197 gseapy=1.1.4 \
9298 blast=2.16.0 \
@@ -109,22 +115,15 @@ RUN mamba install -c conda-forge -c bioconda -y \
109115 bioconductor-genomicranges=1.54.1 \
110116 bioconductor-summarizedexperiment=1.32.0 \
111117 bioconductor-apeglm=1.24.0 \
112- bioconductor-flowcore=2.14.0
118+ bioconductor-flowcore=2.14.0 \
119+ bioconductor-flowmeans=1.62.0
113120
114121ENV UV_COMPILE_BYTECODE=1
115122ENV UV_LINK_MODE=copy
116123
117124FROM base AS builder
118125
119126ARG MODULE_NAME
120- ARG USE_INTERNAL_DEPS
121- ARG USE_GIT_FUTUREHOUSE_CLIENT
122-
123-
124- RUN mkdir -p ~/.ssh && \
125- chmod 700 ~/.ssh && \
126- ssh-keyscan github.com >> ~/.ssh/known_hosts && \
127- printf "Host github.com\n IdentityFile /root/.ssh/pqa_id_ed25519\n IdentityFile /root/.ssh/aviary_id_ed25519\nHost gitlab.company.com\n IdentityFile /root/.ssh/pqa_id_ed25519\n" > ~/.ssh/config
128127
129128RUN --mount=type=cache,target=/var/cache/apt \
130129 apt-get update -qq && \
@@ -135,36 +134,15 @@ RUN --mount=type=cache,target=/var/cache/apt \
135134ENV VIRTUAL_ENV="/app/miniconda/bin"
136135ENV PATH="/app/miniconda/bin:$PATH"
137136
137+ # Now copy application code (this will change frequently)
138138COPY ./${MODULE_NAME} /app/${MODULE_NAME}
139-
140139RUN mkdir -p /app/scripts
141140COPY ./scripts/run_crow_job.py /app/scripts/
142141
143- RUN --mount=type=cache,target=/root/.cache/uv \
144- --mount=type=ssh \
145- --mount=type=secret,id=ssh_key,target=/root/.ssh/aviary_id_ed25519.tmp \
146- if [ "$USE_INTERNAL_DEPS" = "true" ]; then \
147- cp /root/.ssh/aviary_id_ed25519.tmp /root/.ssh/aviary_id_ed25519 && \
148- chmod 400 /root/.ssh/aviary_id_ed25519 && \
149- git clone git@github.com:Future-House/aviary-internal.git /app/aviary_internal && \
150- cd /app/aviary_internal/aviary_internal && \
151- uv pip install --system -e .; \
152- else \
153- echo 'Skipping aviary_internal install'; \
154- fi && \
155- if [ "$USE_GIT_FUTUREHOUSE_CLIENT" = "true" ]; then \
156- git clone git@github.com:Future-House/crow-ecosystem.git /app/crow-ecosystem && \
157- cd /app/crow-ecosystem/packages/futurehouse-client && \
158- uv pip install --system -e .; \
159- else \
160- uv pip install --system futurehouse-client; \
161- fi
162-
142+ # Install application dependencies (this will only rerun when code changes)
163143WORKDIR /app/${MODULE_NAME}
164- RUN --mount=type=ssh \
165- --mount=type=secret,id=pqa_ssh_key,target=/root/.ssh/pqa_id_ed25519.tmp \
166- cp /root/.ssh/pqa_id_ed25519.tmp /root/.ssh/pqa_id_ed25519 && \
167- chmod 400 /root/.ssh/pqa_id_ed25519 && \
144+ RUN --mount=type=cache,target=/root/.cache/uv \
145+ --mount=type=cache,target=/app/miniconda/pkgs \
168146 if [ -f "pyproject.toml" ]; then \
169147 uv pip install --system -e .; \
170148 elif [ -f "requirements.txt" ]; then \
@@ -176,11 +154,6 @@ RUN --mount=type=ssh \
176154RUN find /app -type l -delete && \
177155 rm -rf /app/.git
178156
179- # Fix futurehouse_client imports by creating a symlink if we're using the git version
180- RUN if [ "$USE_GIT_FUTUREHOUSE_CLIENT" = "true" ]; then \
181- ln -sf /app/crow-ecosystem/packages/futurehouse-client/futurehouse_client /app/miniconda/lib/python3.12/site-packages/futurehouse_client; \
182- fi
183-
184157FROM base AS runtime
185158
186159COPY --from=builder /app/ /app/
0 commit comments