Skip to content

Commit

Permalink
[Jupyter] Update jupyter deps (mlrun#7200)
Browse files Browse the repository at this point in the history
  • Loading branch information
liranbg authored Feb 2, 2025
1 parent 0c5cd07 commit 10e6bff
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 371 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,6 @@ upgrade-mlrun-jupyter-deps-lock: verify-uv-version ## Upgrade mlrun-jupyter lock
requirements.txt \
extras-requirements.txt \
dockerfiles/jupyter/requirements.txt \
dockerfiles/mlrun-api/requirements.txt \
$(MLRUN_UV_UPGRADE_FLAG) \
--output-file dockerfiles/jupyter/locked-requirements.txt

Expand Down
21 changes: 9 additions & 12 deletions dockerfiles/jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,19 @@ RUN --mount=from=uv-image,source=/uv,target=/bin/uv \
--mount=type=bind,source=dockerfiles/jupyter/locked-requirements.txt,target=locked-requirements.txt \
uv pip install --no-deps --require-hashes -r locked-requirements.txt

COPY --chown=$NB_UID:$NB_GID . $HOME/mlrun
# ensure we have the latest source code to be installed
COPY --chown=$NB_UID:$NB_GID . /tmp/mlrun

RUN --mount=from=uv-image,source=/uv,target=/bin/uv \
--mount=type=cache,target=/root/.cache/uv \
cd $HOME/mlrun && uv pip install .[complete-api]
cd /tmp/mlrun && uv pip install '.[complete]'

# cleanup, source code is not needed anymore
RUN rm -rf /tmp/mlrun

# This will usually cause a cache miss - so keep it in the last layers
ARG MLRUN_CACHE_DATE=initial

# Use 1.7.x version from mlrun/demos to update the demos(do not update version).
RUN git clone --branch 1.7.x https://github.com/mlrun/demos.git $HOME/demos && \
./demos/update_demos.sh --user=jovyan --path=/home/jovyan/demos --no-backup && \
Expand All @@ -86,18 +91,10 @@ ENV JUPYTER_ENABLE_LAB=yes \
MLRUN_HTTPDB__PORT=8080

# backup home since it will be deleted when using pvc
RUN mkdir data && \
tar -cvf /tmp/basehome.tar $HOME
RUN mkdir data && tar -cvf /tmp/basehome.tar $HOME

# use tini as entrypoint to allow signal handling
# and avoid zombie processes
ENTRYPOINT ["tini", "--"]

# run the mlrun api and the notebook in parallel
CMD echo "1" > "${HOME}/.intdata" && \
cd $HOME/mlrun && \
MLRUN_LOG_LEVEL=DEBUG \
PYTHONPATH=$HOME/mlrun/server/py \
MLRUN_ARTIFACT_PATH=$HOME/data \
python server/py/services/api/main.py & \
MLRUN_DBPATH=http://localhost:8080 /usr/local/bin/mlce-start.sh
CMD echo "1" > "${HOME}/.intdata" && /usr/local/bin/mlce-start.sh
Loading

0 comments on commit 10e6bff

Please sign in to comment.