@@ -7,6 +7,9 @@ ARG http_proxy
77ARG https_proxy
88ARG no_proxy
99
10+ # NOTE: set to ES8 or Elasticsearch 8 or OS for Opensearch
11+ ARG COGSTACK_BACKEND=ES9
12+
1013# set to "true" for the GPU build
1114ARG GPU_BUILD=false
1215
@@ -212,16 +215,20 @@ RUN uv pip install --upgrade --system pip setuptools wheel
212215
213216# install the rest of the packages including medcat
214217COPY ./requirements.txt /srv/jupyterhub/
215- # install requirements for working with cogstack scripts
216- COPY notebooks/demo_working_with_cogstack/requirements.txt /srv/jupyterhub/working_with_cogstack_requirements.txt
217218
218219RUN if [ "$GPU_BUILD" = "true" ] && [ "$CPU_ARCHITECTURE" = "amd64" ]; then \
219220 uv pip install --system --no-cache-dir -r /srv/jupyterhub/requirements.txt && \
220- uv pip install --system --no-cache-dir -r /srv/jupyterhub/working_with_cogstack_requirements.txt ; \
221+ # NOTE: it'll create the medcat-scripts folder within
222+ uv run python -m medcat download-scripts /srv/jupyterhub/ && \
223+ uv pip install --system --no-cache-dir -r /srv/jupyterhub/medcat-scripts/requirements.txt ; \
221224 else \
222225 uv pip install --system --no-cache-dir -r /srv/jupyterhub/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ && \
223- uv pip install --system --no-cache-dir -r /srv/jupyterhub/working_with_cogstack_requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ ; \
224- fi
226+ uv run python -m medcat download-scripts /srv/jupyterhub/ && \
227+ uv pip install --system --no-cache-dir -r /srv/jupyterhub/medcat-scripts/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/ ; \
228+ fi && \
229+ # install cogstack-es (Cogstack class)
230+ uv pip install "cogstack-es[$COGSTACK_BACKEND]" && \
231+ mv /srv/jupyterhub/medcat-scripts/notebooks/* /home/jovyan/work/. # move notebooks
225232
226233#######################################################################################################
227234
0 commit comments