grafana / grafana-image-renderer

A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)
Apache License 2.0
378 stars 152 forks source link

Add support for ARM #7

Open andre2308 opened 5 years ago

andre2308 commented 5 years ago

Hey,

is there any plans to support arm CPUs?

I'am using a Synology DS216play with a STM STiH412 CPU. When i want to install the image rendering, yarn throw me these errors: yarn log.txt with Google i found out that node grpc supports arm after Version 1.4.1.

Or is there a way to Cross Compile it?

Thank you

DarkC35 commented 3 years ago

Hi there, just got another (IMO rather easy) workaround running today on Raspberry OS (tested with Raspberry 4 8GB & Raspberry 3B+) with docker-compose:

  1. Clone repo on your Raspberry and prepare Dockerfile
    git clone https://github.com/grafana/grafana-image-renderer.git
    cd grafana-image-renderer
    # copy Dockerfile for required changes, or override the official one
    cp Dockerfile raspi.Dockerfile
  2. Edit raspi.Dockerfile (nano raspi.Dockerfile) Comment or remove the first three echo commands:
    
    FROM node:12-alpine AS base

ENV CHROME_BIN="/usr/bin/chromium-browser" ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

WORKDIR /usr/src/app

RUN \

echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \

echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \

echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \

apk --no-cache upgrade && \ apk add --no-cache udev ttf-opensans unifont chromium ca-certificates dumb-init && \ rm -rf /tmp/*

rest of raspi.Dockerfile stays the same

This is required to prevent following warnings, which breaks the build:

WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/edge/*: temporary error (try again later)

3. Use raspi.Dockerfile in your docker-compose.yml instead of image
```yaml
version: "3"

services:
  grafana:
    container_name: grafana
    image: grafana/grafana
    ports:
      - "3000:3000"
    environment:
      - GF_RENDERING_SERVER_URL=http://renderer:8081/render
      - GF_RENDERING_CALLBACK_URL=http://grafana:3000/
      - GF_LOG_FILTERS=rendering:debug
    # some personal configs
    # volumes:
    #   - './grafana-data:/var/lib/grafana'
    # user: "1000"
    restart: unless-stopped

  renderer:
    container_name: grafana-image-renderer
    # image: grafana/grafana-image-renderer:latest # this one does not work on raspis
    build:
      context: ./grafana-image-renderer # path to the cloned repo
      dockerfile: raspi.Dockerfile
    # build: ./grafana-image-renderer # when you have overritten the normal Dockerfile you can use this line instead of the context/dockerfile split
    ports:
      - 8081
    environment:
      - ENABLE_METRICS=true
    restart: unless-stopped
  1. Start it up with docker-compose up -d Compose is going to build the image-renderer from scratch, this can take about 5-10 minutes (when the build is not triggered, you can try docker-compose build).
  2. Try it out :) Grafana > Dashboard > Panel > Share > Direct link rendered image Image rendering takes about 5 seconds when I tested it.
senarvi commented 3 years ago

I pushed the image I created. It's my first image I pushed, so if I've done something wrong, please let me know.

Thanks a lot! Often the 'latest' tag is added so that one can use it to always download the latest version..

dramirezp commented 3 years ago

Hi need to install the plug-in in ARM64 but I'm not sure of how to do it

davide1995 commented 3 years ago

Please make it work with raspbian, without docker!

hferreira23 commented 3 years ago

I managed to create a docker image for armv7/arm64/amd64. It runs grafana-image-renderer with the latest commits in the master branch.

I was only able to test it in a RPI4 running Raspbian 32bits. If anyone wants to test it out or fork it be my guest:

Github: https://github.com/hferreira23/grafana-image-renderer Docker: https://hub.docker.com/repository/docker/hferreira/grafana-image-renderer

Errors let me know, I'll try to solve them.

JTS-FIN commented 3 years ago

As requested on Grafana blog here is my request for ARM support: Please support armv7 and arm64 out of the box. This issue contains lots of examples how to make it work, so it seems unnecessary to make all arm users go through the hazzle when things could be just implemented in the official image.

SerhiyMakarenko commented 3 years ago

I was able to build a working image for the 2.1.0 version.

Github: https://github.com/SerhiyMakarenko/grafanalabs-renderer-dockerized Docker image: https://hub.docker.com/r/serhiymakarenko/grafanalabs-image-renderer

It starts working on the armv7l when I remove adding edge repos from the Dockerfile. I did this because the docker build failed on this stage on the Raspberry Pi 4 with 32-bit Raspberry OS despite everything was fine on the docker buildx x86_64 host for cross-compilation.

Hope this info helps to run Grafana Renderer on ARM hosts while official support for ARM will be added here.

raulibadding commented 3 years ago

+1 Please support armv7 and arm64 out of the box.

seriru commented 3 years ago

I pushed the image I created. It's my first image I pushed, so if I've done something wrong, please let me know.

This docker-compose.yml is working on a Raspberry Pi 4

version: "2"

services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    environment:
      GF_RENDERING_SERVER_URL: http://renderer:8081/render
      GF_RENDERING_CALLBACK_URL: http://grafana:3000/
    ports:
      - 3000:3000
    links:
      - renderer
    volumes:
      - ./data:/var/lib/grafana
  renderer:
    image: adejong/grafana-image-renderer-pi:1.0.8-beta2
    container_name: grafana-image-renderer-pi
    ports:
      - 8081

This worked for me. Thank you!

SirTimmons commented 3 years ago

I pushed the image I created. It's my first image I pushed, so if I've done something wrong, please let me know.

This docker-compose.yml is working on a Raspberry Pi 4

version: "2"

services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    environment:
      GF_RENDERING_SERVER_URL: http://renderer:8081/render
      GF_RENDERING_CALLBACK_URL: http://grafana:3000/
    ports:
      - 3000:3000
    links:
      - renderer
    volumes:
      - ./data:/var/lib/grafana
  renderer:
    image: adejong/grafana-image-renderer-pi:1.0.8-beta2
    container_name: grafana-image-renderer-pi
    ports:
      - 8081

Hi, very new here and very new to Linux, Grafana, Docker etc....

I'm struggling with getting this plugin working - I've managed to pull your Docker image above and have a container running on Port 8081. What do I need to do to get this working with Grafana? Is there a Grafana CLI command to run? Should the plugin automatically show in the plugin list when the container is running?

Any advice would be greatly appreciated.

Thanks

seriru commented 3 years ago

I pushed the image I created. It's my first image I pushed, so if I've done something wrong, please let me know. This docker-compose.yml is working on a Raspberry Pi 4

version: "2"

services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    environment:
      GF_RENDERING_SERVER_URL: http://renderer:8081/render
      GF_RENDERING_CALLBACK_URL: http://grafana:3000/
    ports:
      - 3000:3000
    links:
      - renderer
    volumes:
      - ./data:/var/lib/grafana
  renderer:
    image: adejong/grafana-image-renderer-pi:1.0.8-beta2
    container_name: grafana-image-renderer-pi
    ports:
      - 8081

Hi, very new here and very new to Linux, Grafana, Docker etc....

I'm struggling with getting this plugin working - I've managed to pull your Docker image above and have a container running on Port 8081. What do I need to do to get this working with Grafana? Is there a Grafana CLI command to run? Should the plugin automatically show in the plugin list when the container is running?

Any advice would be greatly appreciated.

Thanks

You would need to configure the server_url and callback_url settings in the rendering section in grafana.ini.

scotthraban commented 3 years ago

Using buildx, I was able to build, from the v3.0.1 tag, a linux/arm64/v8 image that worked with no issues on k3s running on Ubuntu 20.04 on a Raspberry Pi 4. No tweaks to the Dockerfile needed.

docker buildx build --platform linux/arm64/v8,linux/amd64 --push --tag <my-private-repo>/grafana-image-renderer:3.0.1-custom --tag <my-private-repo>/grafana-image-renderer:latest .
thetravellor commented 3 years ago

If I may, id like to change direction. It works quite happily as a standalone Node application on 32 bit ARM, not sure how secure it is, ill leave that to wiser heads to sort out.

  1. I installed the stable nodejs manually into /usr/local/bin following these directions: https://www.instructables.com/Install-Nodejs-and-Npm-on-Raspberry-Pi/

  2. pi@raspberrypi:/opt/grafana-image-renderer/build $ node -v v14.17.3

  3. Follow the directions here: https://grafana.com/docs/grafana/latest/administration/image_rendering/#remote-rendering-service download, compile and test

  4. cp -R /home/pi/sudo cp -R grafana-image-renderer /opt

chmod -R grafana /opt/grafana-image-renderer

  1. sudo vi /usr/lib/systemd/system/grafana-server.service modify this line:

After=postgresql.service mariadb.service mysql.service grafana-image-renderer.service

  1. sudo systemctl daemon-reload

  2. sudo vi grafana-image-renderer.service

`[Unit] Description=Grafana Remote Image Rendering Service Documentation=http://docs.grafana.org Wants=network-online.target After=network-online.target After=postgresql.service mariadb.service mysql.service

[Service] EnvironmentFile=/etc/default/grafana-server User=grafana Group=grafana Type=simple Restart=on-failure WorkingDirectory=/opt/grafana-image-renderer/build/

ExecStart=/usr/local/bin/node /opt/grafana-image-renderer/build/app.js server --port=8081 LimitNOFILE=10000 TimeoutStopSec=20 UMask=0027

[Install] WantedBy=multi-user.target `

  1. sudo systemctl enable grafana-image-renderer.service

  2. sudo systemctl start grafana-image-renderer.service

pi@raspberrypi:~ $ sudo systemctl status grafana-image-renderer.service ● grafana-image-renderer.service - Grafana Remote Image Rendering Service Loaded: loaded (/usr/lib/systemd/system/grafana-image-renderer.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-07-18 22:36:16 AEST; 27min ago Docs: http://docs.grafana.org Main PID: 16022 (node) Tasks: 7 (limit: 4915) CGroup: /system.slice/grafana-image-renderer.service └─16022 /usr/local/bin/node /opt/grafana-image-renderer/build/app.js server --port=8081

Jul 18 22:36:16 raspberrypi systemd[1]: Started Grafana Remote Image Rendering Service. Jul 18 22:36:17 raspberrypi node[16022]: {"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}

  1. sudo systemctl restart grafana-server

  2. sudo systemctl status grafana-server

pi@raspberrypi:~ $ sudo systemctl status grafana-server.service ● grafana-server.service - Grafana instance Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2021-07-18 23:05:11 AEST; 6s ago Docs: http://docs.grafana.org Main PID: 23689 (grafana-server) Tasks: 11 (limit: 4915) CGroup: /system.slice/grafana-server.service └─23689 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths

Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=michaeldmoore-annunciator-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=natel-discrete-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=cloudspout-button-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=grafana-clock-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=warn msg="Running an unsigned plugin" logger=plugins pluginID=jeanbaptistewatenberg-percent-panel pluginDir=/var/lib/grafana/plugins/jeanbaptistewatenberg- Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=jeanbaptistewatenberg-percent-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Registering plugin" logger=plugins id=michaeldmoore-multistat-panel Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Live Push Gateway initialization" logger=live.push_http Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="Backend rendering via external http server" logger=rendering renderer=http version=3.0.1 Jul 18 23:05:17 raspberrypi grafana-server[23689]: t=2021-07-18T23:05:17+1000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=

It is relying on the defualt Raspian chromium browser, which must be installed: /usr/lib/chromium-browser/chromium-browser-v7

Good luck

rkm commented 3 years ago

I've managed to build and run the docker image (v3.0.1) on a raspberry pi 4, and have set my grafana server to use it as the remote renderer. When I click share -> direct link rendered image, the rendering fails. Docker logs show:

root@pimon:~/grafana/grafana-image-renderer# docker-compose up
Creating network "grafana-image-renderer_default" with the default driver
Creating grafana-image-renderer_grafana-image-renderer_1 ... done
Attaching to grafana-image-renderer_grafana-image-renderer_1
grafana-image-renderer_1  | {"collectDefaultMetrics":true,"requestDurationBuckets":"1,5,7,9,11,13,15,20,30","level":"info","message":"Metrics enabled"}
grafana-image-renderer_1  | {"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}
grafana-image-renderer_1  | {"url":"http://localhost:3000/d-solo/GcHkaHRgk/pimon-temp-monitor?orgId=1&refresh=5s&from=1628009466074&to=1628010366074&panelId=2&width=1000&height=500&tz=Europe%2FLondon&render=1","method":"GET","failure":"net::ERR_CONNECTION_REFUSED","level":"error","message":"Browser request failed"}
grafana-image-renderer_1  | {"url":"/render?deviceScaleFactor=1.000000&domain=localhost&encoding=&height=500&renderKey=KHU9YXmzWahbgoZxLDbPx9K0F75mHADz&timeout=60&timezone=Europe%2FLondon&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FGcHkaHRgk%2Fpimon-temp-monitor%3ForgId%3D1%26refresh%3D5s%26from%3D1628009466074%26to%3D1628010366074%26panelId%3D2%26width%3D1000%26height%3D500%26tz%3DEurope%252FLondon%26render%3D1&width=1000","stack":"Error: net::ERR_CONNECTION_REFUSED at http://localhost:3000/d-solo/GcHkaHRgk/pimon-temp-monitor?orgId=1&refresh=5s&from=1628009466074&to=1628010366074&panelId=2&width=1000&height=500&tz=Europe%2FLondon&render=1\n    at navigate (/usr/src/app/node_modules/puppeteer/lib/FrameManager.js:95:23)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async FrameManager.navigateFrame (/usr/src/app/node_modules/puppeteer/lib/FrameManager.js:70:21)\n    at async Frame.goto (/usr/src/app/node_modules/puppeteer/lib/FrameManager.js:295:16)\n    at async Page.goto (/usr/src/app/node_modules/puppeteer/lib/Page.js:485:16)\n  -- ASYNC --\n    at Frame.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:94:19)\n    at Page.goto (/usr/src/app/node_modules/puppeteer/lib/Page.js:485:53)\n    at Page.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/helper.js:95:27)\n    at Browser.<anonymous> (/usr/src/app/build/browser/browser.js:191:24)\n    at Generator.next (<anonymous>)\n    at fulfilled (/usr/src/app/build/browser/browser.js:5:58)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)","level":"error","message":"Request failed"}
grafana-image-renderer_1  | {"message":"::ffff:172.20.0.1 - - [03/Aug/2021:17:06:09 +0000] \"GET /render?deviceScaleFactor=1.000000&domain=localhost&encoding=&height=500&renderKey=KHU9YXmzWahbgoZxLDbPx9K0F75mHADz&timeout=60&timezone=Europe%2FLondon&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FGcHkaHRgk%2Fpimon-temp-monitor%3ForgId%3D1%26refresh%3D5s%26from%3D1628009466074%26to%3D1628010366074%26panelId%3D2%26width%3D1000%26height%3D500%26tz%3DEurope%252FLondon%26render%3D1&width=1000 HTTP/1.1\" 500 96 \"-\" \"Grafana/8.0.6\"\n","level":"error"}

The useful output being Browser request failed.

Any thoughts? Thanks!

senarvi commented 2 years ago

I used the image built by @aukedejong for a long time, but at some point it stopped working. Probably some upgrade in my Raspberry Pi broke the functionality. I couldn't figure out what's wrong, so I tried installing it as a standalone Node.js application, and then building my own Docker image. Neither of these worked. When I try to run /usr/bin/chromium-browser in the container, I get the following error:

Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_drop_hints: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_retain_gids: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset: symbol not found

Eventually I switched to the image built by @hferreira23 and this works. Thanks for maintaining it!

mhoogenbosch commented 2 years ago

I used the image built by @aukedejong for a long time, but at some point it stopped working. Probably some upgrade in my Raspberry Pi broke the functionality. I couldn't figure out what's wrong, so I tried installing it as a standalone Node.js application, and then building my own Docker image. Neither of these worked. When I try to run /usr/bin/chromium-browser in the container, I get the following error:

Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_drop_hints: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_retain_gids: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset: symbol not found

Eventually I switched to the image built by @hferreira23 and this works. Thanks for maintaining it!

Same here, any pointers how to run the @hferreira23 build? Which URL should I use to download the docker image?


Just created my own docker image based on the Dockerfile provided by @hferreira23, it now works indeed. Thanks.

hferreira23 commented 2 years ago

FYI for anyone that uses my images. Due to the fact that Alpine doesn't have the chromium package for ARM arch in Alpine 3.14 I had to discontinue support for the ARM arch.

hferreira/grafana-image-renderer:latest has support for arm64 and amd64.

I created an image based on the last(!?) Alpine 3.11 that still should work with ARM (no future support, security fixes, etc) -> hferreira/grafana-image-renderer:armv7 - I DO NOT recommend using this image. Chromium is in a very old version with lots of CVEs unattended for. Try to upgrade the base OS to a arm64 or amd64 arch so you can use the latest image with the most up-to-date version of chromium.

AntonWert commented 2 years ago

Please make it work with raspbian, without docker, just out of the box! It is anoying: grafana-image-renderer v is not supported on your system (Grafana v8.3.3 linux-arm)

dpsenner commented 2 years ago

I just upgradeed grafana-server to version 8.3.3 on my raspberry 2 and it runs just fine on raspbian. It appears docker is now no longer a good option either.

@marefr there are several people seconding this request. What can we do to make this become real?

iomatch commented 2 years ago

I am also in need for this to be released for ARM. My use case is to monitor my coop and it is very informative to have temperature charts as part of alerts for my Telegram bot.

just-doit commented 2 years ago

+1 for armv7 support without the need to install docker.

bucovaina commented 2 years ago

+1 for just in Raspbian. No docker.

Thanks a ton for that!

bgoerner commented 2 years ago

+1 for arm raspbian support.

nikto-b commented 2 years ago

+1 for Ubuntu server x64 aarch64 (Cortex-A72) without docker

nargetdev commented 2 years ago

+1 raspbian context and docker (i.e. balenaOS service)

Also really keen to see headless chrome successfully render transparent background (i.e. for composing over other images)

careyer commented 2 years ago

I created an image based on the last(!?) Alpine 3.11 that still should work with ARM (no future support, security fixes, etc) -> hferreira/grafana-image-renderer:armv7 - I DO NOT recommend using this image. Chromium is in a very old version with lots of CVEs unattended for. Try to upgrade the base OS to a arm64 or amd64 arch so you can use the latest image with the most up-to-date version of chromium.

@hferreira23 : I tried your armv7 docker image but during start it errors out. Any idea?

grafik

Is this a self-contained container or do I need another container up an running?

Update: Following the Option 2 here https://docs.linuxserver.io/faq#libseccomp solved the problem. However the Renderer still doesn't work in conjunction with Grafana v9.0.x :-(

From grafana.log

logger=context traceID=00000000000000000000000000000000 userId=1 orgId=1 uname=admin t=2022-08-18T16:34:08.103444483+02:00 level=error msg="Request Completed" method=GET path=/render/d-solo/ClUhaGgRz/badezimmer status=500 remote_addr=192.168.68.127 time_ms=510 duration=510.300882ms size=1344 referer= traceID=00000000000000000000000000000000
logger=rendering renderer=http t=2022-08-18T16:35:21.222590033+02:00 level=info msg=Rendering path="d-solo/oKbWEMgRz/treppenhaus?orgId=1&panelId=2"
logger=rendering renderer=http t=2022-08-18T16:35:23.014329645+02:00 level=error msg="Remote rendering request failed" error="500 Internal Server Error" url="http://192.168.68.112:3000/d-solo/oKbWEMgRz/treppenhaus?orgId=1&panelId=2&render=1"

Log from the Container itself:

{"level":"error","message":"Request failed","stack":"Error: Failed to launch the browser process!\nError relocating /usr/lib/chromium/chrome: hb_subset_input_set_drop_hints: symbol not found\nError relocating /usr/lib/chromium/chrome: hb_subset_input_set_retain_gids: symbol not found\nError relocating /usr/lib/chromium/chrome: hb_subset: symbol not found\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n\n    at onClose (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)\n    at Interface.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)\n    at Interface.emit (events.js:412:35)\n    at Interface.close (readline.js:530:8)\n    at Socket.onend (readline.js:254:10)\n    at Socket.emit (events.js:412:35)\n    at endReadableNT (internal/streams/readable.js:1334:12)\n    at processTicksAndRejections (internal/process/task_queues.js:82:21)","url":"/render?deviceScaleFactor=1.000000&domain=192.168.68.112&encoding=&height=500&renderKey=nCdlRzCUquZA5G3RndUtUF1CUDveJ1ki&timeout=60&timezone=Europe%2FBerlin&url=http%3A%2F%2F192.168.68.112%3A3000%2Fd-solo%2FIhknaMRgz%2Fkinderzimmer%3ForgId%3D1%26refresh%3D30s%26from%3D1660231676797%26to%3D1660836476797%26panelId%3D2%26width%3D1000%26height%3D500%26tz%3DEurope%252FBerlin%26render%3D1&width=1000"}
{"level":"error","message":"::ffff:172.17.0.1 - - [18/Aug/2022:15:29:48 +0000] \"GET /render?deviceScaleFactor=1.000000&domain=192.168.68.112&encoding=&height=500&renderKey=nCdlRzCUquZA5G3RndUtUF1CUDveJ1ki&timeout=60&timezone=Europe%2FBerlin&url=http%3A%2F%2F192.168.68.112%3A3000%2Fd-solo%2FIhknaMRgz%2Fkinderzimmer%3ForgId%3D1%26refresh%3D30s%26from%3D1660231676797%26to%3D1660836476797%26panelId%3D2%26width%3D1000%26height%3D500%26tz%3DEurope%252FBerlin%26render%3D1&width=1000 HTTP/1.1\" 500 96 \"-\" \"Grafana/9.0.6\"\n"}
bucovaina commented 2 years ago

It'd still be nice to have this in raspbian on the RPI4/3

alaub81 commented 2 years ago

Someone has a running renderer with Grafana 9.1.x? After upgrading from grafana 8.5.x to 9.1.6 rendering of pictures is broken. I can see these messages in renderer log:

grafana-renderer-1  | {"message":"::ffff:172.19.0.5 - - [24/Sep/2022:18:45:18 +0000] \"GET /render/version HTTP/1.1\" 404 153 \"-\" \"Grafana/9.1.6\"\n","level":"error"}
grafana-renderer-1  | {"error":"Error: SyntaxError: Unexpected token '='","level":"error","message":"Browser uncaught exception"}

and Grafana log:

grafana-grafana-1  | logger=rendering renderer=http t=2022-09-24T20:58:49.936907931+02:00 level=error msg="Remote rendering request failed" error="500 Internal Server Error" url="http://grafana:3000/d-solo/B9DLkTmRk/local-system?orgId=1&refresh=30s&from=1664024265904&to=1664045865904&panelId=2&width=1000&height=500&tz=Europe%2FBerlin&render=1"
grafana-grafana-1  | logger=context traceID=00000000000000000000000000000000 userId=1 orgId=1 uname=admin t=2022-09-24T20:58:49.940872841+02:00 level=error msg="Rendering failed." error="remote rendering request failed, status code: 500, status: 500 Internal Server Error"
grafana-grafana-1  | logger=context traceID=00000000000000000000000000000000 userId=1 orgId=1 uname=admin t=2022-09-24T20:58:49.944864936+02:00 level=error msg="Request Completed" method=GET path=/render/d-solo/B9DLkTmRk/local-system status=500 remote_addr=192.168.50.178 time_ms=62416 duration=1m2.416298384s size=1344 referer= traceID=00000000000000000000000000000000 handler=/render/*

I am currently using this docker image: asksven/grafana-image-renderer:1

Perhaps someone has an idea... and yes... we need a supported redender docker image for arm!

Update: Tried hferreira/grafana-image-renderer:latest and it works with 9.1.6 :-) THANKS!

louwrentius commented 1 year ago

I've followed the steps as mentioned by thetravellor https://github.com/grafana/grafana-image-renderer/issues/7#issuecomment-882054172

These where my steps, on a Raspberry Pi 4 running Ubuntu 22.04 LTS.

wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-arm64.tar.xz
tar xf node-v16.18.0-linux-arm64.tar.xz
cd node-v16.18.0-linux-arm64
cp -R * /usr/local/
git clone https://github.com/grafana/grafana-image-renderer
npm install --global yarn
apt install chromium-browser
cd grafana-image-renderer
/usr/local/bin/yarn install --pure-lockfile
/usr/local/bin/yarn run build

I could then run the server like this:

node build/app.js server --port=8081

And I've added the following to the grafana server config (requires stop + start (restart doesn't work))

[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/

Please note that I actually didn't use localhost as I installed the renderer on a separate Pi , not on the Pi running Grafana. That worked totally fine.

Although this may not be right for security reanons, but I could then do what I eventually wanted to do: use curl to periodically render images like this:

curl 'http://user:password@grafana.your.domain:3000/render/d-solo/2rl2foi2w/solar?orgId=1&refresh=1m&from=1666643021187&to=1666729421187&panelId=2&width=1000&height=500&tz=Europe%2FAmsterdam' --output test.png

The fact that it's so easy to run the image renderer on a Raspberry Pi / Arm machine only shows that it shouldn't be that much effort for Grafana to support the renderer on Arm. But if they don't want to assign person-hours on this topic, that's up to them, I'm still grateful for being able to use their software.

careyer commented 1 year ago

... Update: Tried hferreira/grafana-image-renderer:latest and it works with 9.1.6 :-) THANKS!

Sadly there is only a version for arm64 but not for armv7 which I use. Maybe @hferreira could pubish a 32bit version as well?

Update: I upgraded my Pi OS to 64bit kernel... now when trying to pull the :latest docker image I get: "no matching manifest for linux/arm/v8 in the manifest list entries"

Update 2: While there is the possibility to switch the kernel on Pi OS from 32bit to 64bit, the userland stays 32bit unless you install a clean copy of Pi OS 64bit. As such also docker keeps installing a 32bit version of itself and hence cannot run the 64bit conatiner. I bet many people are arround who still use 32bit Pi OS versions since you don't reinstall all your home automation at a regular base. (Wondering: Is there a way to force install a docker 64bit version? I mean the kernel is 64bit... only userland stays at 32bit)

michbeck100 commented 1 year ago

At least for arm64 the changes from https://github.com/grafana/grafana-image-renderer/issues/7#issuecomment-546599598 aren't necessary anymore. The only thing I had to remove was the edge repositories:

--- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,6 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" WORKDIR /usr/src/app

RUN \

Note that this only works for arm64, for armv7 this breaks because chromium cannot be found.

What's still missing is a change to the build pipeline and the support for arm is done.

konstk1 commented 1 year ago

While using the image from docker hub didn't work for me on an aarch64, I simply cloned the repo and rebuilt it on that machine, and it worked without any modifications.

SuperMatt commented 1 year ago

Hey folks, I thought I should chime in an comfirm that just like @konstk1, I too have managed to clone the repo and build directly for ARM without any changes to the codebase. Can we get #397 merged so that we only have to pull the docker image in future? Feels like it should be a quick win.

AgnesToulet commented 1 year ago

Hello! This may be a quick and easy change but merging this would mean for us to officially support it so test it for every releases to ensure that updates to the image renderer are not breaking this image. We'll discuss about it internally.

PavanMadushanka commented 1 year ago

I've followed the steps as mentioned by thetravellor #7 (comment)

These where my steps, on a Raspberry Pi 4 running Ubuntu 22.04 LTS.

wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-arm64.tar.xz
tar xf node-v16.18.0-linux-arm64.tar.xz
cd node-v16.18.0-linux-arm64
cp -R * /usr/local/
git clone https://github.com/grafana/grafana-image-renderer
npm install --global yarn
apt install chromium-browser
cd grafana-image-renderer
/usr/local/bin/yarn install --pure-lockfile
/usr/local/bin/yarn run build

I could then run the server like this:

node build/app.js server --port=8081

And I've added the following to the grafana server config (requires stop + start (restart doesn't work))

[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/

Please note that I actually didn't use localhost as I installed the renderer on a separate Pi , not on the Pi running Grafana. That worked totally fine.

Although this may not be right for security reanons, but I could then do what I eventually wanted to do: use curl to periodically render images like this:

curl 'http://user:password@grafana.your.domain:3000/render/d-solo/2rl2foi2w/solar?orgId=1&refresh=1m&from=1666643021187&to=1666729421187&panelId=2&width=1000&height=500&tz=Europe%2FAmsterdam' --output test.png

The fact that it's so easy to run the image renderer on a Raspberry Pi / Arm machine only shows that it shouldn't be that much effort for Grafana to support the renderer on Arm. But if they don't want to assign person-hours on this topic, that's up to them, I'm still grateful for being able to use their software.

I followed along your steps to setup screenshot feature for R-Pi 3 and thanks for being crisp clear with it. When generating an alert, I see following message in the rendering server, Error while waiting for the panels to load, along with the url and other information and it doesn't attach the screenshot to the email alert. Any thoughts on what might be happening?

I replicated the same alert in an AMD64 system, and it works fine.

anno171986 commented 1 year ago

I've followed the steps as mentioned by thetravellor #7 (comment)

These where my steps, on a Raspberry Pi 4 running Ubuntu 22.04 LTS.

wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-arm64.tar.xz
tar xf node-v16.18.0-linux-arm64.tar.xz
cd node-v16.18.0-linux-arm64
cp -R * /usr/local/
git clone https://github.com/grafana/grafana-image-renderer
npm install --global yarn
apt install chromium-browser
cd grafana-image-renderer
/usr/local/bin/yarn install --pure-lockfile
/usr/local/bin/yarn run build

I could then run the server like this:

node build/app.js server --port=8081

And I've added the following to the grafana server config (requires stop + start (restart doesn't work))

[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/

Please note that I actually didn't use localhost as I installed the renderer on a separate Pi , not on the Pi running Grafana. That worked totally fine.

Although this may not be right for security reanons, but I could then do what I eventually wanted to do: use curl to periodically render images like this:

curl 'http://user:password@grafana.your.domain:3000/render/d-solo/2rl2foi2w/solar?orgId=1&refresh=1m&from=1666643021187&to=1666729421187&panelId=2&width=1000&height=500&tz=Europe%2FAmsterdam' --output test.png

The fact that it's so easy to run the image renderer on a Raspberry Pi / Arm machine only shows that it shouldn't be that much effort for Grafana to support the renderer on Arm. But if they don't want to assign person-hours on this topic, that's up to them, I'm still grateful for being able to use their software.

Hi, thanks for this guide. It seems it works that I can run the server. I change it to port 8090, because I already run a server on port 8081.

I try to get the file via curl, but I didn't get it working. How should the command look like for a lokal machine? I tried: curl 'http://192.168.178.12:3000/render/d/ea623f39-810f-4266-8c1d-796b74051673/temp-vorhersage-morgen?orgId=1&from=1683489583854&to=1683575983855&viewPanel=1' > /opt/iobroker/iobroker-data/tmp/Wettervorhersage_Snapshot.jpg

The file was created, but the only content is <a href="/login">Found</a>.

In the render server log, nothing is stated!

MrRonfo commented 1 year ago

Hi there, should it be useful to the community, playing around the steps proposed by thetravellor https://github.com/grafana/grafana-image-renderer/issues/7#issuecomment-882054172 and louwrentius https://github.com/grafana/grafana-image-renderer/issues/7#issuecomment-1291138279, here are the ones that worked for me on a RPi 4 64-bit to run the renderer plugin inside Grafana (instead of stand-alone server):

  1. Change to root and install Nodejs v16:
sudo su
wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-arm64.tar.xz
tar xf node-v16.18.0-linux-arm64.tar.xz
cd node-v16.18.0-linux-arm64
cp -R * /usr/local/
cd..
rm -rf node-v16.18.0-linux-arm64/
rm node-v16.18.0-linux-arm64.tar.xz
  1. Install image renderer plugin:
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/grafana-image-renderer
cd grafana-image-renderer/
npm install --global yarn
apt install chromium-browser
/usr/local/bin/yarn install --pure-lockfile
/usr/local/bin/yarn run build
cp plugin_start_linux_amd64 plugin_start_linux_arm64
  1. Allow running an unsigned plugin:
nano /etc/grafana/grafana.ini

Change the following property (removing the ";" initial char): allow_loading_unsigned_plugins = grafana-image-renderer

  1. Restart Grafana, check plugin is recognized and loaded:
systemctl restart grafana-server.service
stemctl status grafana-server.service
tail -100f /var/log/grafana/grafana.log
exit

Hope this helps :)

anno171986 commented 1 year ago

Hi there, should it be useful to the community, playing around the steps proposed by thetravellor #7 (comment) and louwrentius #7 (comment), here are the ones that worked for me on a RPi 4 64-bit to run the renderer plugin inside Grafana (instead of stand-alone server):

1. Change to root and install Nodejs v16:
sudo su
wget https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-arm64.tar.xz
tar xf node-v16.18.0-linux-arm64.tar.xz
cd node-v16.18.0-linux-arm64
cp -R * /usr/local/
cd..
rm -rf node-v16.18.0-linux-arm64/
rm node-v16.18.0-linux-arm64.tar.xz
2. Install image renderer plugin:
cd /var/lib/grafana/plugins
git clone https://github.com/grafana/grafana-image-renderer
cd grafana-image-renderer/
npm install --global yarn
apt install chromium-browser
/usr/local/bin/yarn install --pure-lockfile
/usr/local/bin/yarn run build
cp plugin_start_linux_amd64 plugin_start_linux_arm64
3. Allow running an unsigned plugin:
nano /etc/grafana/grafana.ini

Change the following property (removing the ";" initial char): allow_loading_unsigned_plugins = grafana-image-renderer

4. Restart Grafana, check plugin is recognized and loaded:
systemctl restart grafana-server.service
stemctl status grafana-server.service
tail -100f /var/log/grafana/grafana.log
exit

Hope this helps :)

I tried it, but it does not work.

I had already nodejs installed

root@raspberrypi:~# nodejs -v v16.19.1

yarn is folder is /usr/bin/yarn instead of /usr/local/bin/yarn

after changing the grafana.ini I can not enter the grafana webseit with ip:3000. Here is the complete Log

`root@raspberrypi:~# cd /var/lib/grafana/plugins root@raspberrypi:/var/lib/grafana/plugins# git clone https://github.com/grafana/grafana-image-renderer fatal: Zielpfad 'grafana-image-renderer' existiert bereits und ist kein leeres Verzeichnis. root@raspberrypi:/var/lib/grafana/plugins# cd grafana-image-renderer/ root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# npm install --global yarn

changed 1 package, and audited 2 packages in 3s

found 0 vulnerabilities root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# apt install chromium-browser Paketlisten werden gelesen… Fertig Abhängigkeitsbaum wird aufgebaut… Fertig Statusinformationen werden eingelesen… Fertig chromium-browser ist schon die neueste Version (113.0.5672.59-rpt1). 0 aktualisiert, 0 neu installiert, 0 zu entfernen und 95 nicht aktualisiert. root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# /usr/local/bin/yarn install --pure-lockfile bash: /usr/local/bin/yarn: Datei oder Verzeichnis nicht gefunden root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# /usr/bin/yarn install --pure-lockfile yarn install v1.22.19 [1/5] Validating package.json... [2/5] Resolving packages... success Already up-to-date. Done in 1.71s. root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# /usr/bin/yarn run build yarn run v1.22.19 $ tsc Done in 29.90s. root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# cp plugin_start_linux_amd64 plugin_start_linux_arm64 root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# nano /etc/grafana/grafana.ini root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# systemctl restart grafana-server.service root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# stemctl status grafana-server.service bash: stemctl: Kommando nicht gefunden. root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# systemctl status grafana-server.service ● grafana-server.service - Grafana instance Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-05-10 20:12:29 CEST; 1s ago Docs: http://docs.grafana.org Main PID: 9058 (grafana) Tasks: 9 (limit: 4915) CPU: 2.041s CGroup: /system.slice/grafana-server.service └─9058 /usr/share/grafana/bin/grafana server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packaging=deb cfg:default.> Mai 10 20:12:30 raspberrypi grafana[9058]: logger=settings t=2023-05-10T20:12:30.926603668+02:00 level=info msg="Path Data" path=/var/lib/grafana Mai 10 20:12:30 raspberrypi grafana[9058]: logger=settings t=2023-05-10T20:12:30.926720704+02:00 level=info msg="Path Logs" path=/var/log/grafana Mai 10 20:12:30 raspberrypi grafana[9058]: logger=settings t=2023-05-10T20:12:30.926785665+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins Mai 10 20:12:30 raspberrypi grafana[9058]: logger=settings t=2023-05-10T20:12:30.926892738+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning Mai 10 20:12:30 raspberrypi grafana[9058]: logger=settings t=2023-05-10T20:12:30.92696307+02:00 level=info msg="App mode production" Mai 10 20:12:30 raspberrypi grafana[9058]: logger=sqlstore t=2023-05-10T20:12:30.927381731+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 Mai 10 20:12:31 raspberrypi grafana[9058]: logger=migrator t=2023-05-10T20:12:31.052703573+02:00 level=info msg="Starting DB migrations" Mai 10 20:12:31 raspberrypi grafana[9058]: logger=migrator t=2023-05-10T20:12:31.098238513+02:00 level=info msg="migrations completed" performed=0 skipped=574 dur>Mai 10 20:12:31 raspberrypi grafana[9058]: logger=licensing t=2023-05-10T20:12:31.101136654+02:00 level=info msg="Validated license token" appURL=http://localhost>Mai 10 20:12:31 raspberrypi grafana[9058]: logger=secrets t=2023-05-10T20:12:31.104607657+02:00 level=info msg="Envelope encryption state" enabled=true currentpro> root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# systemctl status grafana-server.service ● grafana-server.service - Grafana instance Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2023-05-10 20:12:41 CEST; 9s ago Docs: http://docs.grafana.org Main PID: 9084 (grafana) Tasks: 9 (limit: 4915) CPU: 10.366s CGroup: /system.slice/grafana-server.service └─9084 /usr/share/grafana/bin/grafana server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packaging=deb cfg:default.> Mai 10 20:12:42 raspberrypi grafana[9084]: logger=sqlstore t=2023-05-10T20:12:42.791200307+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 Mai 10 20:12:42 raspberrypi grafana[9084]: logger=migrator t=2023-05-10T20:12:42.931988392+02:00 level=info msg="Starting DB migrations" Mai 10 20:12:42 raspberrypi grafana[9084]: logger=migrator t=2023-05-10T20:12:42.977572484+02:00 level=info msg="migrations completed" performed=0 skipped=574 dur>Mai 10 20:12:42 raspberrypi grafana[9084]: logger=licensing t=2023-05-10T20:12:42.981232151+02:00 level=info msg="Validated license token" appURL=http://localhost>Mai 10 20:12:42 raspberrypi grafana[9084]: logger=secrets t=2023-05-10T20:12:42.984876634+02:00 level=info msg="Envelope encryption state" enabled=true currentpro>Mai 10 20:12:43 raspberrypi grafana[9084]: logger=plugin.loader t=2023-05-10T20:12:43.995574971+02:00 level=info msg="Plugin registered" pluginID=input Mai 10 20:12:44 raspberrypi grafana[9084]: logger=plugin.signature.validator t=2023-05-10T20:12:44.833570987+02:00 level=warn msg="Permitting unsigned plugin. Thi>Mai 10 20:12:44 raspberrypi grafana[9084]: logger=plugin.loader t=2023-05-10T20:12:44.833981684+02:00 level=info msg="Plugin registered" pluginID=grafana-image-re>Mai 10 20:12:44 raspberrypi grafana[9084]: logger=query_data t=2023-05-10T20:12:44.851494736+02:00 level=info msg="Query Service initialization" Mai 10 20:12:44 raspberrypi grafana[9084]: logger=live.push_http t=2023-05-10T20:12:44.871740098+02:00 level=info msg="Live Push Gateway initialization"

root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer# tail -100f /var/log/grafana/grafana.log logger=settings t=2023-05-10T20:12:54.712457689+02:00 level=info msg=Target target=[all] logger=settings t=2023-05-10T20:12:54.712558188+02:00 level=info msg="Path Home" path=/usr/share/grafana logger=settings t=2023-05-10T20:12:54.712624835+02:00 level=info msg="Path Data" path=/var/lib/grafana logger=settings t=2023-05-10T20:12:54.712690537+02:00 level=info msg="Path Logs" path=/var/log/grafana logger=settings t=2023-05-10T20:12:54.712754314+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins logger=settings t=2023-05-10T20:12:54.712841628+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning logger=settings t=2023-05-10T20:12:54.712906664+02:00 level=info msg="App mode production" logger=sqlstore t=2023-05-10T20:12:54.71313792+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 logger=migrator t=2023-05-10T20:12:54.844565418+02:00 level=info msg="Starting DB migrations" logger=migrator t=2023-05-10T20:12:54.887788291+02:00 level=info msg="migrations completed" performed=0 skipped=574 duration=5.42253ms logger=licensing t=2023-05-10T20:12:54.891048261+02:00 level=info msg="Validated license token" appURL=http://localhost:3000/ source=disk status=NotFound logger=secrets t=2023-05-10T20:12:54.894722002+02:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1 logger=plugin.loader t=2023-05-10T20:12:55.911736161+02:00 level=info msg="Plugin registered" pluginID=input logger=plugin.signature.validator t=2023-05-10T20:12:56.782992098+02:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginID=grafana-image-renderer logger=plugin.loader t=2023-05-10T20:12:56.783761179+02:00 level=info msg="Plugin registered" pluginID=grafana-image-renderer logger=query_data t=2023-05-10T20:12:56.803426515+02:00 level=info msg="Query Service initialization" logger=live.push_http t=2023-05-10T20:12:56.82508534+02:00 level=info msg="Live Push Gateway initialization" logger=infra.usagestats.collector t=2023-05-10T20:13:05.00929056+02:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2 logger=server t=2023-05-10T20:13:05.009678924+02:00 level=info msg="Writing PID file" path=/run/grafana/grafana-server.pid pid=9111 logger=provisioning.alerting t=2023-05-10T20:13:05.012816508+02:00 level=info msg="starting to provision alerting" logger=provisioning.alerting t=2023-05-10T20:13:05.013000301+02:00 level=info msg="finished to provision alerting" logger=modules t=2023-05-10T20:13:05.013797215+02:00 level=warn msg="No modules registered..." logger=remote-ruler t=2023-05-10T20:13:05.014059285+02:00 level=warn msg="you have enabled the remote ruler but the grpc server is not enabled - the remote ruler won't run." logger=report t=2023-05-10T20:13:05.014521816+02:00 level=warn msg="Scheduling and sending of reports disabled, SMTP is not configured and enabled. Configure SMTP to enable." logger=secret.migration t=2023-05-10T20:13:05.015313248+02:00 level=error msg="Server lock for secret migration already exists" logger=grafanaStorageLogger t=2023-05-10T20:13:05.025263897+02:00 level=info msg="storage starting" logger=http.server t=2023-05-10T20:13:05.025683409+02:00 level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket= logger=ngalert.state.manager t=2023-05-10T20:13:05.026108532+02:00 level=info msg="Warming state cache for startup" logger=server t=2023-05-10T20:13:05.030194064+02:00 level=error msg="Stopped background service" service=rendering.RenderingService reason="fork/exec /var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_arm: no such file or directory" logger=tracing t=2023-05-10T20:13:05.03126153+02:00 level=info msg="Closing tracing" logger=grafana.update.checker t=2023-05-10T20:13:05.032503808+02:00 level=error msg="Update check failed" error="failed to get latest.json repo from github.com: Get \"https://raw.githubusercontent.com/grafana/grafana/main/latest.json\": context canceled" duration=3.320136ms logger=infra.usagestats.collector t=2023-05-10T20:13:05.03956948+02:00 level=error msg="Failed to get system stats" error="context canceled" logger=ngalert.state.manager t=2023-05-10T20:13:05.03964635+02:00 level=error msg="Unable to fetch orgIds" error="context canceled" logger=ngalert.state.manager t=2023-05-10T20:13:05.040094269+02:00 level=info msg="State cache has been initialized" states=0 duration=13.986051ms logger=ngalert.multiorg.alertmanager t=2023-05-10T20:13:05.040718389+02:00 level=info msg="starting MultiOrg Alertmanager" logger=ticker t=2023-05-10T20:13:05.040838036+02:00 level=info msg=starting first_tick=2023-05-10T20:13:10+02:00 logger=settings t=2023-05-10T20:13:06.470709204+02:00 level=info msg="Starting Grafana" version=9.5.1 commit=bc353e4b2d branch=HEAD compiled=2023-04-24T18:27:01+02:00 logger=settings t=2023-05-10T20:13:06.47165206+02:00 level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead." logger=settings t=2023-05-10T20:13:06.471794539+02:00 level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini logger=settings t=2023-05-10T20:13:06.471871983+02:00 level=info msg="Config loaded from" file=/etc/grafana/grafana.ini logger=settings t=2023-05-10T20:13:06.471944537+02:00 level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana" logger=settings t=2023-05-10T20:13:06.472017314+02:00 level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana" logger=settings t=2023-05-10T20:13:06.472086443+02:00 level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins" logger=settings t=2023-05-10T20:13:06.472152904+02:00 level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning" logger=settings t=2023-05-10T20:13:06.472219459+02:00 level=info msg=Target target=[all] logger=settings t=2023-05-10T20:13:06.472313735+02:00 level=info msg="Path Home" path=/usr/share/grafana logger=settings t=2023-05-10T20:13:06.472383012+02:00 level=info msg="Path Data" path=/var/lib/grafana logger=settings t=2023-05-10T20:13:06.472458474+02:00 level=info msg="Path Logs" path=/var/log/grafana logger=settings t=2023-05-10T20:13:06.472524399+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins logger=settings t=2023-05-10T20:13:06.472591842+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning logger=settings t=2023-05-10T20:13:06.472660138+02:00 level=info msg="App mode production" logger=sqlstore t=2023-05-10T20:13:06.472902023+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 logger=migrator t=2023-05-10T20:13:06.599502773+02:00 level=info msg="Starting DB migrations" logger=migrator t=2023-05-10T20:13:06.643477935+02:00 level=info msg="migrations completed" performed=0 skipped=574 duration=5.623713ms logger=licensing t=2023-05-10T20:13:06.646355966+02:00 level=info msg="Validated license token" appURL=http://localhost:3000/ source=disk status=NotFound logger=secrets t=2023-05-10T20:13:06.649243979+02:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1 logger=plugin.loader t=2023-05-10T20:13:07.648743531+02:00 level=info msg="Plugin registered" pluginID=input logger=plugin.signature.validator t=2023-05-10T20:13:08.451510843+02:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginID=grafana-image-renderer logger=plugin.loader t=2023-05-10T20:13:08.451854116+02:00 level=info msg="Plugin registered" pluginID=grafana-image-renderer logger=query_data t=2023-05-10T20:13:08.465232084+02:00 level=info msg="Query Service initialization" logger=live.push_http t=2023-05-10T20:13:08.481404437+02:00 level=info msg="Live Push Gateway initialization" logger=infra.usagestats.collector t=2023-05-10T20:13:16.702983709+02:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2 logger=server t=2023-05-10T20:13:16.703408258+02:00 level=info msg="Writing PID file" path=/run/grafana/grafana-server.pid pid=9136 logger=provisioning.alerting t=2023-05-10T20:13:16.706868244+02:00 level=info msg="starting to provision alerting" logger=provisioning.alerting t=2023-05-10T20:13:16.707021927+02:00 level=info msg="finished to provision alerting" logger=remote-ruler t=2023-05-10T20:13:16.707834174+02:00 level=warn msg="you have enabled the remote ruler but the grpc server is not enabled - the remote ruler won't run." logger=report t=2023-05-10T20:13:16.709162451+02:00 level=warn msg="Scheduling and sending of reports disabled, SMTP is not configured and enabled. Configure SMTP to enable." logger=secret.migration t=2023-05-10T20:13:16.709390707+02:00 level=error msg="Server lock for secret migration already exists" logger=modules t=2023-05-10T20:13:16.711829819+02:00 level=warn msg="No modules registered..." logger=grafanaStorageLogger t=2023-05-10T20:13:16.726364178+02:00 level=info msg="storage starting" logger=http.server t=2023-05-10T20:13:16.728817661+02:00 level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket= logger=ngalert.state.manager t=2023-05-10T20:13:16.729029306+02:00 level=info msg="Warming state cache for startup" logger=ngalert.state.manager t=2023-05-10T20:13:16.733619127+02:00 level=info msg="State cache has been initialized" states=0 duration=4.585414ms logger=ticker t=2023-05-10T20:13:16.73458915+02:00 level=info msg=starting first_tick=2023-05-10T20:13:20+02:00 logger=ngalert.multiorg.alertmanager t=2023-05-10T20:13:16.73484235+02:00 level=info msg="starting MultiOrg Alertmanager" logger=server t=2023-05-10T20:13:16.73741083+02:00 level=error msg="Stopped background service" service=rendering.RenderingService reason="fork/exec /var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_arm: no such file or directory" logger=grafana.update.checker t=2023-05-10T20:13:16.745194956+02:00 level=error msg="Update check failed" error="failed to get latest.json repo from github.com: Get \"https://raw.githubusercontent.com/grafana/grafana/main/latest.json\": context canceled" duration=9.439768ms logger=tracing t=2023-05-10T20:13:16.745720744+02:00 level=info msg="Closing tracing" logger=ticker t=2023-05-10T20:13:16.747132668+02:00 level=info msg=stopped last_tick=2023-05-10T20:13:10+02:00 logger=infra.usagestats.collector t=2023-05-10T20:13:16.753020711+02:00 level=error msg="Failed to get system stats" error="context canceled" logger=settings t=2023-05-10T20:13:18.205395471+02:00 level=info msg="Starting Grafana" version=9.5.1 commit=bc353e4b2d branch=HEAD compiled=2023-04-24T18:27:01+02:00 logger=settings t=2023-05-10T20:13:18.208067802+02:00 level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead." logger=settings t=2023-05-10T20:13:18.208792606+02:00 level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini logger=settings t=2023-05-10T20:13:18.209379801+02:00 level=info msg="Config loaded from" file=/etc/grafana/grafana.ini logger=settings t=2023-05-10T20:13:18.209886553+02:00 level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana" logger=settings t=2023-05-10T20:13:18.210385435+02:00 level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana" logger=settings t=2023-05-10T20:13:18.210790947+02:00 level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins" logger=settings t=2023-05-10T20:13:18.21115809+02:00 level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning" logger=settings t=2023-05-10T20:13:18.211506603+02:00 level=info msg=Target target=[all] logger=settings t=2023-05-10T20:13:18.211954523+02:00 level=info msg="Path Home" path=/usr/share/grafana logger=settings t=2023-05-10T20:13:18.212347202+02:00 level=info msg="Path Data" path=/var/lib/grafana logger=settings t=2023-05-10T20:13:18.212693716+02:00 level=info msg="Path Logs" path=/var/log/grafana logger=settings t=2023-05-10T20:13:18.213046025+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins logger=settings t=2023-05-10T20:13:18.213397816+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning logger=settings t=2023-05-10T20:13:18.21382131+02:00 level=info msg="App mode production" logger=sqlstore t=2023-05-10T20:13:18.214511744+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 logger=migrator t=2023-05-10T20:13:18.355428498+02:00 level=info msg="Starting DB migrations" logger=migrator t=2023-05-10T20:13:18.399213093+02:00 level=info msg="migrations completed" performed=0 skipped=574 duration=5.726564ms logger=licensing t=2023-05-10T20:13:18.402734337+02:00 level=info msg="Validated license token" appURL=http://localhost:3000/ source=disk status=NotFound logger=secrets t=2023-05-10T20:13:18.406169935+02:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1 logger=plugin.loader t=2023-05-10T20:13:19.441975913+02:00 level=info msg="Plugin registered" pluginID=input logger=plugin.signature.validator t=2023-05-10T20:13:20.230898649+02:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginID=grafana-image-renderer logger=plugin.loader t=2023-05-10T20:13:20.23185845+02:00 level=info msg="Plugin registered" pluginID=grafana-image-renderer logger=query_data t=2023-05-10T20:13:20.247889102+02:00 level=info msg="Query Service initialization" logger=live.push_http t=2023-05-10T20:13:20.265169644+02:00 level=info msg="Live Push Gateway initialization" logger=infra.usagestats.collector t=2023-05-10T20:13:28.647487212+02:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2 logger=server t=2023-05-10T20:13:28.647953187+02:00 level=info msg="Writing PID file" path=/run/grafana/grafana-server.pid pid=9163 logger=provisioning.alerting t=2023-05-10T20:13:28.650785405+02:00 level=info msg="starting to provision alerting" logger=provisioning.alerting t=2023-05-10T20:13:28.650982142+02:00 level=info msg="finished to provision alerting" logger=ngalert.state.manager t=2023-05-10T20:13:28.651790723+02:00 level=info msg="Warming state cache for startup" logger=ngalert.state.manager t=2023-05-10T20:13:28.65326872+02:00 level=info msg="State cache has been initialized" states=0 duration=1.470849ms logger=ticker t=2023-05-10T20:13:28.653992006+02:00 level=info msg=starting first_tick=2023-05-10T20:13:30+02:00 logger=ngalert.multiorg.alertmanager t=2023-05-10T20:13:28.655008713+02:00 level=info msg="starting MultiOrg Alertmanager" logger=modules t=2023-05-10T20:13:28.655557242+02:00 level=warn msg="No modules registered..." logger=server t=2023-05-10T20:13:28.658830842+02:00 level=error msg="Stopped background service" service=rendering.RenderingService reason="fork/exec /var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_arm: no such file or directory" logger=ticker t=2023-05-10T20:13:28.660509392+02:00 level=info msg=stopped last_tick=2023-05-10T20:13:20+02:00 logger=grafana.update.checker t=2023-05-10T20:13:28.660743221+02:00 level=error msg="Update check failed" error="failed to get latest.json repo from github.com: Get \"https://raw.githubusercontent.com/grafana/grafana/main/latest.json\": context canceled" duration=2.583647ms logger=remote-ruler t=2023-05-10T20:13:28.661482377+02:00 level=warn msg="you have enabled the remote ruler but the grpc server is not enabled - the remote ruler won't run." logger=http.server t=2023-05-10T20:13:28.666446786+02:00 level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket= logger=settings t=2023-05-10T20:13:30.18105265+02:00 level=info msg="Starting Grafana" version=9.5.1 commit=bc353e4b2d branch=HEAD compiled=2023-04-24T18:27:01+02:00 logger=settings t=2023-05-10T20:13:30.183378301+02:00 level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead." logger=settings t=2023-05-10T20:13:30.184010348+02:00 level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini logger=settings t=2023-05-10T20:13:30.184693912+02:00 level=info msg="Config loaded from" file=/etc/grafana/grafana.ini logger=settings t=2023-05-10T20:13:30.185213034+02:00 level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana" logger=settings t=2023-05-10T20:13:30.185638213+02:00 level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana" logger=settings t=2023-05-10T20:13:30.186009503+02:00 level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins" logger=settings t=2023-05-10T20:13:30.1864622+02:00 level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"logger=settings t=2023-05-10T20:13:30.186885972+02:00 level=info msg=Target target=[all] logger=settings t=2023-05-10T20:13:30.187293003+02:00 level=info msg="Path Home" path=/usr/share/grafana logger=settings t=2023-05-10T20:13:30.187671164+02:00 level=info msg="Path Data" path=/var/lib/grafana logger=settings t=2023-05-10T20:13:30.187992234+02:00 level=info msg="Path Logs" path=/var/log/grafana logger=settings t=2023-05-10T20:13:30.188352117+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins logger=settings t=2023-05-10T20:13:30.188697094+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning logger=settings t=2023-05-10T20:13:30.189034163+02:00 level=info msg="App mode production" logger=sqlstore t=2023-05-10T20:13:30.189690875+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 logger=migrator t=2023-05-10T20:13:30.357254269+02:00 level=info msg="Starting DB migrations" logger=migrator t=2023-05-10T20:13:30.400262898+02:00 level=info msg="migrations completed" performed=0 skipped=574 duration=5.680212ms logger=licensing t=2023-05-10T20:13:30.403811383+02:00 level=info msg="Validated license token" appURL=http://localhost:3000/ source=disk status=NotFound logger=secrets t=2023-05-10T20:13:30.407070539+02:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1 logger=plugin.loader t=2023-05-10T20:13:31.415299309+02:00 level=info msg="Plugin registered" pluginID=input logger=plugin.signature.validator t=2023-05-10T20:13:32.250444474+02:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginID=grafana-image-renderer logger=plugin.loader t=2023-05-10T20:13:32.250910949+02:00 level=info msg="Plugin registered" pluginID=grafana-image-renderer logger=query_data t=2023-05-10T20:13:32.265268794+02:00 level=info msg="Query Service initialization" logger=live.push_http t=2023-05-10T20:13:32.282217064+02:00 level=info msg="Live Push Gateway initialization" logger=infra.usagestats.collector t=2023-05-10T20:13:40.603675726+02:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2 logger=server t=2023-05-10T20:13:40.604029629+02:00 level=info msg="Writing PID file" path=/run/grafana/grafana-server.pid pid=9192 logger=provisioning.alerting t=2023-05-10T20:13:40.607088751+02:00 level=info msg="starting to provision alerting" logger=provisioning.alerting t=2023-05-10T20:13:40.607278711+02:00 level=info msg="finished to provision alerting" logger=modules t=2023-05-10T20:13:40.607734686+02:00 level=warn msg="No modules registered..." logger=remote-ruler t=2023-05-10T20:13:40.6082454+02:00 level=warn msg="you have enabled the remote ruler but the grpc server is not enabled - the remote ruler won't run." logger=server t=2023-05-10T20:13:40.609778082+02:00 level=error msg="Stopped background service" service=rendering.RenderingService reason="fork/exec /var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_arm: no such file or directory" logger=auth t=2023-05-10T20:13:40.611312985+02:00 level=error msg="failed to lock and execute cleanup of expired auth token" error="context canceled" logger=infra.usagestats.collector t=2023-05-10T20:13:40.616305449+02:00 level=error msg="Failed to get system stats" error="context canceled" logger=http.server t=2023-05-10T20:13:40.62058335+02:00 level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket= logger=settings t=2023-05-10T20:13:42.023302844+02:00 level=info msg="Starting Grafana" version=9.5.1 commit=bc353e4b2d branch=HEAD compiled=2023-04-24T18:27:01+02:00 logger=settings t=2023-05-10T20:13:42.024331144+02:00 level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead." logger=settings t=2023-05-10T20:13:42.024511215+02:00 level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini logger=settings t=2023-05-10T20:13:42.024603214+02:00 level=info msg="Config loaded from" file=/etc/grafana/grafana.ini logger=settings t=2023-05-10T20:13:42.024679583+02:00 level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana" logger=settings t=2023-05-10T20:13:42.024749545+02:00 level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana" logger=settings t=2023-05-10T20:13:42.024821377+02:00 level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins" logger=settings t=2023-05-10T20:13:42.024894506+02:00 level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning" logger=settings t=2023-05-10T20:13:42.024980431+02:00 level=info msg=Target target=[all] logger=settings t=2023-05-10T20:13:42.025130595+02:00 level=info msg="Path Home" path=/usr/share/grafana logger=settings t=2023-05-10T20:13:42.025208279+02:00 level=info msg="Path Data" path=/var/lib/grafana logger=settings t=2023-05-10T20:13:42.025283296+02:00 level=info msg="Path Logs" path=/var/log/grafana logger=settings t=2023-05-10T20:13:42.025357388+02:00 level=info msg="Path Plugins" path=/var/lib/grafana/plugins logger=settings t=2023-05-10T20:13:42.02543272+02:00 level=info msg="Path Provisioning" path=/etc/grafana/provisioning logger=settings t=2023-05-10T20:13:42.025507645+02:00 level=info msg="App mode production" logger=sqlstore t=2023-05-10T20:13:42.025762827+02:00 level=info msg="Connecting to DB" dbtype=sqlite3 logger=migrator t=2023-05-10T20:13:42.157801938+02:00 level=info msg="Starting DB migrations" logger=migrator t=2023-05-10T20:13:42.206349156+02:00 level=info msg="migrations completed" performed=0 skipped=574 duration=6.017505ms logger=licensing t=2023-05-10T20:13:42.209731588+02:00 level=info msg="Validated license token" appURL=http://localhost:3000/ source=disk status=NotFound logger=secrets t=2023-05-10T20:13:42.213282833+02:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1 logger=plugin.loader t=2023-05-10T20:13:43.196680196+02:00 level=info msg="Plugin registered" pluginID=input logger=plugin.signature.validator t=2023-05-10T20:13:44.050782024+02:00 level=warn msg="Permitting unsigned plugin. This is not recommended" pluginID=grafana-image-renderer logger=plugin.loader t=2023-05-10T20:13:44.051469421+02:00 level=info msg="Plugin registered" pluginID=grafana-image-renderer logger=query_data t=2023-05-10T20:13:44.066953677+02:00 level=info msg="Query Service initialization" logger=live.push_http t=2023-05-10T20:13:44.090473298+02:00 level=info msg="Live Push Gateway initialization" ^C root@raspberrypi:/var/lib/grafana/plugins/grafana-image-renderer#`

When I change the grafana.ini back, then atleast i could visit the website. Buth when I click on share on a Dashboard it displays "Image renderer plugin not installed"

Do you have any tip?

fatbasstard commented 1 year ago

Got an Apple M1 Pro myself and we're running Grafana on Linux containers (well, AWS Fargate to be precise) but I'd like to "test" my Grafana image locally which is currently not possible:

Error: ✗ *rendering.RenderingService run error: fork/exec /var/lib/grafana-plugins/grafana-image-renderer/plugin_start_linux_arm64: no such file or directory

Any news on ARM support?

eliaz commented 1 year ago

Im running this Dockerfile on Pi4 successfully

FROM node:16-alpine as builder

WORKDIR /tmp

# Install curl and unzip
RUN apk add --no-cache curl unzip

# Download and unzip the archive
RUN curl -L -o grafana-image-renderer.zip https://github.com/grafana/grafana-image-renderer/archive/refs/tags/v3.7.1.zip \
    && unzip grafana-image-renderer.zip \
    && mv grafana-image-renderer-3.7.1 grafana-image-renderer

# Build the final image from node
FROM node:16-alpine

# Copy the unzipped files from the builder stage
COPY --from=builder /tmp/grafana-image-renderer /grafana-image-renderer

WORKDIR /grafana-image-renderer

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
RUN apk add --no-cache udev ttf-opensans unifont chromium ca-certificates dumb-init
ENV CHROME_BIN="/usr/bin/chromium-browser"

# Run the build commands
RUN yarn install --pure-lockfile
RUN yarn run build

# Copy the default.json file to config.json
COPY --from=builder /tmp/grafana-image-renderer/default.json /grafana-image-renderer/config.json

EXPOSE 8081

CMD [ "node", "build/app.js", "server", "--config=config.json"]
louwrentius commented 1 year ago

@eliaz thank you for sharing. I got the container working but I had to configure grafana to tell the renderer to use the public IP of the grafana host, not localhost. I'm a bit new to containers so maybe it could have been resolved in another manner. The key issue is that the grafana-render container could not do a 'callback' to grafana.

The original non-container installation process I've documented earlier in this thread was hosed because On Ubuntu chromium is installed through snap and snap started to fill my /tmp directory with garbage, causing a write load on the SD card, causing all kinds of intermittent issues. So I snapped and now I'm in the process of moving everything away from Ubuntu to Debian.

adamwilner commented 1 year ago

Any progress on this? ARM support is critically important for us

thirtyfiveo commented 1 year ago

@eliaz thank you for sharing. I got the container working but I had to configure grafana to tell the renderer to use the public IP of the grafana host, not localhost. I'm a bit new to containers so maybe it could have been resolved in another manner. The key issue is that the grafana-render container could not do a 'callback' to grafana.

@louwrentius try appending the following to your docker-compose.yml file at the service of the renderer:

    extra_hosts:
      - host.docker.internal:host-gateway

With this you should be able to use the following in the [rendering] section of your grafana.ini file:

callback_url = http://host.docker.internal:3000

In a non-productive environment, you could also try something like network_mode: "host" (or network: "host").

truehhart commented 1 year ago

For anyone looking for a copy-paste BYO solution, I've modified the Dockerfile kindly provided by @eliaz to be a little slimmer (based on the official Dockerfile provided by Grafana). It works just the same, but the resulting image is around 25% smaller (326MB vs 439MB)

FROM node:16-alpine AS base

ENV CHROME_BIN="/usr/bin/chromium-browser"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
ENV IMAGE_RENDERER_SOURCE_VERSION="3.7.1"

WORKDIR /usr/src/app
RUN apk --no-cache upgrade \
    && apk add --no-cache udev ttf-opensans unifont chromium ca-certificates dumb-init \
    && rm -rf /tmp/*

FROM base as build
RUN apk add --no-cache curl unzip
RUN curl -L -o grafana-image-renderer.zip https://github.com/grafana/grafana-image-renderer/archive/refs/tags/v$IMAGE_RENDERER_SOURCE_VERSION.zip \
    && unzip grafana-image-renderer.zip \
    && mv grafana-image-renderer-$IMAGE_RENDERER_SOURCE_VERSION grafana-image-renderer \
    && rm -f grafana-image-renderer.zip
WORKDIR /usr/src/app/grafana-image-renderer
RUN yarn install --pure-lockfile
RUN yarn run build

FROM base
ENV NODE_ENV=production
COPY --from=build /usr/src/app/grafana-image-renderer/node_modules node_modules
COPY --from=build /usr/src/app/grafana-image-renderer/build build
COPY --from=build /usr/src/app/grafana-image-renderer/proto proto
COPY --from=build /usr/src/app/grafana-image-renderer/default.json config.json
COPY --from=build /usr/src/app/grafana-image-renderer/plugin.json plugin.json

CMD [ "node", "build/app.js", "server", "--config=config.json"]
eliaz commented 1 year ago

For anyone looking for a copy-paste BYO solution, I've modified the Dockerfile kindly provided by @eliaz to be a little slimmer (based on the official Dockerfile provided by Grafana). It works just the same, but the resulting image is around 25% smaller (326MB vs 439MB)

FROM node:16-alpine AS base

ENV CHROME_BIN="/usr/bin/chromium-browser"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
ENV IMAGE_RENDERER_SOURCE_VERSION="3.7.1"

WORKDIR /usr/src/app
RUN apk --no-cache upgrade \
    && apk add --no-cache udev ttf-opensans unifont chromium ca-certificates dumb-init \
    && rm -rf /tmp/*

FROM base as build
RUN apk add --no-cache curl unzip
RUN curl -L -o grafana-image-renderer.zip https://github.com/grafana/grafana-image-renderer/archive/refs/tags/v$IMAGE_RENDERER_SOURCE_VERSION.zip \
    && unzip grafana-image-renderer.zip \
    && mv grafana-image-renderer-$IMAGE_RENDERER_SOURCE_VERSION grafana-image-renderer \
    && rm -f grafana-image-renderer.zip
WORKDIR /usr/src/app/grafana-image-renderer
RUN yarn install --pure-lockfile
RUN yarn run build

FROM base
ENV NODE_ENV=production
COPY --from=build /usr/src/app/grafana-image-renderer/node_modules node_modules
COPY --from=build /usr/src/app/grafana-image-renderer/build build
COPY --from=build /usr/src/app/grafana-image-renderer/proto proto
COPY --from=build /usr/src/app/grafana-image-renderer/default.json config.json
COPY --from=build /usr/src/app/grafana-image-renderer/plugin.json plugin.json

CMD [ "node", "build/app.js", "server", "--config=config.json"]

Sweet, "My" solutions was actualy done with a few iterations in gpt4-code interpreter, not me...nice to see humans are still superior!

fatbasstard commented 6 months ago

Any update from the "official" side? The issue is over 5 years old and pretty surprising that this is not implemented yet. Especially now Apple is having the M1/M2 laptops..

michbeck100 commented 6 months ago

The ARM64 build exists since a few months. What are you missing? I would say this issue can be closed.

careyer commented 6 months ago

The ARM64 build exists since a few months. What are you missing? I would say this issue can be closed.

Sadly there is still no solution for ARM 32bit: This is a bit of a pitty for long term users and fans that are stuck on an older hardware (e.g. a Raspberry Pi3 based setup)

fatbasstard commented 6 months ago

The ARM64 build exists since a few months. What are you missing? I would say this issue can be closed.

Well: https://github.com/grafana/grafana-image-renderer/releases/tag/v3.10.0

Unless I see the Asset in the releases I do not consider it to be released/supported: https://github.com/grafana/grafana-image-renderer/releases/tag/v3.10.0

Roberto6969 commented 6 months ago

The ARM64 build exists since a few months. What are you missing? I would say this issue can be closed.

I'm afraid I've missed something. Would you be so kind and tell me where can I get ARM64 compatible source?

Im my Grafana container: 083904712fad:/usr/share/grafana# grafana cli plugins install grafana-image-renderer Error: ✗ [plugin.archNotFound] grafana-image-renderer is not compatible with your system architecture: linux-arm64 From specs@github: Supported operating systems Linux (x64) Windows (x64) Mac OS X (x64

Thank You Robert