Skip to content

fix(grafana): run entrypoint with POSIX sh - #9312

Merged
klesh merged 1 commit into
apache:mainfrom
DoDiODev:pr/grafana-posix-entrypoint
Nov 6, 2026
Merged

klesh merged 1 commit into
apache:mainfrom
DoDiODev:pr/grafana-posix-entrypoint

Conversation

@DoDiODev

@DoDiODev DoDiODev commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Pre Checklist

Please complete ALL items in this checklist, and remove before submitting

  • I have read through the Contributing Documentation.
  • I have added relevant tests.
  • I have added relevant documentation. (n/a: no user-facing behaviour change; the new script documents its usage in its header)
  • I will add labels to the PR, such as pr-type/bug-fix, pr-type/feature-development, etc.

Summary

Since the bump to grafana/grafana:13.3.0 (#9295) the devlake-dashboard image no longer starts:

exec /entrypoint.sh: no such file or directory

The 13.3.0 base image (Alpine/busybox) no longer ships bash, but grafana/scripts/entrypoint.sh used #!/bin/bash.

  • Fix: the entrypoint now runs under POSIX /bin/sh. Its only bashism ($'\n' in a parameter expansion) is replaced by a portable equivalent. This change does not add bash to the image.
  • Test: new grafana/scripts/smoke-test.sh <image> [mysql|postgresql] starts the image next to a throwaway database. It checks that the container keeps running, /api/health is OK, the entrypoint creates the DevLake datasource, and the datasource health check reaches the database. It only uses uniquely named containers/network and removes them afterwards.
  • CI: new grafana-image-smoke-test.yml runs on pull requests touching grafana/** and builds the image and runs the smoke test against MySQL and PostgreSQL. A future base-image bump (e.g. from Dependabot) that breaks startup would then fail before merge.

Does this close any open issues?

Regression from #9295; no separate issue.

Screenshots

n/a

Other Information

Validation:

  • grafana/scripts/smoke-test.sh <image built from main> postgresql → failed as expected (grafana container exited (exit code 255), exec /entrypoint.sh: no such file or directory).
  • grafana/scripts/smoke-test.sh <image built from this branch> mysql → passed.
  • grafana/scripts/smoke-test.sh <image built from this branch> postgresql → passed.
  • shellcheck grafana/scripts/smoke-test.sh grafana/scripts/entrypoint.sh → passed.
  • CI on the fork, including both smoke-test jobs: https://github.com/DoDiODev/devlake/actions/runs/41608549077 (all green).

grafana/grafana:13.3.0 no longer ships bash, so the image failed to start
with "exec /entrypoint.sh: no such file or directory". Switch the shebang
to /bin/sh and replace the only bashism ($'\n').

Add grafana/scripts/smoke-test.sh plus a pull_request workflow that builds
the image and checks that it starts and creates a healthy datasource
against MySQL and PostgreSQL, so base image bumps that break startup are
caught before merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@klesh klesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.
Thanks for your contribution.

@klesh
klesh merged commit 799147f into apache:main Nov 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants