Open tsi-rnguyen opened 4 months ago
Hey @tsi-rnguyen thanks for reporting this. I have a few questions:
jupyterhub_config.py
looks likeWhat do you see on jupyterhub's home page?
Hey @tsi-rnguyen thanks for reporting this. I have a few questions:
- What does your
jupyterhub_config.py
looks like- What does your environment look like?
What do you see on jupyterhub's home page?
My config file is pretty basic, all I've configured was https, oauth, and attempted to install jhub-apps.
This is the base TLJH jupyterhub_config.py
> import os
> from glob import glob
>
> from tljh import configurer
> from tljh.config import CONFIG_DIR, INSTALL_PREFIX, USER_ENV_PREFIX
> from tljh.user_creating_spawner import UserCreatingSpawner
> from tljh.utils import get_plugin_manager
>
> c = get_config() # noqa
> c.JupyterHub.spawner_class = UserCreatingSpawner
>
> c.JupyterHub.cleanup_servers = False
>
>
> c.JupyterHub.hub_port = 15001
>
> c.TraefikProxy.should_start = False
>
> dynamic_conf_file_path = os.path.join(INSTALL_PREFIX, "state", "rules", "rules.toml")
> c.TraefikFileProviderProxy.dynamic_config_file = dynamic_conf_file_path
> c.JupyterHub.proxy_class = "traefik_file"
>
> c.SystemdSpawner.extra_paths = [os.path.join(USER_ENV_PREFIX, "bin")]
> c.SystemdSpawner.default_shell = "/bin/bash"
>
> c.SystemdSpawner.unit_name_template = "jupyter-{USERNAME}"
>
> tljh_config = configurer.load_config()
> configurer.apply_config(tljh_config, c)
>
>
> pm = get_plugin_manager()
> pm.hook.tljh_custom_jupyterhub_config(c=c)
>
> extra_configs = sorted(glob(os.path.join(CONFIG_DIR, "jupyterhub_config.d", "*.py")))
> for ec in extra_configs:
> load_subconfig(ec)
I have extended that config with the below:
from tljh.user_creating_spawner import UserCreatingSpawner
from jhub_apps.configuration import install_jhub_apps
c.JupyterHub.bind_url = "https://<hosted url>"
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'
c.JAppsConfig.apps_auth_type = "oauth" # oauth or none (if you don't want authentication on apps)
c.JAppsConfig.python_exec = "python3"
c.JAppsConfig.jupyterhub_config_path = "jupyterhub_config.py"
c.JAppsConfig.conda_envs = []
c = install_jhub_apps(c, UserCreatingSpawner)
c.NotebookApp.tornado_settings = {"websocket_max_message_size": 100 * 1024 * 1024}
In addition here is my config.yaml
users:
admin:
- admin
Jupyterhub:
base_url: <info has been removed>
https:
enabled: true
tls:
key: <info has been removed>
cert: <info has been removed>
auth:
type: oauthenticator.generic.GenericOAuthenticator
GenericOAuthenticator:
<info has been removed>
hub:
db:
upgrade: true
Below is the packages installed inn /opt/tljh/hub/
Package Version
-------------------------------- --------------
aiohttp 3.9.5
aiosignal 1.3.1
alembic 1.13.2
annotated-types 0.7.0
anyio 4.4.0
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
arrow 1.3.0
asttokens 2.4.1
async-generator 1.10
async-lru 2.0.4
async-timeout 4.0.3
attrs 23.2.0
Babel 2.15.0
backcall 0.2.0
backoff 2.2.1
backports.tarfile 1.2.0
bcrypt 4.2.0
beautifulsoup4 4.12.3
bleach 6.1.0
bokeh 3.1.1
bokeh-root-cmd 0.1.2
cachetools 5.4.0
certifi 2024.7.4
certipy 0.1.3
cffi 1.16.0
charset-normalizer 3.3.2
click 8.1.7
comm 0.2.2
contourpy 1.1.1
cryptography 43.0.0
debugpy 1.8.2
decorator 5.1.1
defusedxml 0.7.1
distlib 0.3.8
dnspython 2.6.1
email_validator 2.2.0
escapism 1.0.1
exceptiongroup 1.2.2
executing 2.0.1
fastapi 0.111.1
fastapi-cli 0.0.4
fastjsonschema 2.20.0
filelock 3.15.4
fqdn 1.5.1
frozenlist 1.4.1
greenlet 3.0.3
h11 0.14.0
hatch 1.12.0
hatchling 1.25.0
httpcore 1.0.5
httptools 0.6.1
httpx 0.27.0
hyperlink 21.0.0
idna 3.7
importlib_metadata 8.2.0
importlib_resources 6.4.0
ipykernel 6.29.5
ipython 8.12.3
ipywidgets 8.1.3
isoduration 20.11.0
jaraco.classes 3.4.0
jaraco.context 5.3.0
jaraco.functools 4.0.1
jedi 0.19.1
jeepney 0.8.0
jhsingle-native-proxy 0.8.2
jhub-apps 2024.6.1
Jinja2 3.1.4
json5 0.9.25
jsonpointer 3.0.0
jsonschema 4.23.0
jsonschema-specifications 2023.12.1
jupyter 1.0.0
jupyter_client 8.6.2
jupyter-console 6.6.3
jupyter_core 5.7.2
jupyter-events 0.10.0
jupyter-lsp 2.2.5
jupyter_server 2.14.2
jupyter_server_terminals 0.5.3
jupyter-telemetry 0.1.0
jupyterhub 4.1.5
jupyterhub-firstuseauthenticator 1.0.0
jupyterhub-idle-culler 1.3.1
jupyterhub-ldapauthenticator 1.3.2
jupyterhub-nativeauthenticator 1.2.0
jupyterhub-systemdspawner 1.0.1
jupyterhub-tmpauthenticator 1.0.0
jupyterhub-traefik-proxy 1.1.0
jupyterlab 4.2.4
jupyterlab_pygments 0.3.0
jupyterlab_server 2.27.3
jupyterlab_widgets 3.0.11
keyring 25.2.1
ldap3 2.9.1
linkify-it-py 2.0.3
Mako 1.3.5
Markdown 3.6
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib-inline 0.1.7
mdit-py-plugins 0.4.1
mdurl 0.1.2
mistune 3.0.2
more-itertools 10.3.0
multidict 6.0.5
nbclient 0.10.0
nbconvert 7.16.4
nbformat 5.10.4
nest-asyncio 1.6.0
notebook 7.2.1
notebook_shim 0.2.4
numpy 1.24.4
oauthenticator 16.3.1
oauthlib 3.2.2
onetimepass 1.0.1
overrides 7.7.0
packaging 24.1
pamela 1.1.0
pandas 2.0.3
pandocfilters 1.5.1
panel 1.2.3
param 2.1.1
parso 0.8.4
passlib 1.7.4
pathspec 0.12.1
pexpect 4.9.0
pickleshare 0.7.5
pillow 10.4.0
pip 24.2
pkg_resources 0.0.0
pkgutil_resolve_name 1.3.10
platformdirs 4.2.2
plotlydash-tornado-cmd 0.0.6
pluggy 1.5.0
prometheus_client 0.20.0
prompt_toolkit 3.0.47
psutil 6.0.0
ptyprocess 0.7.0
pure_eval 0.2.3
pyasn1 0.6.0
pycparser 2.22
pycurl 7.45.2
pydantic 2.8.2
pydantic_core 2.20.1
Pygments 2.18.0
PyJWT 2.8.0
pyOpenSSL 24.2.1
python-dateutil 2.9.0.post0
python-dotenv 1.0.1
python-json-logger 2.0.7
python-multipart 0.0.9
python-slugify 8.0.4
pytz 2024.1
pyviz_comms 3.0.2
PyYAML 6.0.1
pyzmq 26.0.3
qtconsole 5.5.2
QtPy 2.4.1
referencing 0.35.1
requests 2.32.3
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rich 13.7.1
rpds-py 0.19.1
ruamel.yaml 0.17.40
ruamel.yaml.clib 0.2.8
SecretStorage 3.3.3
Send2Trash 1.8.3
setuptools 44.0.0
shellingham 1.5.4
simpervisor 0.4
six 1.16.0
sniffio 1.3.1
soupsieve 2.5
SQLAlchemy 2.0.31
stack-data 0.6.3
starlette 0.37.2
structlog 24.4.0
terminado 0.18.1
text-unidecode 1.3
the-littlest-jupyterhub 1.0.0
tinycss2 1.3.0
toml 0.10.2
tomli 2.0.1
tomli_w 1.0.0
tomlkit 0.13.0
tornado 6.4.1
tqdm 4.66.4
traitlets 5.14.3
trove-classifiers 2024.7.2
typer 0.12.3
types-python-dateutil 2.9.0.20240316
typing_extensions 4.12.2
tzdata 2024.1
uc-micro-py 1.0.3
uri-template 1.3.0
urllib3 2.2.2
userpath 1.9.2
uv 0.2.30
uvicorn 0.30.3
uvloop 0.19.0
virtualenv 20.26.3
watchfiles 0.22.0
wcwidth 0.2.13
webcolors 24.6.0
webencodings 0.5.1
websocket-client 1.8.0
websockets 12.0
widgetsnbextension 4.0.11
xyzservices 2024.6.0
yarl 1.9.4
zipp 3.19.2
zstandard 0.23.0
and lastly all I see on my jupyterhub home:
@aktech, any insights from the above logs / configs ?
ping ? If there is nothing to be learned from the above data, any ideas how to debug this ?
I am currently facing the same issue with TLJH. It seems that the japps_service
is running and if you go there you see the jhub apps api. I think the problem is that I cannot find the home page to set the apps.
Thanks for the config, taking a quick look at it, it seems you're missing (it's not documented):
from jhub_apps import theme_template_paths
c.JupyterHub.template_paths = theme_template_paths
c.JupyterHub.default_url = "/hub/home"
c.JAppsConfig.jupyterhub_config_path = "path/to/your/jupyterhub_config.py" # or something like str(Path(__file__).resolve())
Let me know if doesn't works. I'll to reproduce the config and will get back to you guys. I just came back from PTO today :)
Thanks for the response.
It is going a step further now. It now redirects the traffic to: services/japps/jhub-login
. But that page cannot be reached:
INFO: xx.xx.xxx.xxx:0 - "GET /services/japps/spawner-profiles/ HTTP/1.1" 403 Forbidden
INFO: xx.xx.xxx.xxx:0 - "GET /services/japps/user HTTP/1.1" 403 Forbidden
INFO: xx.xx.xxx.xxx:0 - "GET /services/japps/jhub-login HTTP/1.1" 302 Found
Aug 07 23:54:27 ip-xx-xx-xxx-xxx python3[5236]: 2024-08-07 23:54:27,435 INFO jhub_apps.service.routes: 90: event='Logging in' view=None peer=None request=<starlette.requests.Request object at 0x7cef0d101130> request_id='d45d34ad-bf9a-4507-a4d6-466b73cd48ea'
Here is my jupyterhub_config.py
file content:
from tljh.user_creating_spawner import UserCreatingSpawner
from jhub_apps.configuration import install_jhub_apps
from jhub_apps import theme_template_paths
from pathlib import Path
c.JupyterHub.bind_url = "http://<hosted url>"
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'
c.JupyterHub.template_paths = theme_template_paths
c.JupyterHub.default_url = "/hub/home"
c.JAppsConfig.apps_auth_type = "oauth" # oauth or none (if you don't want authentication on apps)
c.JAppsConfig.python_exec = "python3"
c.JAppsConfig.jupyterhub_config_path = "jupyterhub_config.py"
c.JAppsConfig.conda_envs = []
c = install_jhub_apps(c, UserCreatingSpawner)
c.JAppsConfig.jupyterhub_config_path = str(Path(__file__).resolve())
UPDATE: Apparently in the
Per JHub docs, there should be a &redirect_uri=/hub/home/
.
@aktech Would appreciate if you have any update / advice regarding this issue.
I just deployed a fresh TLJH and created a file named config.py
at /opt/tljh/config/jupyterhub_config.d/config.py
, with following contents.
from tljh.user_creating_spawner import UserCreatingSpawner
from jhub_apps.configuration import install_jhub_apps
from jhub_apps import theme_template_paths
from pathlib import Path
c.JupyterHub.bind_url = "http://192.168.50.37"
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'
c.JAppsConfig.apps_auth_type = "oauth" # or none (if you don't want authentication on apps)
c.JAppsConfig.python_exec = "python3"
# Pass in the path to jupyterhub config
c.JAppsConfig.jupyterhub_config_path = str(Path(__file__).resolve())
# Either a static list of conda environments to show in the
# create panel apps form or a callable to fetch conda enviornments
# dynamically, e.g. from conda-store API
c.JAppsConfig.conda_envs = []
c = install_jhub_apps(c, UserCreatingSpawner)
c.JupyterHub.template_paths = theme_template_paths
c.JupyterHub.default_url = "/hub/home"
I was able to access the jhub-apps and deploy a panel app:
The logo didn't loaded by default, which we need to fix.
Per JHub docs, there should be a &redirect_uri=/hub/home/.
I'll take a look and get that fixed.
It is going a step further now. It now redirects the traffic to: services/japps/jhub-login. But that page cannot be reached:
@BardiaKh What do you see in the UI and the network tab, can you share a screenhot?
I've installed TLJH locally using docker as described here: https://tljh.jupyter.org/en/latest/contributing/dev-setup.html
Then I created a conda env, installed all dependencies, and created a config.py
file as you described
from tljh.user_creating_spawner import UserCreatingSpawner
from jhub_apps.configuration import install_jhub_apps
from jhub_apps import theme_template_paths
from pathlib import Path
c.JupyterHub.bind_url = "http://127.0.0.1:12000"
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'
c.JAppsConfig.apps_auth_type = "oauth" # or none (if you don't want authentication on apps)
c.JAppsConfig.python_exec = "python3"
# Pass in the path to jupyterhub config
c.JAppsConfig.jupyterhub_config_path = str(Path(__file__).resolve())
# Either a static list of conda environments to show in the
# create panel apps form or a callable to fetch conda enviornments
# dynamically, e.g. from conda-store API
c.JAppsConfig.conda_envs = []
c = install_jhub_apps(c, UserCreatingSpawner)
c.JupyterHub.template_paths = theme_template_paths
c.JupyterHub.default_url = "/hub/home"
I can start JupyterLab without issues, and I can see the new Hub Control panel, but when i try to create a streamlit app it seems to time out and there is an error "Undefined has no properties". The app is created twice and still shown in the Control Panel but it is not able to run. When I start it the status goes back to "Pending"
Any idea what is going wrong? Thanks a lot.
I can start JupyterLab without issues, and I can see the new Hub Control panel, but when i try to create a streamlit app
I assume you do have streamlit
in your environment? Can you please share your environment?
The app is created twice and still shown in the Control Panel but it is not able to run.
This might be a bug which should have been fixed in the latest release, what version of jhub-apps
are you running?
Thanks for the tipps. I reinstalled everything and i can create streamlit dashboards now if I install everything in /opt/tljh/user
. There are still two issues:
1) Conda envs
sudo -E /opt/tljh/user/bin/conda create -n py3.10 python=3.10 ipykernel streamlit jhub-apps altair pandas ipykernel jhsingle-native-proxy>=0.8.2 -c conda-forge -y
sudo /opt/tljh/user/envs/py3.10/bin/python3 -m ipykernel install --name "py3.10" --display-name "Python 3.10" --prefix /opt/tljh/user
How do I add/reference the new conda environments in the config?
c.JAppsConfig.conda_envs = ['py3.10']
or ['/opt/tljh/user/envs/py3.10']
2) Dashboards are not shared I created a second user but the app is not shown for him. How can I share the app with all users or a group of them?
Thanks a lot!
@aktech Could you help please?
Context
I have installed the latest TLJH on a Ubuntu instance and have been trying to install jhub-apps into it following the instructions provided in the readme. And it appears to spawn the API docs on port 10202 but not the actual jhub-apps on port 8000. I don't see any particular errors in the journalctl that would indicate a start issue. Is there something I am missing?
I have jhub-apps installed for both /opt/tljh/hub and /opt/tljh/user.
Value and/or benefit
tljh integration usage
Anything else?
No response