Skip to content

feat(grafana): bundle manifest-declared plugins for offline deployment - #792

Open
diogomrpr wants to merge 2 commits into
criticalmanufacturing:developmentfrom
diogomrpr:feature/grafana-offline-plugins
Open

diogomrpr wants to merge 2 commits into
criticalmanufacturing:developmentfrom
diogomrpr:feature/grafana-offline-plugins

Conversation

@diogomrpr

@diogomrpr diogomrpr commented Sep 16, 2026

Copy link
Copy Markdown

What was done

Declare exact Grafana plugin versions in one cmfpackage.json and deploy them alongside provisioning files from one Grafana ZIP, without changing EnvManager, rebuilding the image or introducing a companion package.

  • cmf build and cmf restore acquire and verify distributions from the Grafana catalog, HTTPS mirrors or local ZIPs. cmf pack verifies prepared inputs and never downloads plugins. Stale/corrupt preparation fails; dry runs do not mutate it.
  • Add optional grafanaPluginsTargetPath, defaulting to /data/grafana/plugins. Preserve the exact custom directory, independently of the build host.
  • Fix deployment routing: the CMF entrypoint ignores per-step DeployFiles.targetDirectory. The generated manifest now sets package-level targetLayerDirectory: /, with relative ZIP entries beneath data/grafana/plugins/<id>/ (or the custom destination) and etc/grafana/provisioning/. Extraction steps are narrowly scoped, not a blanket extraction at /.
  • Preserve provisioning step order, expand TaggedFile patterns to explicit packaged paths, and rebase TransformFile destinations while retaining source-only transformation entries. Reject unsafe/colliding paths and unsupported steps before writing output.
  • Preserve distribution bytes, signature files and executable permissions, including Windows-built ZIPs. Unrelated image plugins remain intact. A same-ID installation overwrites matching files but does not remove obsolete files; removing a declaration is not an uninstall.
  • Keep legacy packaging unchanged when no plugins are declared, retain normal CMF dependency handling, and exclude preparation state from output.
  • Retain the Windows npm bundled-copy fix: bounded/silent Robocopy, accepted success statuses and propagated failures.
  • Update the manifest reference, scaffolded README and changelog with runtime/offline settings. The observed Grafana 12.0.4 runtime also needs GF_PLUGINS_PREINSTALL_DISABLED=true; empty GF_INSTALL_PLUGINS alone does not stop its background preinstaller.

Dependencies

No new library dependencies or EnvManager changes. The generated layout targets the existing Linux CMF entrypoint, with provisioning at /etc/grafana/provisioning; Grafana's plugin search path must match the configured destination. Signature verification remains enabled. Runtime environment variables and network restrictions are deployment responsibilities, not changes applied by the CLI. The separate ResourceMonitor deployment-manifest edit is not part of this PR.

Validation checklist

  • Code validation — selected regression tests and local build passed; historical broad-suite limitations are recorded below.
  • Integration test run provided — installation/query logs were reviewed, but a linked complete offline/restart run is still required.
  • Main WorkItem is linked — work-item or issue URL still needed.
  • Target branch version is correct — development, npm and .NET prerelease 6.1.0-0.

Validation results

Latest validation, 2026-09-21:

  • Selected Linux regression suite: 220 passed, 0 failed, 2 existing skips, covering Grafana plugins, packaging, manifest handling, restore and filesystem utilities.
  • Self-contained Linux Release build and bundled CLI artifact passed; the actual executable reports 6.1.0-0. Compared bundled templates/vendor resources with their source trees.
  • A local harness using unchanged CMF app-installation code and existing deployment-handler assemblies passed at default and custom destinations: one ZIP, source manifest unchanged, provisioning/tagging/XML transformation, executable permissions, preservation of an unrelated image-plugin sentinel and repeat installation. The original plugin source was removed after restore.
  • The actual application's generated ZIP contained all five declared versions with payloads byte-for-byte equal to the prepared distributions, retained signature files and executable modes, correct package-level routing and valid ZIP integrity.
  • User-supplied target-runtime logs show successful extraction and registration of all five packaged plugins, retained image-provided CMF gRPC/OData plugins, completed dashboard provisioning, and successful ClickHouse/GraphQL backend queries (status=ok). No raw internal logs or credentials are published here.
  • The same logs identify Grafana 12.0.4, not the previously assumed 11.2.2, and show four additional background preinstallation requests timing out. This is evidence of successful package deployment, not proof of complete network isolation. A rerun after disabling preinstallation, with verified egress restrictions, dashboard checks and restart coverage, remains outstanding. Duplicate table registration and SQLite-permission messages were also present and are not claimed fixed by this PR.

Historical validation (2026-09-15, before the single-ZIP correction): npm tests 32 passed; Windows non-integration suite 510 passed, 13 failed, 4 skipped, with the 13 failures matching the recorded unchanged-development baseline. Those broad-suite and coverage results have not been re-certified for this update; this is not an all-green full-suite claim.

The PR retains exactly two commits: the Grafana implementation/tests/documentation commit and the 6.1.0-0 release-preparation commit. Before merge, link the work item and complete the remaining integration checks and baseline-failure disposition.

@diogomrpr
diogomrpr force-pushed the feature/grafana-offline-plugins branch from 8f31b54 to 6a83fcf Compare September 17, 2026 16:57
@diogomrpr
diogomrpr force-pushed the feature/grafana-offline-plugins branch from 6a83fcf to a03938c Compare September 21, 2026 17:16
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.

1 participant