Skip to content

Commit

Permalink
[Jupyter image] Fix API exploding trying to connect to itself + other…
Browse files Browse the repository at this point in the history
… fixes (mlrun#848)
  • Loading branch information
Hedingber authored May 17, 2021
1 parent a8a438a commit 33d6192
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include Dockerfile*
include Makefile
include README.md
include mlrun/utils/version/version.json
include mlrun/api/alembic.ini
include *requirements.txt
recursive-include examples *
recursive-include hack *
Expand Down
18 changes: 11 additions & 7 deletions dockerfiles/jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,35 @@ COPY ./docs/_static/images/mlrun-quick-start $HOME/_static/images/mlrun-quick-st
COPY ./examples $HOME/examples/

ARG MLRUN_CACHE_DATE=initial
RUN git clone https://github.com/mlrun/demos.git $HOME/demos
RUN git clone --branch release/v0.6.x-latest https://github.com/mlrun/demos.git $HOME/demos
RUN git clone https://github.com/mlrun/functions.git $HOME/functions

RUN mkdir data

COPY ./dockerfiles/jupyter/requirements.txt /tmp
RUN python -m pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt
COPY ./dockerfiles/jupyter/requirements.txt /tmp/requirements/jupyter-requirements.txt
COPY ./dockerfiles/mlrun-api/requirements.txt /tmp/requirements/mlrun-api-requirements.txt
COPY ./requirements.txt /tmp/requirements/requirement.txt
RUN python -m pip install \
-r /tmp/requirements/jupyter-requirements.txt \
-r /tmp/requirements/mlrun-api-requirements.txt \
-r /tmp/requirements/requirement.txt

COPY . /tmp/mlrun
RUN cd /tmp/mlrun && python -m pip install ".[complete-api]" && cd /tmp && rm -rf mlrun
RUN cd /tmp/mlrun && python -m pip install ".[complete-api]"

RUN chown -R $NB_UID:$NB_GID $HOME

USER $NB_UID

ENV MLRUN_DBPATH=http://localhost:8080 \
MLRUN_ARTIFACT_PATH=$HOME/data \
ENV MLRUN_ARTIFACT_PATH=$HOME/data \
JUPYTER_ENABLE_LAB=yes \
MLRUN_HTTPDB__DATA_VOLUME=$HOME/data \
MLRUN_HTTPDB__DSN='sqlite:////home/jovyan/data/mlrun.db?check_same_thread=false' \
MLRUN_HTTPDB__LOGS_PATH=$HOME/data/logs \
MLRUN_PVC_MOUNT=nfsvol:/home/jovyan/data

# run the mlrun db (api) and the notebook in parallel
CMD mlrun db & start-notebook.sh \
CMD python -m mlrun db & MLRUN_DBPATH=http://localhost:8080 start-notebook.sh \
--ip="0.0.0.0" \
--port=8888 \
--NotebookApp.token='' \
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def load_deps(path):
"mlrun.feature_store",
"mlrun.feature_store.retrieval",
"mlrun.api",
"mlrun.api.migrations",
"mlrun.api.migrations.versions",
"mlrun.api.api",
"mlrun.api.api.endpoints",
"mlrun.api.db",
Expand Down

0 comments on commit 33d6192

Please sign in to comment.