Coder Social home page Coder Social logo

hassio-addons / addon-jupyterlab Goto Github PK

View Code? Open in Web Editor NEW
51.0 4.0 26.0 737 KB

JupyterLab Lite - Home Assistant Community Add-ons

Home Page: https://addons.community

License: MIT License

Dockerfile 50.75% Groovy 14.36% Jinja 34.89%
jupyter jupyterlab home-assistant homeassistant addon addons

addon-jupyterlab's Introduction

Home Assistant Community Add-on: JupyterLab

GitHub Release Project Stage License

Supports armhf Architecture Supports armv7 Architecture Supports aarch64 Architecture Supports amd64 Architecture Supports i386 Architecture

Github Actions Project Maintenance GitHub Activity

Discord Community Forum

Sponsor Frenck via GitHub Sponsors

Support Frenck on Patreon

Create documents containing live code, equations, visualizations, and explanatory text.

The JupyterLab add-on

About

JupyterLab is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.

This add-on runs JupyterLab, which is the next-generation user interface for Project Jupyter. It is an extensible environment for interactive and reproducible computing, based on the Jupyter Notebook and Architecture.

Support

Got questions?

You have several options to get them answered:

You could also open an issue here GitHub.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! ๐Ÿ˜

Authors & contributors

The original setup of this repository is by Franck Nijhof.

For a full list of all authors and contributors, check the contributor's page.

We have got some Home Assistant add-ons for you

Want some more functionality to your Home Assistant instance?

We have created multiple add-ons for Home Assistant. For a full list, check out our GitHub Repository.

License

MIT License

Copyright (c) 2018-2024 Franck Nijhof

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

addon-jupyterlab's People

Contributors

balloob avatar bonanitech avatar dependabot[bot] avatar frenck avatar jmtatsch avatar marciogranzotto avatar renovate[bot] avatar tjorim avatar wrt54g avatar xanderificnl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

addon-jupyterlab's Issues

Web UI is not exposed

Problem/Motivation

Cannot access the application

Expected behavior

Install the application. Ensure it has started correctly.
Click "Open Web UI"
Expect to see the web UI inside the Home Assistant UI

Actual behavior

Get opened a new window/tab with https://my-home-assistant-domain.example.com:7777 (example domain). Obviously I have not yet opened that port and I do not intend to open that port to the world.

Attempt to access hassio.local:7777, but receive a HTTP Basic Auth prompt, but no instructions are given for the username/password.

Steps to reproduce

Follow the instructions in the README for this repository

github_access_token: '!secret github_token'
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
system_packages: []
init_commands: []

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.


Warning

Renovate failed to look up the following dependencies: Failed to look up repology package debian_12/build-essential, Failed to look up repology package debian_12/dirmngr, Failed to look up repology package debian_12/gpg-agent, Failed to look up repology package debian_12/gpg, Failed to look up repology package debian_12/libfreetype6-dev, Failed to look up repology package debian_12/libfreetype6, Failed to look up repology package debian_12/libpq-dev, Failed to look up repology package debian_12/libpq5, Failed to look up repology package debian_12/libssl-dev, Failed to look up repology package debian_12/libtiff5-dev, Failed to look up repology package debian_12/zlib1g-dev.

Files affected: jupyterlab/Dockerfile


This repository currently has no open or pending branches.

Detected dependencies

dockerfile
jupyterlab/Dockerfile
  • ghcr.io/hassio-addons/debian-base 7.3.3
github-actions
.github/workflows/ci.yaml
.github/workflows/deploy.yaml
.github/workflows/labels.yaml
.github/workflows/lock.yaml
.github/workflows/pr-labels.yaml
.github/workflows/release-drafter.yaml
.github/workflows/stale.yaml
pip_requirements
jupyterlab/requirements.txt
  • beautifulsoup4 ==4.12.3
  • bokeh ==3.4.1
  • geopy ==2.4.1
  • HASS-data-detective ==3.0
  • influxdb ==5.3.2
  • ipywidgets ==8.1.2
  • jupyter_bokeh ==4.0.4
  • jupyterlab_widgets ==3.0.10
  • jupyterlab ==4.1.8
  • matplotlib ==3.8.4
  • mysqlclient ==2.2.4
  • nbconvert ==7.16.4
  • numpy ==1.26.4
  • pandas-datareader ==0.10.0
  • pandas ==2.2.2
  • psycopg2 ==2.9.9
  • python-dateutil ==2.9.0.post0
  • scrapy ==2.11.1
  • seaborn ==0.13.2
  • SQLAlchemy ==2.0.29
regex
jupyterlab/Dockerfile
  • ghcr.io/hassio-addons/debian-base 7.3.3
jupyterlab/build.yaml
  • ghcr.io/hassio-addons/debian-base 7.3.3
  • ghcr.io/hassio-addons/debian-base 7.3.3
jupyterlab/Dockerfile
  • debian_12/build-essential 12.9
  • debian_12/dirmngr 2.2.40-1.1
  • debian_12/git 1:2.39.2-1.1
  • debian_12/gpg-agent 2.2.40-1.1
  • debian_12/gpg 2.2.40-1.1
  • debian_12/libffi-dev 3.4.4-1
  • debian_12/libffi8 3.4.4-1
  • debian_12/libfreetype6-dev 2.12.1+dfsg-5
  • debian_12/libfreetype6 2.12.1+dfsg-5
  • debian_12/libjpeg62-turbo-dev 1:2.1.5-2
  • debian_12/libjpeg62-turbo 1:2.1.5-2
  • debian_12/libmariadb-dev 1:10.11.6-0+deb12u1
  • debian_12/libmariadb3 1:10.11.6-0+deb12u1
  • debian_12/libnginx-mod-http-lua 1:0.10.23-1
  • debian_12/libpng-dev 1.6.39-2
  • debian_12/libpng16-16 1.6.39-2
  • debian_12/libpq-dev 15.5-0+deb12u1
  • debian_12/libpq5 15.5-0+deb12u1
  • debian_12/libssl-dev 3.0.11-1~deb12u2
  • debian_12/libtiff5-dev 4.5.0-6+deb12u1
  • debian_12/libxml2-dev 2.9.14+dfsg-1.3~deb12u1
  • debian_12/libxml2 2.9.14+dfsg-1.3~deb12u1
  • debian_12/libxslt1-dev 1.1.35-1
  • debian_12/libzmq3-dev 4.3.4-6
  • debian_12/libzmq5 4.3.4-6
  • debian_12/nginx 1.22.1-9
  • debian_12/pandoc 2.17.1.1-2~deb12u1
  • debian_12/pkg-config 1.8.1-1
  • debian_12/python3-dev 3.11.2-1+b1
  • debian_12/python3-distutils 3.11.2-3
  • debian_12/python3-minimal 3.11.2-1+b1
  • debian_12/zlib1g-dev 1:1.2.13.dfsg-1
  • debian_12/nodejs 20.6.1-1nodesource1

  • Check this box to trigger a request for Renovate to run again on this repository

Starting NGinx... nginx: [alert] could not open error log file

Hello - would appreciate a view on these logs. Add on won't start. Thanks!


[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: JupyterLab
 Create documents containing live code, equations, visualizations, and explanatory text
-----------------------------------------------------------
 Add-on version: 0.6.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 6.6  (amd64 / generic-x86-64)
 Home Assistant Core: 2021.11.4
 Home Assistant Supervisor: 2021.10.8
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] jupyter.sh: executing... 
[cont-init.d] jupyter.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] notebooks.sh: executing... 
Cloning into '/config/notebooks/home-assistant'...
Cloning into '/config/notebooks/bokeh-examples'...
[cont-init.d] notebooks.sh: exited 0.
[cont-init.d] system-packages.sh: executing... 
[cont-init.d] system-packages.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:53:32] INFO: Starting the Jupyter server...
[I 2021-11-20 19:53:38.602 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-11-20 19:53:38.606 NotebookApp] 'allow_origin' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'allow_password_change' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'allow_remote_access' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'allow_root' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'base_url' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'notebook_dir' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.606 NotebookApp] 'password' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.607 NotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.607 NotebookApp] 'token' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.607 NotebookApp] 'tornado_settings' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.607 NotebookApp] 'trust_xheaders' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-11-20 19:53:38.615 ServerApp] notebook_dir is deprecated, use root_dir
[I 2021-11-20 19:53:38.617 ServerApp] Writing Jupyter server cookie secret to /root/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2021-11-20 19:53:40.479 ServerApp] nbclassic | extension was successfully linked.
[W 2021-11-20 19:53:40.675 ServerApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 2021-11-20 19:53:40.745 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-11-20 19:53:40.749 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.9/dist-packages/jupyterlab
[I 2021-11-20 19:53:40.749 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2021-11-20 19:53:40.761 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-11-20 19:53:40.762 ServerApp] Serving notebooks from local directory: /config/notebooks
[I 2021-11-20 19:53:40.762 ServerApp] Jupyter Server 1.11.2 is running at:
[I 2021-11-20 19:53:40.762 ServerApp] http://127.0.0.1:28459/api/hassio_ingress/9ZV-X-mo6qejZaD6GzHAeeqsEE46ar5FLb5oa-TAA-U/lab
[I 2021-11-20 19:53:40.762 ServerApp]  or http://127.0.0.1:28459/api/hassio_ingress/9ZV-X-mo6qejZaD6GzHAeeqsEE46ar5FLb5oa-TAA-U/lab
[I 2021-11-20 19:53:40.763 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2021-11-20 19:53:40.768 ServerApp] No web browser found: could not locate runnable browser.
[19:53:41] INFO: Starting NGinx...
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Update dosn't work

Problem/Motivation

Message from jupyterlab addon:
You are running Home Assistant 2021.2.2, to install this add-on you need at least version of Home Assistant

Expected behavior

In the newest version of Home Assistant the update to jupyterlab 0.4 should possible.

Actual behavior

Update not possible

Steps to reproduce

Update available! ๐ŸŽ‰

JupyterLab Lite 0.4.0 is available
You are currently running version 0.3.1

You are running Home Assistant 2021.2.2, to update to this version of the add-on you need at least version of Home Assistant

Getting Started Notebook fails on first run

Problem/Motivation

After completing a fresh install of the plugin, I tried using the getting-started notebook. It failed on step 3 of the notebook:

import detective.core as detective
import detective.functions as functions
import pandas as pd
โ€‹
db = detective.db_from_hass_config()
YAML tag !include_dir_merge_named is not supported
Successfully connected to database sqlite:////config/home-assistant_v2.db
Error with query:
SELECT DISTINCT(entity_id) FROM states

'Engine' object has no attribute 'execute'

AttributeError Traceback (most recent call last)
Cell In[3], line 5
2 import detective.functions as functions
3 import pandas as pd
----> 5 db = detective.db_from_hass_config()

File /usr/local/lib/python3.9/dist-packages/detective/core.py:19, in db_from_hass_config(path, **kwargs)
16 path = config.find_hass_config()
18 url = config.db_url_from_hass_config(path)
---> 19 return HassDatabase(url, **kwargs)

File /usr/local/lib/python3.9/dist-packages/detective/core.py:57, in HassDatabase.init(self, url, fetch_entities)
55 print("Successfully connected to database", stripped_db_url(url))
56 if fetch_entities:
---> 57 self.fetch_entities()
58 except Exception as exc:
59 if isinstance(exc, ImportError):

File /usr/local/lib/python3.9/dist-packages/detective/core.py:85, in HassDatabase.fetch_entities(self)
79 """Fetch entities for which we have data."""
80 query = text(
81 """
82 SELECT DISTINCT(entity_id) FROM states
83 """
84 )
---> 85 response = self.perform_query(query)
87 # Parse the domains from the entities.
88 self.entities = [e[0] for e in response]

File /usr/local/lib/python3.9/dist-packages/detective/core.py:73, in HassDatabase.perform_query(self, query, **params)
71 """Perform a query."""
72 try:
---> 73 return self.engine.execute(query, params)
74 except:
75 print(f"Error with query: {query}")

AttributeError: 'Engine' object has no attribute 'execute'

Support of jupyter scheduler

Problem/Motivation

Schedule a job for frequent repetition of a prediction function located inside a notebook.

Expected behavior

"pip install jupyter_scheduler" runs through installation process and extension is usable in Jupiter lab add-on.

Actual behavior

Installation routin stops with the following error:

  Failed to build psutil
  copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-cpython-311/psutil/tests
  warning: build_py: byte-compiling is disabled, skipping.
  
  running build_ext
  building 'psutil._psutil_linux' extension
  creating build/temp.linux-aarch64-cpython-311
  creating build/temp.linux-aarch64-cpython-311/psutil
  aarch64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=595 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/usr/include/python3.11 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_common.o
  psutil could not be installed from sources because gcc is not installed. Try running:
    sudo apt-get install gcc python3-dev
  error: command 'aarch64-linux-gnu-gcc' failed: No such file or directory
  [end of output]

Steps to reproduce

Placed pip install command in the configuration part of the add-on. Restart the add-on.


Version
Add-on: JupyterLab
 Create documents containing live code, equations, visualizations, and explanatory text
-----------------------------------------------------------
 Add-on version: 0.12.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2023.9.2
 Home Assistant Supervisor: 2023.09.2

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Could not resolve host: github.com

Problem/Motivation

Jupyterlab Update => Error

Actual behavior

Jupyterlab addon stops with this error after update:
fatal: unable to access 'https://github.com/home-assistant/home-assistant-notebooks.git/': Could not resolve host: github.com

Steps to reproduce

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...


Hass.io Add-on: JupyterLab Lite
Create documents containing live code, equations, visualizations, and explanatory text.

Add-on version: 0.2.0
You are running the latest version of this add-on.
System: Raspbian GNU/Linux 9 (stretch) (armv7 / raspberrypi3)
Home Assistant version: 0.90.2
Supervisor version: 150

Please, share the above information when looking for help
or support in e.g, GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing...
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-nginx.sh: executing...
[cont-init.d] 11-nginx.sh: exited 0.
[cont-init.d] 20-notebooks-dir.sh: executing...
fatal: unable to access 'https://github.com/home-assistant/home-assistant-notebooks.git/': Could not resolve host: github.com
[cont-init.d] 20-notebooks-dir.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

Proposed changes

  • Restart
  • Reinstallation
GitHub
๐Ÿ““ Sample Jupyter Notebooks to explore Home Assistant data - home-assistant/home-assistant-notebooks
GitHub
๐Ÿ““ Sample Jupyter Notebooks to explore Home Assistant data - home-assistant/home-assistant-notebooks

502 error in 0.8.2

Problem/Motivation

Web interface does not open; same problem as with 0.8.1

Tried:

  • clear browser cache
  • use different browser (tested Chrome and Safari)
  • restart Home Assistant
  • reboot Home Assistant Server completely

no result

add influxdb_client

Problem/Motivation

For better efficiency, it's expedient to save long HA history to a time series database such as InfluxDB (which HA supports). To access this data from the jupyterlab add-on, the Python library influxdb_client is needed.

Presently it's not included in the docker build. Unfortunately installing it from a Notebook is not possible since one of the dependencies requires gcc (x86_64-linux-gnu-gcc on my installation), which is not available in the add-on.

Expected behavior

import influxdb_client in Notebook works.

Proposed changes

add influxdb_client to list of libraries in Dockerfile.

Problem with View States section in Getting Started : 'HassDatabase' object has no attribute 'fetch_all_data'

Problem/Motivation

I've run the addon up against HA 2021.2.3 and which also uses the mariadb addon. The initial connection works fine and displays

There are 188 entities with data

The Popular enties works fine as does next up, but View States shows:

db.fetch_all_data()

AttributeError Traceback (most recent call last)
in

AttributeError: 'HassDatabase' object has no attribute 'fetch_all_data'

Expected behavior

The statement should return all the data from the mariab DB.

Actual behavior

db.fetch_all_data()

AttributeError Traceback (most recent call last)
in

AttributeError: 'HassDatabase' object has no attribute 'fetch_all_data'

Steps to reproduce

Install hassos 2012.1.3
Install and configure add on mariadb
Install jupyterlab addon, configure token and run add on

Proposed changes

502 error in version 0.8.2

Problem/Motivation

Can't open the web UI.

Expected behavior

Opens web UI

Actual behavior

Gives a 502 error (somewhat like #322, but this was supposedly addressed in v0.8.2)

Steps to reproduce

Start the add-on (v0.8.2). Try to open web UI from add-on info tab.
I had it installed at previous version that did not work, but I also tried uninstalling and reinstalling v0.8.2. No change in behavior.

Logs

[I 2022-09-15 21:02:50.579 ServerApp] Jupyter Server 1.18.1 is running at:
[I 2022-09-15 21:02:50.579 ServerApp] http://localhost:8888/lab?token=REDACTED
[I 2022-09-15 21:02:50.579 ServerApp]  or http://127.0.0.1:8888/lab?token=REDACTED
[I 2022-09-15 21:02:50.580 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2022-09-15 21:02:50.587 ServerApp] No web browser found: could not locate runnable browser.
[C 2022-09-15 21:02:50.587 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/jpserver-237-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=REDACTED
     or http://127.0.0.1:8888/lab?token=REDACTED
[21:03:45] INFO: Starting NGinx...
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Option: password

I was a bit confused by this, default auth is with our HA credentials, but this would over-ride that?

Python Kernel Websocket: 401 Error when using Safari Browser

<Reopening #34, updated versions>

Hi,

When using Apple Safari 12.1.2 as Browser:
In Jupyterlab Lite, running the GETTING STARTED.ipynb unfortunately does not produce any Output.
The small indicator circle next to "Python 3" Kernel name is grey and says in the tooltip "Kernel Reconnecting".

Running a JavaScript Console in Safari gives me the following error:

[Error] WebSocket connection to 'ws://hassio.local:7777/api/kernels/4c7bdd3f-248e-4a44-b2b8-2955a2439ba5/channels?session_id=16242f9a-e2c6-480d-bbd1-287ee128c5fd' failed: Unexpected response code: 401
The same test in Google Chrome works just fine and does not produce any errors in JavaScript Console

I suspect this to be an issue related to this add-on, as Safari is officially supported by JupyterLab.

Steps to reproduce:

Use Apple Safari 12.1.2 as Browser
Install jupyterlab-lite addon with default config (Port: 7777) on HASS.io 0.98.5.
Run "GETTING STARTED.ipynb" Notebook
Observe output/JavaScript Console

Feature request - add jupyterlab-sql addon

Problem/Motivation

The jupyterlab-sql addon allows easy browsing of database tables, and includes a tool for perfoming sql queries. This is a nice complement to the data detective package and provides a simple way to get started exploring the db via a UI.

image

Cannot get the pyscript kernal to load properly

Problem/Motivation

I cannot seem to get the pyscript kernal to load properly through the JupyterLab add-on

Expected behavior

I would expect to be able to place or install additional kernals for testing within the jupyterlabs UI or interface

Actual behavior

The kernal doesn't connect or stay connected, removes itself

Steps to reproduce

Raspi4 Home Assistant OS install

HACS install < If this disqualifies any help/support for this addon just let me know. I figured this was kind of a grey area in that regard

Installed pyscript via HACS

Installed JupyterLab via HA addons

In the terminal for JupyterLabs ran "pip install hass_pyscript_kernel" and "jupyter pyscript install" install goes okay.

At this point though I'm unsure how or where to go to modify the /usr/.../pyscript.conf file. It doesn't seem to show up in the HA file structure. I am suspect that it is within the jupyterlab docker env itself, this might be the crux of the whole problem because I don't know how to get into that env and modify that setting.

Proposed changes

UI option to add additional kernals?

Bokeh stopped to work

Problem/Motivation

(Bokeh stopped to work not showing graph after upgrade addon)

Expected behavior

(Working as before :)

Actual behavior (from firefiox console)

([bokeh] JS/Python version mismatch bokeh-2.4.3.min.js:165:8622
[bokeh] Library versions: JS (2.4.3) / Python (3.0.1) bokeh-2.4.3.min.js:165:8666
Uncaught TypeError: e is undefined
_instantiate_references_json https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js:165
from_json https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js:165
embed_items_notebook https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js:591
embed_document http://192.168.1.40:8123/api/hassio_ingress/OwQDFLvr-3r2IbEID1gcA9rjc8uQbca0ZYosQs6ZlUA/lab? line 1 > injectedScript:5
http://192.168.1.40:8123/api/hassio_ingress/OwQDFLvr-3r2IbEID1gcA9rjc8uQbca0ZYosQs6ZlUA/lab? line 1 > injectedScript:8
http://192.168.1.40:8123/api/hassio_ingress/OwQDFLvr-3r2IbEID1gcA9rjc8uQbca0ZYosQs6ZlUA/lab? line 1 > injectedScript:24
renderModel http://192.168.1.40:8123/api/hassio_ingress/OwQDFLvr-3r2IbEID1gcA9rjc8uQbca0ZYosQs6ZlUA/lab/extensions/@bokeh/jupyter_bokeh/static/809.5a8907e446c57e3738b7.js?v=5a8907e446c57e3738b7:1
bokeh-2.4.3.min.js:165:5047
Erreur dans les liens source : Error: request failed with status 404
URL de la ressource : http://192.168.1.40:8123/api/hassio_ingress/OwQDFLvr-3r2IbEID1gcA9rjc8uQbca0ZYosQs6ZlUA/static/lab/jlab_core.e37d4bbc8c984154bc26.js?v=e37d4bbc8c984154bc26
URL du lien source : jlab_core.e37d4bbc8c984154bc26.js.map?v=e37d4bbc8c984154bc26)

Add-on does not start, missing nginx log

Attepting to resume this issue: #304

It was locked due to stale, but I'm having the same issue:

Home Assistant 2022.9.5
Supervisor 2022.09.1
Operating System 9.0
Frontend 20220907.2 - latest

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: JupyterLab
 Create documents containing live code, equations, visualizations, and explanatory text
-----------------------------------------------------------
 Add-on version: 0.9.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.0  (amd64 / generic-x86-64)
 Home Assistant Core: 2022.9.5
 Home Assistant Supervisor: 2022.09.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/02-set-timezone.sh
[09:55:52] INFO: Configuring timezone
cont-init: info: /etc/cont-init.d/02-set-timezone.sh exited 0
cont-init: info: running /etc/cont-init.d/jupyter.sh
cont-init: info: /etc/cont-init.d/jupyter.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: info: running /etc/cont-init.d/notebooks.sh
Cloning into '/config/notebooks/home-assistant'...
Cloning into '/config/notebooks/bokeh-examples'...
cont-init: info: /etc/cont-init.d/notebooks.sh exited 0
cont-init: info: running /etc/cont-init.d/system-packages.sh
cont-init: info: /etc/cont-init.d/system-packages.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun jupyter (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[09:55:57] INFO: Starting the Jupyter server...
[I 2022-09-23 09:56:01.739 ServerApp] jupyterlab | extension was successfully linked.
[I 2022-09-23 09:56:01.768 ServerApp] nbclassic | extension was successfully linked.
[I 2022-09-23 09:56:01.771 ServerApp] Writing Jupyter server cookie secret to /root/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2022-09-23 09:56:03.612 ServerApp] notebook_shim | extension was successfully linked.
[W 2022-09-23 09:56:03.717 ServerApp] All authentication is disabled.  Anyone who can connect to this server will be able to run code.
[I 2022-09-23 09:56:03.723 ServerApp] notebook_shim | extension was successfully loaded.
[I 2022-09-23 09:56:03.726 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.9/dist-packages/jupyterlab
[I 2022-09-23 09:56:03.726 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2022-09-23 09:56:03.740 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-09-23 09:56:03.757 ServerApp] nbclassic | extension was successfully loaded.
[I 2022-09-23 09:56:03.758 ServerApp] Serving notebooks from local directory: /config/notebooks
[I 2022-09-23 09:56:03.758 ServerApp] Jupyter Server 1.18.1 is running at:
[I 2022-09-23 09:56:03.758 ServerApp] http://127.0.0.1:28459/api/hassio_ingress/tU4LxW1prpEn4FZ0PQgcNK-SKlrkzH3xfIKonyFJPzA/lab
[I 2022-09-23 09:56:03.758 ServerApp]  or http://127.0.0.1:28459/api/hassio_ingress/tU4LxW1prpEn4FZ0PQgcNK-SKlrkzH3xfIKonyFJPzA/lab
[I 2022-09-23 09:56:03.758 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[09:56:03] INFO: Starting NGinx...
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Release new version

Problem/Motivation

The last release 0.3.1 is more than a year old and uses Python 3.6

@frenck, could you release a new version?

Example "GETTING STARTED.ipynb" is broken

Problem/Motivation

Since the update to SQLAlchemy 2.0 the GETTING STARTED tutorial/example stopped working

Expected behavior

The example (and database query) should execute to show the reader how Jupyter might work

Actual behavior

Running all cells results in an error (ObjectNotExecutableError Traceback (most recent call last) Cell In[12], line 13)

Steps to reproduce

Just run the the code as told in the example

Proposed changes

It seems that 'raw strings' are not permitted anymore in SQLAlchemy 2.0, the add-on has recently been updated so this example doesn't work anymore. Using the sqlalchemy text function (per example https://stackoverflow.com/questions/69490450/objectnotexecutableerror-when-executing-any-sql-query-using-asyncengine) solves the issue for me:

for event in db.perform_query(text("SELECT * FROM events WHERE event_type = 'call_service' ORDER BY time_fired")):

Cannot load db

Problem/Motivation

I am unable to import from my Hass database.

Expected behavior

To load my db.

Actual behavior

I get a FileNotFoundError because it is looking for a folder that doesn't exist. For example, I have my groups.yaml file in /config/structure/groups.yaml but the FileNotFoundError says "No such file or directory: /config/structure/structure/groups.yaml"

No idea how to replicate it, but you can take a look at my instance here: https://github.com/kflinderman/Hassio

GitHub
My Hassio Instance. Contribute to kflinderman/Hassio development by creating an account on GitHub.

Cannot start add-on

Hello, any thoughts on the logs below please? First time install on a NUC running HassOS. Thanks!


s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: JupyterLab
 Create documents containing live code, equations, visualizations, and explanatory text
-----------------------------------------------------------
 Add-on version: 0.6.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 6.6  (amd64 / generic-x86-64)
 Home Assistant Core: 2021.10.6
 Home Assistant Supervisor: 2021.10.8
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] jupyter.sh: executing... 
[cont-init.d] jupyter.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] notebooks.sh: executing... 
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[cont-init.d] notebooks.sh: exited 128.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Bump python version?

Problem/Motivation

I note this addon is on python3-dev=3.6.7. Perhaps we can bump to > 3.7 to be consistent with HA?

question : who can i contact for the notebook examples?

Problem/Motivation

i cant make any of the examples to work, all of them ends in some errors , related to missing components , or also i suspect related to recent changes on hassio , or and different methods to access different database ( not the default) .
thanks

(Why the issue was filed)

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Can't login with HASS username/password

Problem/Motivation

After installing, I can't login with my normal HASS username and password.
The account was not system generated, but added by me. Is that a problem.
Also I don't get any error message, but the login mask pops up again and again.

Steps to reproduce

  • Fresh install of jupyterlab add-on
  • Open WebUI
  • Enter username/password from HASS
  • Login mask pops up again and again...

Installation is failing

Problem/Motivation

The installation of the addon is failing.

Actual behavior

When installing this addon I get the error as shown below.
Github.com is resolvable however. I can also see that the addon makes the directories and downloads a .git folder and adds files in there. But after some seconds it stops and throws that error.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: JupyterLab Lite v0.1.0

 Create documents containing live code, equations, visualizations, and explanatory text.

 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 amd64 / Ubuntu 18.04.1 LTS / HA 0.84.6 / SU 141 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-nginx.sh: executing... 
[cont-init.d] 11-nginx.sh: exited 0.
[cont-init.d] 20-notebooks-dir.sh: executing... 
Cloning into '/config/notebooks/home-assistant'...
fatal: unable to access 'https://github.com/home-assistant/home-assistant-notebooks.git/': Could not resolve host: github.com
FATAL: Failed installing Home Assistant example notebooks
[cont-init.d] 20-notebooks-dir.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

I have installed the addon on two different HA instances, which are on different hardware, both on Ubuntu 18.04.
Both machine definitely have access to Internet (github.com is pingable).

I have restarted the addon multiple times, behaviour stays the same. I had to delete the notebook folder though, otherwise the addon doesn't download the files from Github.

[cont-init.d] 20-notebooks-dir.sh: executing... 
fatal: cannot change to '/config/notebooks//home-assistant': No such file or directory
fatal: cannot change to '/config/notebooks/home-assistant': No such file or directory

Add Ingress support

Problem/Motivation

This addon is great for data analysis, however, frequently I am not at home so I would need to forward ports in order to get into this add-on and then authenticate.

Expected behavior

I think it would be much nicer if Ingress was supported and the authentication screen was removed. This would improve the overall UX.

Add mysqlclient to requirements

Problem/Motivation

Our jupyerlab-lite add-on should contain the same DB connectors as Hass.io, to ensure that we support all possible DB recorder urls that we can encounter in the config.

This is what Hass.io does for their container:

image

Expected behavior

Same DB support packages as Hass.io contains in the container

Actual behavior

We use PyMySQL instead of mysql client.

https://github.com/hassio-addons/addon-jupyterlab-lite/blob/e55ac7e4ffb2f8f2d575571fea43374614697947/jupyterlab/requirements.txt#L15

Steps to reproduce

use db recorder url starting with mysql://

Proposed changes

Replace PyMySQL with mysqlclient

init-notebooks fails (and prevents add-on from starting)

Problem/Motivation

init-notebooks fails (and prevents add-on from starting at all)
the notebooks directory already exists

Expected behavior

add-on to run

Actual behavior

add on starts loading, but the init-notebooks fails and this causes the add-on to shut down completely with error

fatal: update_ref failed for ref 'ORIG_HEAD': cannot lock ref 'ORIG_HEAD': unable to resolve reference 'ORIG_HEAD': reference broken
s6-rc: warning: unable to start service init-notebooks: command exited 128

Error occurs at line

if [ -z "$(git -C ${BOOKS}/home-assistant status --untracked-files=no --porcelain)" ];

Steps to reproduce

I had first run the add-on 12/12 and it ran then. I played with it a bit but I didn't really use it much prior to noticing that it wasn't running today. I 'm on 0.9.3 now so assume that the update broke something.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

I've just commented out the init-notebooks startup script for now so that the addon can run.

Addon doesn't start.

Problem/Motivation

The addon will not run.

Expected behavior

I expect to be able to navigate to the web page and use the application.

Actual behavior

Addon will not run, here are the logs.

Log
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...


Hass.io Add-on: JupyterLab Lite v0.1.0

Create documents containing live code, equations, visualizations, and explanatory text.

From: Community Hass.io Add-ons
By: Franck Nijhof [email protected]

amd64 / Ubuntu 18.04.1 LTS / HA 0.84.6 / SU 141 / stable

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing...

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing...
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-nginx.sh: executing...
[cont-init.d] 11-nginx.sh: exited 0.
[cont-init.d] 20-notebooks-dir.sh: executing...
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
[cont-init.d] 20-notebooks-dir.sh: exited 128.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing...

            Oops! Something went wrong.

We are so sorry, but something went terribly wrong when
starting or running this add-on.

Be sure to check the log above, line by line, for hints.

[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

Steps to reproduce

Not really sure, I just tried installing it then uninstalling and reinstalling the add on.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Add isn't starting after update: Running as root is not recommended

Hi there,

After the last update yesterday, my jupyterlab addon is unable to start.

Here is a short part of the log:

[15:43:01] INFO: Starting the Jupyter server...
[I 2022-08-22 15:43:12.807 ServerApp] jupyterlab | extension was successfully linked.
[I 2022-08-22 15:43:12.850 ServerApp] nbclassic | extension was successfully linked.
[I 2022-08-22 15:43:17.985 ServerApp] notebook_shim | extension was successfully linked.
[I 2022-08-22 15:43:18.166 ServerApp] notebook_shim | extension was successfully loaded.
[I 2022-08-22 15:43:18.182 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.9/dist-packages/jupyterlab
[I 2022-08-22 15:43:18.182 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[I 2022-08-22 15:43:18.190 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-08-22 15:43:18.221 ServerApp] nbclassic | extension was successfully loaded.
[C 2022-08-22 15:43:18.223 ServerApp] Running as root is not recommended. Use --allow-root to bypass.
[15:43:18] WARNING: Jupyter crashed, halting add-on
[15:43:18] INFO: Jupyter stopped, restarting...
s6-rc: info: service legacy-services: stopping
[15:43:19] INFO: NGINX stopped, restarting...
s6-svwait: fatal: supervisor died
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
[15:43:19] INFO: Jupyter stopped, restarting...
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I've tried adding --allow-root to the init_commands but this dosn't work.
Any other ideas?

br
Andy

Error 502 when opening web-interface

Problem/Motivation

Did use the addon for about 12 months, but it was lost after an update.

Actual behavior

with any click on "open web interface" I get an error 502.

Steps to reproduce

Cleared cache - no change
Delete - new install - no change

I think, there is nothing that one can do wrong by using the addon-installation?
Just install and start. there is no config needed to get the addon startet.

So seems to be a real bug?

JupyterLab Lite in Supervisor not updating to 0.5.0

Problem/Motivation

HASSIO supervisor shows the following message (I'm using a Raspberry PI3B):

Update pending๐ŸŽ‰
JupyterLab Lite 0.5.0 is available
You are currently running version 0.3.1
This add-on is not compatible with the processor of your device or the operating system you have installed on your device.
I'd like to updated to the latest version 0.5.0

Expected behavior

Being able to update. No error message regarding operating system

Actual behavior

Update not possible.

Steps to reproduce

Maybe use a Raspberry PI3B ?

Proposed changes

Connecting to an external PostgreSQL database

Problem/Motivation

Connecting to an external PostgreSQL database server causes issues.

Expected behavior

Being able to connect and use data stored in a PostgreSQL database server.

Actual behavior

The following error message pops up:

ModuleNotFoundError: No module named 'psycopg2'

Steps to reproduce

(not provided)

Proposed changes

Add the psycopg2 package to the add-on.

Ref

robmarkcole/HASS-data-detective#50

Service NGINX exited with code 256 (by signal 15)

s6-rc: info: service init-system-packages successfully started
s6-rc: info: service jupyter: starting
s6-rc: info: service jupyter successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
prog: fatal: stopping the container.
s6-rc: info: service nginx: stopping
[13:00:06] INFO: Starting the Jupyter server...
[13:00:06] INFO: Service NGINX exited with code 256 (by signal 15)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service jupyter: stopping
s6-rc: info: service init-nginx successfully stopped
[13:00:06] INFO: Service JupyterLab exited with code 256 (by signal 15)
s6-rc: info: service jupyter successfully stopped
s6-rc: info: service init-system-packages: stopping
s6-rc: info: service init-jupyter: stopping
s6-rc: info: service init-system-packages successfully stopped
s6-rc: info: service init-jupyter successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

How to install pixiedust and pixiedust_node

Problem/Motivation

I'm trying to run node.js scripts inside jupyter's docker in home assistant

Expected behavior

Being able to use pixeldust and pixeldust_node inside of home assistant jupyter addon.

Actual behavior

failed to install
image

Steps to reproduce

I tried running pip install pixiedust_node in the terminal but wasn't able to install it.
Also, tried adding both packages in the system_packages option, but got an error on fetching them there as well

system_packages:
  - pixiedust
  - pixiedust_node

Proposed changes

Either install packages automatically inside the docker container (it probably doesn't use the global python in hassio anyway),
or add documentation on how to add addons to jupyter

!include_dir_named is not supported

Once installed, getting the following error when running a sample notebook:

!include_dir_named is not supported

I'm using in my split configuration packages that configured as following:

packages: !include_dir_named ../packages

Feature Request : add support for fbprophet

Problem/Motivation

Time series forecasting with Facebook Prophet fbprophet
https://facebook.github.io/prophet/docs/quick_start.html#python-api

Expected behavior

fbprophet installation using init_command configuration

{
  "log_level": "info",
  "github_access_token": "",
  "ssl": false,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "system_packages": [],
  "init_commands": [
    "pip install fbprophet"
  ]
}

Actual behavior

 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / Raspbian GNU/Linux 9 (stretch) / HA 0.87.0 / SU 143 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 11-nginx.sh: executing... 
[cont-init.d] 11-nginx.sh: exited 0.
[cont-init.d] 20-notebooks-dir.sh: executing... 
WARNING: Not updating Home Assistant notebook!
WARNING: You have made local changes, which we will not overwrite.
WARNING: Not updating Bokeh examples notebook!
WARNING: You have made local changes, which we will not overwrite.
[cont-init.d] 20-notebooks-dir.sh: exited 0.
[cont-init.d] 21-persistent-storage.sh: executing... 
[cont-init.d] 21-persistent-storage.sh: exited 0.
[cont-init.d] 51-github.sh: executing... 
[cont-init.d] 51-github.sh: exited 0.
[cont-init.d] 80-system-packages.sh: executing... 
[cont-init.d] 80-system-packages.sh: exited 0.
[cont-init.d] 81-user-scripts.sh: executing... 
Collecting fbprophet
  Downloading https://files.pythonhosted.org/packages/9b/a1/fef4ce00acbc28e75c0d33f60c9777527c4295656903b00ac4c9525cef7f/fbprophet-0.4.post2.tar.gz (45kB)
Collecting Cython>=0.22 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/e0/31/4a166556f92c469d8291d4b03a187f325c773c330fffc1e798bf83d947f2/Cython-0.29.5.tar.gz (2.0MB)
Collecting pystan>=2.14 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/96/21/6452aadcbb5807fb8858e8789c74d62f5ebaece0351ff231f44064c44b33/pystan-2.18.1.0.tar.gz (17.5MB)
Requirement already satisfied: numpy>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from fbprophet) (1.15.4)
Requirement already satisfied: pandas>=0.20.1 in /usr/local/lib/python3.6/dist-packages (from fbprophet) (0.23.4)
Requirement already satisfied: matplotlib>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from fbprophet) (3.0.2)
Collecting lunardate>=0.1.5 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/4e/7e/377a3cbba646ec0cf79433ef858881d809a3b87eb887b0901cb83c66a758/lunardate-0.2.0-py3-none-any.whl
Collecting convertdate>=2.1.2 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/74/83/d0fa07078f4d4ae473a89d7d521aafc66d82641ea0af0ef04a47052e8f17/convertdate-2.1.3-py2.py3-none-any.whl
Collecting holidays>=0.9.5 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/40/b0/3dfe3d3ed79087848a22de46d379462e371517571ee64668791f3d49ea29/holidays-0.9.9.tar.gz (68kB)
Collecting setuptools-git>=1.2 (from fbprophet)
  Downloading https://files.pythonhosted.org/packages/05/97/dd99fa9c0d9627a7b3c103a00f1566d8193aca8d473884ed258cca82b06f/setuptools_git-1.2-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil>=2.5.0 in /usr/local/lib/python3.6/dist-packages (from pandas>=0.20.1->fbprophet) (2.7.5)
Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.6/dist-packages (from pandas>=0.20.1->fbprophet) (2018.7)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib>=2.0.0->fbprophet) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib>=2.0.0->fbprophet) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib>=2.0.0->fbprophet) (2.3.0)
Collecting ephem<3.8,>=3.7.5.3 (from convertdate>=2.1.2->fbprophet)
  Downloading https://files.pythonhosted.org/packages/c3/2c/9e1a815add6c222a0d4bf7c644e095471a934a39bc90c201f9550a8f7f14/ephem-3.7.6.0.tar.gz (739kB)
Requirement already satisfied: six in /usr/local/lib/python3.6/dist-packages (from holidays>=0.9.5->fbprophet) (1.12.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->fbprophet) (40.6.3)
Building wheels for collected packages: fbprophet, Cython, pystan, holidays, ephem
  Running setup.py bdist_wheel for fbprophet: started
  Running setup.py bdist_wheel for fbprophet: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hh6l25_i/fbprophet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-bk2slxf9 --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/fbprophet
  creating build/lib/fbprophet/stan_model
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-hh6l25_i/fbprophet/setup.py", line 120, in <module>
      """
    File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 143, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/dist-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-hh6l25_i/fbprophet/setup.py", line 44, in run
      build_stan_model(target_dir)
    File "/tmp/pip-install-hh6l25_i/fbprophet/setup.py", line 27, in build_stan_model
      from pystan import StanModel
  ModuleNotFoundError: No module named 'pystan'
  
  ----------------------------------------
  Failed building wheel for fbprophet
  Running setup.py clean for fbprophet

Steps to reproduce

Proposed changes

Python Kernel Websocket: 401 Error when using Safari Browser

Hi,

When using Apple Safari 12.0.3 as Browser:
In Jupyterlab Lite, running the GETTING STARTED.ipynb unfortunately does not produce any Output.
The small indicator circle next to "Python 3" Kernel name is grey and says in the tooltip "Kernel Reconnecting".

Running a JavaScript Console in Safari gives me the following error:

[Error] WebSocket connection to 'ws://hassio.local:7777/api/kernels/4c7bdd3f-248e-4a44-b2b8-2955a2439ba5/channels?session_id=16242f9a-e2c6-480d-bbd1-287ee128c5fd' failed: Unexpected response code: 401

The same test in Google Chrome works just fine and does not produce any errors in JavaScript Console

I suspect this to be an issue related to this add-on, as Safari is officially supported by JupyterLab.

Steps to reproduce:

  1. Use Apple Safari 12.0.3 as Browser
  2. Install jupyterlab-lite addon with default config (Port: 7777) on HASS.io 0.88.2.
  3. Run "GETTING STARTED.ipynb" Notebook
  4. Observe output/JavaScript Console

Error in GETTING_STARTED.ipynb

Problem/Motivation

After a fresh install example code GETTING_STARTED.ipynb fails

Actual behavior

Cell 3 
Database connects OK
Successfully connected to database sqlite:////config/home-assistant_v2.db
There are 932 entities with data
Example "Popular Entities" throws the following error
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [4], line 21
     18     continue
     20 try:
---> 21     event_data = json.loads(event.event_data)
     22 except ValueError:
     23     continue

File /usr/lib/python3.9/json/__init__.py:339, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    337 else:
    338     if not isinstance(s, (bytes, bytearray)):
--> 339         raise TypeError(f'the JSON object must be str, bytes or bytearray, '
    340                         f'not {s.__class__.__name__}')
    341     s = s.decode(detect_encoding(s), 'surrogatepass')
    343 if (cls is None and object_hook is None and
    344         parse_int is None and parse_float is None and
    345         parse_constant is None and object_pairs_hook is None and not kw):

TypeError: the JSON object must be str, bytes or bytearray, not NoneType

Steps to reproduce

Add-on: JupyterLab

Add-on version: 0.9.1
System: Home Assistant OS 9.3 (amd64 / qemux86-64)
Home Assistant Core: 2022.11.0
Home Assistant Supervisor: 2022.10.2

OOB home-assistant/GETTING_STARTED.ipynb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.