Thanks to visit codestin.com
Credit goes to github.com

Skip to content

packaging: add strict snapcraft packaging for Netdata on Ubuntu Core#21785

Open
Half-Silver wants to merge 16 commits intonetdata:masterfrom
Half-Silver:master
Open

packaging: add strict snapcraft packaging for Netdata on Ubuntu Core#21785
Half-Silver wants to merge 16 commits intonetdata:masterfrom
Half-Silver:master

Conversation

@Half-Silver
Copy link

@Half-Silver Half-Silver commented Feb 18, 2026

Summary

  • add and evolve Snapcraft packaging at repo root for core24
  • switch snap to strict confinement and adopt version from packaging/version
  • enable per-app monitoring support (apps.plugin)
  • add thermal support via debugfs plugin + lm-sensors
  • make managed Snapcraft builds resilient when git submodules are missing

Details

  • set strict interfaces needed for monitoring workloads on Ubuntu Core
  • fetch pinned aclk-schemas and libsensors sources in override-pull when absent
  • reduce snap source payload for low-space build environments
  • use managed Snapcraft/LXD friendly layout and docs

Validation

  • snapcraft pack completes and produces local snap artifact
  • netdata service starts as snap daemon

Notes

  • this PR contains packaging-only changes

Summary by cubic

Adds strict Snapcraft packaging for Netdata on Ubuntu Core (core24), with thermal sensors and apps.plugin enabled. Builds use versioning from packaging/version and recover if submodules are missing.

  • New Features

    • Strict core24 snap with required interfaces.
    • Thermal monitoring via debugfs + lm-sensors; apps.plugin enabled.
    • Version from packaging/version; smaller source via .snapcraftignore.
    • Auto-fetch pinned aclk-schemas and lm-sensors when submodules are missing.
  • Migration

    • Build (managed mode): snapcraft pack (LXD required; see packaging/snap/README.md).
    • Install: snap install --dangerous --devmode; snap start netdata.netdata; UI on port 19999.

Written for commit 980667e. Summary will update on new commits.

@CLAassistant
Copy link

CLAassistant commented Feb 18, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/packaging Packaging and operating systems support area/docs labels Feb 18, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 4 files

Confidence score: 3/5

  • snapcraft.yaml enables debugfs.plugin under strict confinement without an interface, so it will be denied at runtime and functionality relying on it may fail
  • .snapcraftignore excludes the SNMP metadata overrides directory, which can cause SNMP overrides to be missing at runtime
  • The issues are user-impacting for strict snaps, which raises regression risk despite no other major concerns noted
  • Pay close attention to snapcraft.yaml, .snapcraftignore - confinement and runtime data access behavior.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".snapcraftignore">

<violation number="1" location=".snapcraftignore:14">
P2: The snapcraft ignore list excludes the SNMP metadata overrides directory, but the SNMP utilities load YAML overrides from this path at runtime. Removing it from the snap will cause SNMP overrides to be missing, degrading SNMP profile detection/normalization.</violation>
</file>

<file name="snapcraft.yaml">

<violation number="1" location="snapcraft.yaml:60">
P2: debugfs.plugin is enabled under strict confinement without any interface granting access to /sys/kernel/debug, which the plugin requires; it will be denied at runtime. Disable the plugin or add an appropriate interface.</violation>
</file>

<file name="packaging/snap/README.md">

<violation number="1" location="packaging/snap/README.md:67">
P2: Smoke-test instructions use `--devmode`, which disables strict confinement and can hide missing interface/permission issues for a strict snap. This undermines the purpose of testing strict confinement.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant Builder as Build Env (LXD/CI)
    participant Git as External Repos
    participant snapd as Ubuntu Core (snapd)
    participant Wrapper as bin/run-netdata
    participant Daemon as Netdata Daemon
    participant Sys as System (Kernel/debugfs)

    Note over Builder,Git: NEW: Managed Build Flow (core24)
    Builder->>Builder: override-pull: Read packaging/version
    opt Submodules Missing
        Builder->>Git: NEW: Fetch pinned aclk-schemas
        Builder->>Git: NEW: Fetch pinned lm-sensors
    end
    Builder->>Builder: CMake: Enable apps.plugin & debugfs.plugin
    Builder-->>snapd: Produce .snap (Strict Confinement)

    Note over snapd,Sys: NEW: Runtime Control Flow
    snapd->>Wrapper: Start Service (daemon)
    
    rect rgb(23, 37, 84)
    Note right of Wrapper: Environment Initialization
    Wrapper->>Wrapper: Set writable paths ($SNAP_DATA, $SNAP_COMMON)
    Wrapper->>Wrapper: NEW: Initialize sensors.conf for thermal support
    Wrapper->>Wrapper: Set PATH to include snap binaries
    end

    Wrapper->>Daemon: NEW: exec with -W path overrides
    
    rect rgb(5, 46, 22)
    Note right of Daemon: Strict Monitoring (Interface Plugs)
    Daemon->>Sys: NEW: system-observe (Process monitoring)
    Daemon->>Sys: NEW: hardware-observe (Thermal/debugfs)
    Daemon->>Sys: network-observe (TCP/UDP sockets)
    end

    alt Data Request
        Sys-->>Daemon: Return metrics (thermal, app cpu, etc.)
        Daemon-->>Daemon: Aggregate metrics
    else Unauthorized Access
        Sys-->>Daemon: Blocked by Strict Confinement
    end

    Note over Daemon: Listener: 19999
Loading

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

# Exclude large Go collector docs and test fixtures not needed for release builds.
src/go/plugin/go.d/collector/*/integrations/
src/go/plugin/go.d/collector/*/testdata/
src/go/plugin/go.d/config/go.d/snmp.profiles/metadata/
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 18, 2026

Choose a reason for hiding this comment

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

P2: The snapcraft ignore list excludes the SNMP metadata overrides directory, but the SNMP utilities load YAML overrides from this path at runtime. Removing it from the snap will cause SNMP overrides to be missing, degrading SNMP profile detection/normalization.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .snapcraftignore, line 14:

<comment>The snapcraft ignore list excludes the SNMP metadata overrides directory, but the SNMP utilities load YAML overrides from this path at runtime. Removing it from the snap will cause SNMP overrides to be missing, degrading SNMP profile detection/normalization.</comment>

<file context>
@@ -0,0 +1,15 @@
+# Exclude large Go collector docs and test fixtures not needed for release builds.
+src/go/plugin/go.d/collector/*/integrations/
+src/go/plugin/go.d/collector/*/testdata/
+src/go/plugin/go.d/config/go.d/snmp.profiles/metadata/
+src/go/plugin/ibm.d/samples.d/
</file context>
Fix with Cubic

- -DENABLE_DBENGINE=ON
- -DENABLE_PLUGIN_APPS=ON
- -DENABLE_PLUGIN_GO=OFF
- -DENABLE_PLUGIN_DEBUGFS=ON
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 18, 2026

Choose a reason for hiding this comment

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

P2: debugfs.plugin is enabled under strict confinement without any interface granting access to /sys/kernel/debug, which the plugin requires; it will be denied at runtime. Disable the plugin or add an appropriate interface.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At snapcraft.yaml, line 60:

<comment>debugfs.plugin is enabled under strict confinement without any interface granting access to /sys/kernel/debug, which the plugin requires; it will be denied at runtime. Disable the plugin or add an appropriate interface.</comment>

<file context>
@@ -0,0 +1,107 @@
+      - -DENABLE_DBENGINE=ON
+      - -DENABLE_PLUGIN_APPS=ON
+      - -DENABLE_PLUGIN_GO=OFF
+      - -DENABLE_PLUGIN_DEBUGFS=ON
+      - -DENABLE_LIBBACKTRACE=OFF
+      - -DENABLE_BUNDLED_PROTOBUF=OFF
</file context>
Fix with Cubic

## Install and smoke test (optional, admin)

```bash
sudo snap install --dangerous --devmode ./netdata_*.snap
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 18, 2026

Choose a reason for hiding this comment

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

P2: Smoke-test instructions use --devmode, which disables strict confinement and can hide missing interface/permission issues for a strict snap. This undermines the purpose of testing strict confinement.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packaging/snap/README.md, line 67:

<comment>Smoke-test instructions use `--devmode`, which disables strict confinement and can hide missing interface/permission issues for a strict snap. This undermines the purpose of testing strict confinement.</comment>

<file context>
@@ -0,0 +1,73 @@
+## Install and smoke test (optional, admin)
+
+```bash
+sudo snap install --dangerous --devmode ./netdata_*.snap
+sudo snap start netdata.netdata
+snap services netdata
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs area/packaging Packaging and operating systems support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants