-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add systeminfo #3331
Add systeminfo #3331
Conversation
2e743b1
to
9ac84e3
Compare
Thanks for whipping up this PR. Cant wait to see it moved from Draft into real. |
Thanks for the feedback. I have changed the first line. With this I take back the draft state 🙂 |
If nobody comes up with more wishes for the ouput in the next 24h I will merge it :-) |
why not using many values are inside process object (and many other) just check it :) |
also on armv6l, there is no electron, as its optional, and won't be installed.. AND we are seeing a lot of electron fail install on upgrade .. but work manually after,, don't know why |
virtual.. does this detect in a VM? (vmware, ...) , or macos |
systeminformation docs says mac is supported, VM... humm virtual box VMs only ? |
I have modified it a bit, now no message is displayed if electron is not installed. It will only indicate in the list that it is not installed. Like this: [03.01.2024 18:35.53.972] [INFO] System information:
### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12
### VERSIONS: MagicMirror: 2.27.0-develop; electron: not installed; kernel: 5.10.0-20-amd64; node: 21.1.0; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
The documentation only says "is virtual machine". Maybe someone is running MM on a vm, then we'll probably see it there. The space was there, that's why I included it. But I can remove it if you don't see a point in it. |
LGTM! Here the results on my windows machine using docker container with wsl2: npm run server
### SYSTEM: manufacturer: Microsoft; model: Docker Container; raspberry: undefined; virtual: true
### OS: platform: linux; distro: Debian GNU/Linux; release: 12
### VERSIONS: MagicMirror: 2.27.0-develop; electron: 27.2.0; kernel: 5.15.133.1-microsoft-standard-WSL2; node: 21.5.0; npm: 10.2.4; pm2: ; docker:
npm run start
### SYSTEM: manufacturer: Microsoft; model: Docker Container; raspberry: undefined; virtual: true
### OS: platform: linux; distro: Debian GNU/Linux; release: 12
### VERSIONS: MagicMirror: 2.27.0-develop; electron: 27.2.0; kernel: 5.15.133.1-microsoft-standard-WSL2; node: 18.17.1; npm: 10.2.4; pm2: ; docker: The difference between the two start variants is the node version, under electron the node version of electron is used, so everything works as expected :) One cosmetic thing: The magicmirror version is already shown twice in the logs, e.g. > [email protected] start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
[03.01.2024 19:15.41.671] [LOG] Starting MagicMirror: v2.27.0-develop so I think we don't need this information again. Will do some tests later using a raspberry pi. |
is there CPU architecture info |
So here my test on a raspi4 but - as always - with docker container: ### SYSTEM: manufacturer: ; model: Docker Container; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12
### VERSIONS: MagicMirror: 2.27.0-develop; electron: 27.2.0; kernel: 6.1.19-v8+; node: 18.17.1; npm: 10.2.4; pm2: ; docker:
I was searching for this too and it is available: "os": {
"platform": "linux",
"distro": "Debian GNU/Linux",
"release": "12",
"codename": "bookworm",
"kernel": "6.1.19-v8+",
"arch": "arm",
"hostname": "raspberrypi",
"fqdn": "raspberrypi",
"codepage": "UTF-8",
"logofile": "debian",
"serial": "85b5a61dd83b459d884a321797727254",
"build": "",
"servicepack": "",
"uefi": false
}, |
tested now 64-bit on raspi so we are getting only the values |
found one additional info I'm interested in: |
I made a mistake. The variable works! I've changed it accordingly, it's much better now. Thanks for the hint!
Strange. Actually, I would have expected an extra line with docker info. if (typeof staticData["dockerInfo"] !== "undefined") systemDataString += `\n ### DOCKER: containers: ${staticData["dockerInfo"]["containers"]}; operatingSystem: ${staticData["dockerInfo"]["operatingSystem"]}; osType: ${staticData["versions"]["osType"]}; architecture: ${staticData["versions"]["architecture"]}; serverVersion: ${staticData["versions"]["serverVersion"]}`; So this line seems to have no effect at all.
I've just removed it.
I've just added it.
I've just added it. Current status on my system: ### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; node: 18.17.1; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
### OTHER: timeZone: Europe/Berlin |
I think this line can be removed. For getting such infos you must have installed docker. With that you get such info's but I think this is useless here. I'm only interested if mm is running as docker container and this is displayed in the model section |
but i think that node version is used in node_helper (I will check) Edit: It's node of Electron used Edit2: @khassel : but... we know that we must have +/- same node version for MM² running fine |
but this is not true. the node modules are loaded before electron is launched. and the node_helpers fail because fetch is not there. if we upgrade the base then things are ok. so node helpers run under platform node |
I added an additional line to start () {
Log.log(`Starting module helper: ${this.name}`);
Log.log(process.versions);
}, and this is the result when starting with [05.01.2024 23:17.31.742] [LOG] Server started ...
[05.01.2024 23:17.31.742] [LOG] Connecting socket for: updatenotification
[05.01.2024 23:17.31.742] [LOG] Starting module helper: updatenotification
[05.01.2024 23:17.31.743] [LOG] {
node: '18.17.1',
acorn: '8.8.2',
ada: '2.5.0',
ares: '1.19.1',
brotli: '1.0.9',
cldr: '43.0',
icu: '73.1',
llhttp: '6.0.11',
modules: '118',
napi: '9',
nghttp2: '1.52.0',
openssl: '1.1.1',
simdutf: '3.2.12',
tz: '2023c',
undici: '5.22.1',
unicode: '15.0',
uv: '1.44.2',
uvwasi: '0.0.18',
v8: '11.8.172.18-electron.0',
zlib: '1.2.13.1-motley',
electron: '27.2.1',
chrome: '118.0.5993.159'
}
[05.01.2024 23:17.31.743] [LOG] Connecting socket for: calendar
[05.01.2024 23:17.31.743] [LOG] Starting node helper for: calendar
[05.01.2024 23:17.31.743] [LOG] Connecting socket for: newsfeed |
makes no sense |
my test or the result? |
Like I says installed node version must be ~ to electron node version for have all functions I know... there is no sense |
right, but they are loaded by mode_helper what is that junk from start then? server mode just doesn't launch electron . it does all the rest using installed node. |
yes, server mode always uses the installed node version, but not when running as electron ( If I put the line |
I would not have expected anything like this. Even though it may not have any added value, that's just how I looked at it: I added the following two lines to the new Log.info("systeminformation: " + staticData["versions"]["node"]);
Log.info("process.versions.node: " + process.versions.node); Running with electron: [06.01.2024 00:21.07.909] [INFO] systeminformation: 18.17.1
[06.01.2024 00:21.07.909] [INFO] process.versions.node: 18.17.1 Running as server: [06.01.2024 00:21.13.738] [INFO] systeminformation: 21.1.0
[06.01.2024 00:21.13.738] [INFO] process.versions.node: 21.1.0 Getting the information from 'node -v' or reading the package.json in the node_modules directory are definitely options. Of course we can also display both (the information we get from systeminformation and the installed version). But to understand the whole system, it would be good if we could get to the bottom of it. Even if I think it's unlikely, but could it be that if we run with electron, everything runs with the node version of electron? That would be a very interesting discovery. And it would not only be relevant for what we want to display, but also for troubleshooting in general. |
but it's not correct. keep the current electron, install node 16 and the calendar node_helper will fail cause fetch isn't found fetch is in electron. what node is being used by node helpers? |
I just did that: kristjan@debian:~/MagicMirror$ node -v
v16.20.0
kristjan@debian:~/MagicMirror$ npm run start
> [email protected] start
> DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
[06.01.2024 00:46.04.220] [LOG] Starting MagicMirror: v2.27.0-develop
[06.01.2024 00:46.04.224] [LOG] Loading config ...
[06.01.2024 00:46.04.226] [DEBUG] config template file not exists, no envsubst
....
[06.01.2024 00:46.06.083] [INFO] System information:
### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; node: 18.17.1; npm: 8.19.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
### OTHER: timeZone: Europe/Berlin
[06.01.2024 00:46.06.083] [INFO] systeminformation: 18.17.1
[06.01.2024 00:46.06.084] [INFO] process.versions.node: 18.17.1
... And the calendar and other modules using fetch are working 🤯 |
yes, mind blown... |
really... I do not understand anything anymore |
I give up trying to understand that today! 😴 |
I managed to get mm running with electron but without even nodejs/npm installed ... |
Crazy. Just to get it right: You have executed |
and |
@bugsounet he probably had to do the install ., then remove node and npm and then launch the electron bin directly i remember others having to do npm rebuild on onoff for server mode, or electron-rebuild for electron mode |
this was the first approach Electron releases prebuilt binaries as described here. So I did
Here is the complete FROM node:21-alpine as builder
WORKDIR /opt/magic_mirror
RUN set -e; \
apk add --no-cache git;
RUN set -e; \
node -v; \
git clone --depth 1 -b develop --single-branch "https://github.com/MagicMirrorOrg/MagicMirror.git" .; \
git log -1; \
npmargs="--no-audit --no-fund --no-update-notifier --arch=arm64 --omit=optional --omit=dev"; \
rm -f package-lock.json; \
echo "now executing: npm install ${npmargs}"; \
npm install ${npmargs}; \
cat package.json; \
sed -i "s:address\: \"localhost\":address\: \"0.0.0.0\":" config/config.js.sample; \
sed -i "s:ipWhitelist\: \[.*\],:ipWhitelist\: \[\],:" config/config.js.sample; \
cp config/config.js.sample config/config.js;
FROM debian:bookworm
LABEL maintainer="Karsten Hassel"
RUN set -e; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get -qy --no-install-recommends install git nano sudo wget ca-certificates libgtk-3-0 libx11-xcb-dev libnss3-dev \
libxss1 libxtst6 libasound2 libdrm2 libgbm1 libxshmfence1 fonts-arphic-uming procps unzip; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
useradd -u 1000 node; \
usermod -a -G video node; \
echo "node ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers; \
groupadd --gid 997 gpio; \
usermod -a -G gpio node;
ENV ELECTRON_DISABLE_SANDBOX=1 \
DBUS_SESSION_BUS_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"
COPY --from=builder --chown=node:node /opt/magic_mirror /opt/magic_mirror
USER node
WORKDIR /home/node/electron
RUN set -e; \
wget -O /tmp/electron.zip https://github.com/electron/electron/releases/download/v28.1.1/electron-v28.1.1-linux-x64.zip; \
unzip /tmp/electron.zip -d /home/node/electron/; \
rm -f /tmp/electron.zip;
ENTRYPOINT ["/home/node/electron/electron", "/opt/magic_mirror"] Logs: [06.01.2024 18:10.19.727] [LOG] Starting MagicMirror: v2.27.0-develop
[06.01.2024 18:10.19.729] [LOG] Loading config ...
[06.01.2024 18:10.19.730] [DEBUG] config template file not exists, no envsubst
[06.01.2024 18:10.19.732] [LOG] Loading module helpers ...
[06.01.2024 18:10.19.732] [LOG] No helper found for module: alert.
[06.01.2024 18:10.19.737] [LOG] Initializing new module helper ...
[06.01.2024 18:10.19.737] [LOG] Module helper loaded: updatenotification
[06.01.2024 18:10.19.738] [LOG] No helper found for module: clock.
[06.01.2024 18:10.19.804] [LOG] Initializing new module helper ...
[06.01.2024 18:10.19.804] [LOG] Module helper loaded: calendar
[06.01.2024 18:10.19.805] [LOG] No helper found for module: compliments.
[06.01.2024 18:10.19.806] [LOG] No helper found for module: weather.
[06.01.2024 18:10.19.850] [LOG] Initializing new module helper ...
[06.01.2024 18:10.19.851] [LOG] Module helper loaded: newsfeed
[06.01.2024 18:10.19.851] [LOG] All module helpers loaded.
[06.01.2024 18:10.19.854] [LOG] Starting server on port 8080 ...
[06.01.2024 18:10.19.855] [WARN] You're using a full whitelist configuration to allow for all IPs
[06.01.2024 18:10.20.246] [LOG] Server started ...
[06.01.2024 18:10.20.247] [LOG] Connecting socket for: updatenotification
[06.01.2024 18:10.20.247] [LOG] Starting module helper: updatenotification
[06.01.2024 18:10.20.247] [LOG] Connecting socket for: calendar
[06.01.2024 18:10.20.247] [LOG] Starting node helper for: calendar
[06.01.2024 18:10.20.247] [LOG] Connecting socket for: newsfeed
[06.01.2024 18:10.20.248] [LOG] Starting node helper for: newsfeed
[06.01.2024 18:10.20.248] [LOG] Sockets connected & modules started ...
[06.01.2024 18:10.20.483] [LOG] Launching application.
[06.01.2024 18:10.20.849] [INFO] System information:
### SYSTEM: manufacturer: Microsoft; model: Docker Container; raspberry: undefined; virtual: true
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.15.133.1-microsoft-standard-WSL2
### VERSIONS: electron: 28.1.1; node: 18.18.2; npm: ; pm2: ; docker:
### OTHER: timeZone: UTC
[06.01.2024 18:10.23.216] [LOG] Create new calendarfetcher for url: https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics - Interval: 604800000
[06.01.2024 18:10.23.264] [LOG] Create new newsfetcher for url: https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000
[06.01.2024 18:10.23.267] [INFO] updatenotification: Updater Class Loaded!
[06.01.2024 18:10.23.267] [INFO] updatenotification: Checking PM2 using...
[06.01.2024 18:10.23.268] [INFO] Checking git for module: MagicMirror
[06.01.2024 18:10.23.292] [INFO] updatenotification: You are not using pm2
[06.01.2024 18:10.23.559] [INFO] Newsfeed-Fetcher: Broadcasting 27 items.
[06.01.2024 18:10.23.720] [INFO] Calendar-Fetcher: Broadcasting 12 events from https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics. |
So what do we learn from all this?
|
yes, I think so
|
@KristjanESPERANTO: maybe add an Log if GPU accelerator is activated or not? |
yes we changed the default to disabled to stop the errors export ELECTRON_ENABLE_GPU=1 To turn it on |
In my case: error/warn vs MM² running slowly ... |
Sure. Like that? Hardware acceleration enabled: ### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; node: 18.17.1; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
### OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: 1 Hardware acceleration not enabled: ### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; node: 18.17.1; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
### OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined @khassel Is it even relevant to display the docker version? If mm is running in a container, there is no docker installed in it and then no version is displayed, right? |
Before I do a PR tomorrow, you are welcome to give me feedback here. Changes so far:
### SYSTEM: manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS: platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; used node: 18.17.1; installed node: 21.1.0; npm: 10.2.4; pm2: 5.3.0
### OTHER: timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: 1 |
Thanks, I'm fine with these changes |
Okay, thanks for the feedback! Further discussion on the subject of system information in the new PR #3337. |
looks good to me.. |
This is a first attempt to bring additional system information into the console (see #3328). It's certainly not yet perfect, but with the PR we have a better basis for discussion.
I tried to keep the output small so that we get as much information as possible in screenshots.
This is how it looks on my development system.
Why is it still a draft:
=> Update: As long as there is no better idea, it stays there.
=> Update: Some added. Of course, more information could be added later, as soon as experience has been gained in productive use.
=> Update: Changed to "System information:"
Here you can see what information we could easily add with the systeminformation package.
It would be interesting how the raspberry field is filled on a raspi system and with docker there should be another line, but I can't easily test that now.