From 33d6192bb15b9aab7c7b0a04f493006a89fd218e Mon Sep 17 00:00:00 2001 From: Hedingber Date: Mon, 17 May 2021 05:25:04 +0300 Subject: [PATCH] [Jupyter image] Fix API exploding trying to connect to itself + other fixes (#848) --- MANIFEST.in | 1 + dockerfiles/jupyter/Dockerfile | 18 +++++++++++------- setup.py | 2 ++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6303b35840..4a0ea696a1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 * diff --git a/dockerfiles/jupyter/Dockerfile b/dockerfiles/jupyter/Dockerfile index 43e6ec93bf..7f8635a0b7 100644 --- a/dockerfiles/jupyter/Dockerfile +++ b/dockerfiles/jupyter/Dockerfile @@ -16,23 +16,27 @@ 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' \ @@ -40,7 +44,7 @@ ENV MLRUN_DBPATH=http://localhost:8080 \ 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='' \ diff --git a/setup.py b/setup.py index b264eac1fe..2e988ca87f 100644 --- a/setup.py +++ b/setup.py @@ -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",