fr-ser / grafana-sqlite-datasource

Grafana Plugin to enable SQLite as a Datasource
Apache License 2.0
124 stars 17 forks source link

Running on ARM doesn't work w/o violating signature #17

Closed mgeske closed 3 years ago

mgeske commented 3 years ago

Hi, thanks a lot for creating this plugin!

Unfortunately, it seems that in at least the latest release, the plugin can no longer be run on ARM without having to modify it (and thus breaking the signature). In particular, the following section from the readme:

Currently the ARM7 build is named like this [gpx_..._arm]

no longer applies, as the ARM7 build is now named ..._arm7. If I rename it to ..._arm, then the signature is no longer valid.

Would it be possible to create a shell script with the ..._arm name to do the branching based on the architecture? E.g., something along the following lines:

#!/bin/sh
# gpx_sqlite-datasource_linux_arm
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
suffix=""
case "$(uname -m)" in
  armv6*)
    suffix=arm6
    ;;
  armv7*)
    suffix=arm7
    ;;
  *)
    echo >&2 "Unknown machine type $(uname -m)."
    exit 1
    ;;
esac
exec "${SCRIPT_DIR}/gpx_sqlite-datasource_linux_${suffix}" "$@"

Would that work? Would be great if some fix for this issue could be released in the near future. Many thanks!

fr-ser commented 3 years ago

Have you tried using the shell script? When I tested on my (non-arm machine) I could not replace the compiled plugin with the shell script. I received the following error

lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="Could not find executor for data source type: frser-sqlite-datasource" remote_addr=172.20.0.1

I also asked the question how to handle support in the grafana community but had no luck so far: https://community.grafana.com/t/build-backend-plugin-for-raspberrypi-zero-w-arm6l/37795/5

I guess I will do the following for now. Rename (and resign) ..._arm7 to ..._arm, so that the newer Raspberry models are supported. I will also publish an arm6 version and sign it. This version will only be available through Github for now (manual installation). What do you think?

fr-ser commented 3 years ago

Could you take a look at this? https://github.com/fr-ser/grafana-sqlite-datasource/releases/tag/v0.2.3-rc1

mgeske commented 3 years ago

No, I didn't try the script, it was just an idea...thanks for the quick fix, I just tried it and it worked! :)

fr-ser commented 3 years ago

Great. I published a final release (v0.2.3) and hope ARM support works now. If there are still problems just answer here and I'll reopen the issue