Skip to content
Snippets Groups Projects
Commit fc75c156 authored by Julian's avatar Julian
Browse files

configure dash proxy entrypoint via simple py_module

parent 90babf84
No related branches found
No related tags found
2 merge requests!6Finalized Jupyterlab for the sprint,!2Dev
......@@ -9,12 +9,10 @@ RUN conda env update -q -f /tmp/environment.yml && \
conda env export -n "root" && \
jupyter lab build
COPY jupyter_notebook_config.py ${HOME}/.jupyter/
COPY dash_proxy.py setup.py /tmp/dash_proxy/
RUN pip3 install --upgrade pip
RUN pip install /tmp/dash_proxy/
# copy dash app
COPY app ${HOME}/app/
RUN chown -R jovyan ${HOME}/app/
COPY client.py ${HOME}/
RUN chown -R jovyan ${HOME}/client.py
# A Jupyterlab for LLM
AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, OPENAI_API_VERSION need to be stored in a config.txt file in the home directory.
In order to run Dash or use the client, AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, OPENAI_API_VERSION need to be stored in a config.txt file in the home directory.
import os
import sys
sys.path.append("/home/jovyan")
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import argparse
import logging
......@@ -26,7 +27,7 @@ else:
# define Dash app
app = Dash(
name=__name__,
requests_pathname_prefix="/dash/"
requests_pathname_prefix="/Dash/"
)
# define layout
......
File moved
import os
import logging
logger = logging.getLogger(__name__)
logger.setLevel('INFO')
HERE = os.path.dirname(os.path.abspath(__file__))
def setup_dash_proxy():
command = [
'python',
'app/app.py',
'--port',
'{port}'
]
return {
"command": command,
"new_browser_tab": False,
"launcher_entry": {
"enabled": True,
'title': 'Dash'
}
}
# Configuration file for jupyter-notebook.
c.ServerProxy.servers = {
'dash': {
'command': [
'python',
'app/app.py',
'--port',
'{port}'
],
'absolute_url': False,
'new_browser_tab': False
}
}
setup.py 0 → 100644
import setuptools
setuptools.setup(
author="Julian Rasch",
author_email="julian.rasch@fh-muenster.de",
description="A small module to run Dash inside a dockerized Jupyterlab.",
name="jupyter-dash-proxy",
py_modules=["dash_proxy"],
entry_points={
"jupyter_serverproxy_servers": [
# name = packagename:function_name
"Dash = dash_proxy:setup_dash_proxy",
]
},
install_requires=["jupyter-server-proxy==4.0.0"],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment