hassio-addons/addon-node-red

Improve restart time due to multiple manual NPM installs and corresponding audits #411

mbrackjr posted onGitHub

Problem/Motivation

Restart of Node-Red takes almost 2 minutes due to repeated auditing time when installing 4 custom NPMs

Expected behavior

Combine installation of all custom packages and run a single combined audit

Actual behavior

Every manually selected NPM package to be installed takes around 30 seconds, 4 totalling almost 2 minutes

Steps to reproduce

Select multiple NPM packages, reboot, watch log file to show that each takes its own install and audit cycle

Proposed changes

Install all NPM packages in one go, and run a single cycle for auditing afterwards


:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be useful.

posted by addons-assistant[bot] over 5 years ago

Would it be possible for you to post a log to demonstrate what you mean?

posted by sinclairpaul over 5 years ago

@sinclairpaul ; absolutely!

attached my hassio/nodered config:

{ "credential_secret": "xxx", "dark_mode": false, "http_node": { "username": "xxx", "password": "xxx" }, "http_static": { "username": "xxx", "password": "xxx" }, "ssl": true, "certfile": "fullchain.pem", "keyfile": "privkey.pem", "require_ssl": true, "system_packages": [], "npm_packages": [ "node-red-contrib-light-scheduler", "node-red-contrib-owntracks", "node-red-contrib-homekit-bridged", "node-red-contrib-dsm" ], "init_commands": [], "log_level": "warning" }

and the corresponding logs, with bold the repeat of the install and corresponding audits:

Add-on version: 6.0.0 You are running the latest version of this add-on. System: Ubuntu 18.04.3 LTS (amd64 / qemux86-64) Home Assistant version: 0.103.5 Supervisor version: 193 ... [cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... Log level is set to WARNING [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] nginx.sh: executing... [cont-init.d] nginx.sh: exited 0. [cont-init.d] node-red.sh: executing... patching file nodes/ui_base.html Hunk #1 succeeded at 1243 (offset 712 lines). audited 369 packages in 4.519s

13 packages are looking for funding run npm fund for details

found 1 high severity vulnerability run npm audit fix to fix them, or npm audit for details [cont-init.d] node-red.sh: exited 0. [cont-init.d] user.sh: executing... + node-red-contrib-light-scheduler@0.0.15 added 3 packages from 2 contributors and audited 3820 packages in 26.416s

18 packages are looking for funding run npm fund for details

found 0 vulnerabilities

+ node-red-contrib-owntracks@0.0.2 added 3 packages from 3 contributors and audited 3823 packages in 27.629s

18 packages are looking for funding run npm fund for details

found 0 vulnerabilities

+ node-red-contrib-homekit-bridged@0.8.0 added 19 packages from 20 contributors and audited 3895 packages in 29.722s

18 packages are looking for funding run npm fund for details

found 0 vulnerabilities

+ node-red-contrib-dsm@0.14.1 added 1 package from 1 contributor and audited 3896 packages in 26.6s

18 packages are looking for funding run npm fund for details

found 0 vulnerabilities

[cont-init.d] user.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done.

hassio-addon-node-red@ start /opt node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js" ...

posted by mbrackjr over 5 years ago

Many thanks! Reboot takes less than a 3rd of the v6.0.0 times.

posted by mbrackjr over 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests