Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
41da031
feat(counters): compute rates and flag discontinuities per sample
somethingwithproof Nov 15, 2026
22ed5ab
feat(objects): ship the Fabric templates and the Fabric Port data query
somethingwithproof Nov 15, 2026
a8f79aa
feat(devices): map nodes to devices and create devices on confirmation
somethingwithproof Nov 15, 2026
ca13798
feat(pages): show counter validity, graph links, and congestion ranking
somethingwithproof Nov 15, 2026
8e26ee1
test(e2e): prove Thold and Maint against the Fabric data sources
somethingwithproof Nov 15, 2026
0f8b635
ci: run the real diagnostic tools against the ibsim simulated fabric
somethingwithproof Nov 15, 2026
aee79d8
test(scale): measure the plugin at the documented fabric sizes
somethingwithproof Nov 15, 2026
eea6695
docs: record milestone 3 decisions and status
somethingwithproof Nov 15, 2026
164dc0e
test(e2e): report Cacti 1.2.31 poller output leftovers without failing
somethingwithproof Nov 16, 2026
21aee20
fix: preserve Fabric indexes and bound poller sweeps
somethingwithproof Nov 16, 2026
00dafe8
fix: resume bounded counter sweeps and reserve polling time
somethingwithproof Nov 16, 2026
a76731a
test: report simulator startup state on timeout
somethingwithproof Nov 16, 2026
1033ecf
test: capture the OpenSM startup backtrace in CI
somethingwithproof Nov 16, 2026
85a1bd1
test: stop the debugger before the OpenSM main thread exits
somethingwithproof Nov 16, 2026
5166b83
fix: retain invalid-address counter attempts across sweeps
somethingwithproof Nov 16, 2026
6cf92b3
test: use loopback UDP for the simulated fabric
somethingwithproof Nov 16, 2026
7865a3a
test: verify sample preservation in schema migration
somethingwithproof Nov 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 106 additions & 2 deletions .github/workflows/plugin-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: |
set -euo pipefail
php -v
for f in *.php include/*.php locales/*.php tests/bin/*.php; do
for f in *.php include/*.php locales/*.php scripts/*.php tests/bin/*.php; do
php -l "$f"
done

Expand Down Expand Up @@ -230,6 +230,34 @@ jobs:
exit 1
fi

# Thold v1.8.2 and Maint v1.3 at pinned commits, unchanged, against the
# Fabric data sources through Cacti's own poller (tests/bin/e2e.sh). On
# PHP 8.2, the oldest PHP the plugin supports, for both Cacti refs.
- name: Checkout Thold v1.8.2
if: matrix.php == '8.2'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: Cacti/plugin_thold
ref: 1eb406bd0f81f3204358cce7bd43c8bb5adc8e4a
path: cacti/plugins/thold

- name: Checkout Maint v1.3
if: matrix.php == '8.2'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: Cacti/plugin_maint
ref: cd62de9cc323a4f5a8ac80a8d9dda3c7fa16c470
path: cacti/plugins/maint

- name: Run Thold and Maint end to end
if: matrix.php == '8.2'
working-directory: cacti
run: |
mkdir -p "$RUNNER_TEMP/fabric-e2e"
sh plugins/fabric/tests/bin/e2e.sh /opt/fabric-e2e-tools "$RUNNER_TEMP/fabric-e2e"

- name: Check Cacti log for errors
if: always()
run: |
Expand All @@ -240,7 +268,16 @@ jobs:
if [ -f cacti/log/cacti.log ]; then
echo "== install and poller run"
cat cacti/log/cacti.log
if grep -E "FATAL:|ERROR:|WARNING:" cacti/log/cacti.log; then
# Cacti 1.2.31 leaves incomplete rows after the replay serves U.
# Keep these core diagnostics visible; the replay still asserts
# the values and alerts. Do not allow them on newer core versions.
core_warnings='^$'
if [ "$(cat cacti/include/cacti_version)" = '1.2.31' ]; then
core_warnings="^[^ ]+ [0-9:]+ - POLLER: Poller\[1\] PID\[[0-9]+\] WARNING: (Poller Output Table not Empty\. Issues: [0-9]+, DS\[[0-9, ]+\]|There are [0-9]+ Data Sources not returning all data leaving rows in the poller output table\. Details to follow\.|Data Template 'Fabric Port [^']+' is impacted by lack of complete information)\$"
grep -E "$core_warnings" cacti/log/cacti.log || true
fi
# The end to end run logs a counter reset as a warning on purpose.
if grep -E "FATAL:|ERROR:|WARNING:" cacti/log/cacti.log | grep -v "counters went down" | grep -vE "$core_warnings" | grep -vE '^[^ ]+ [0-9:]+ - SYSTEM WARNING: Primary Admin account notifications disabled! Unable to send administrative Email\.$'; then
exit 1
fi
fi
Expand Down Expand Up @@ -398,6 +435,72 @@ jobs:
- name: Lint licensing metadata
run: pipx run --spec 'reuse[charset-normalizer]==6.3.0' reuse lint

# The real ibnetdiscover, iblinkinfo, and perfquery of rdma-core 50.0
# (Ubuntu 24.04's infiniband-diags) against a simulated fabric: linux-rdma
# ibsim and OpenSM under the libumad2sim LD_PRELOAD shim, in an
# unprivileged container with no /dev/infiniband and no added capability.
# The plugin's parsers then read the output. It proves the parsers on real
# tool output; it does not show counter behavior, congestion, or vendor
# hardware output (the plan's live checks).
#
# The image is pinned by digest and the packages by version in
# tests/ibsim/run.sh. Ubuntu drops superseded security builds from its
# archive, so a pinned version can start failing to install: bump the
# digest and the versions together, then compare the new output with
# tests/fixtures/ibsim/.
ibsim-fabric:
name: ibsim fabric tools (rdma-core 50.0)
runs-on: ubuntu-latest
timeout-minutes: 25
env:
# ubuntu:24.04 index digest (multi-arch).
IBSIM_IMAGE: ubuntu@sha256:2198e4c65076e9cb0b3d695219df667c0e3b0072da64ca3c2648aca17dcecaf5
steps:
- name: Checkout plugin
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install PHP 8.2
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0
with:
php-version: '8.2'
coverage: none

- name: Check the parsers against the committed captures
run: php tests/bin/check-ibsim-fixtures.php tests/fixtures/ibsim

# Detached, then bounded with docker wait: `timeout docker run` stops
# only the client, and the container's shell, as PID 1, ignores the
# SIGTERM it forwards. Two APT stages plus two scenario watchdogs
# take at most 1,142 s; the outer wait also allows cleanup time.
- name: Run the tools against the simulated fabric
timeout-minutes: 23
run: |
set -euo pipefail
out="$RUNNER_TEMP/ibsim-out"
mkdir -p "$out"
docker pull --quiet "$IBSIM_IMAGE" > /dev/null
docker run --detach --name ibsim-fabric \
--volume "$GITHUB_WORKSPACE:/repo:ro" \
--volume "$out:/out" \
"$IBSIM_IMAGE" \
sh /repo/tests/ibsim/run.sh /repo /out > /dev/null
rc=$(timeout 1200 docker wait ibsim-fabric) || rc=timeout
docker logs ibsim-fabric 2>&1
docker rm --force ibsim-fabric > /dev/null
if [ "$rc" = timeout ]; then
echo "::error::the ibsim run did not finish within 1200 s; the last stage logged above is the one that stalled"
exit 1
fi
[ "$rc" = 0 ] || { echo "::error::the ibsim run exited $rc"; exit 1; }
echo "IBSIM_OUT=$out" >> "$GITHUB_ENV"

# LIDs and line order come from OpenSM and change between runs, so the
# check is structural, never a byte comparison with the captures.
- name: Check the parsers against this run's output
run: php tests/bin/check-ibsim-fixtures.php "$IBSIM_OUT"

ci-ok:
name: ci-ok
if: ${{ always() }}
Expand All @@ -407,6 +510,7 @@ jobs:
- php-guard
- workflow-lint
- reuse
- ibsim-fabric
runs-on: ubuntu-latest
timeout-minutes: 5
permissions: {}
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Cacti 1.2 plugin that brings InfiniBand port counters, link width and speed, and congestion indicators into Cacti as ordinary devices, data sources, and graphs. A link that trained at 1X instead of 4X then shows up as a graph and a Thold alert next to the host it serves, under Cacti's permissions, with Maint able to suppress it.

> **Status: in development, no release yet.** Milestone 2 (foundation) is merged on `main`. Milestone 1 confirmed the design against documentation and upstream source (PR #71); the results, with sources, are in [docs/research/](docs/research/). Milestone 2 adds the plugin foundation:
> **Status: in development, no release yet.** Milestone 2 (foundation) is merged on `main`, and milestone 3 (Cacti objects and alerting) is in review. Milestone 1 confirmed the design against documentation and upstream source (PR #71); the results, with sources, are in [docs/research/](docs/research/). Milestone 2 adds the plugin foundation:
>
> - install, upgrade, uninstall, and the PHP 8.2 guard
> - two realms and the settings
Expand All @@ -12,7 +12,15 @@ A Cacti 1.2 plugin that brings InfiniBand port counters, link width and speed, a
> - link state and the counter sweep cache
> - inventory, admin, and health pages
>
> It creates no Cacti devices, data sources, graphs, or alerts yet; those are milestone 3. A fabric can be swept only from the main poller until remote data collectors are supported in phase 3. It has been tested only against fake tools, never on an InfiniBand fabric. Checks that need a fabric remain open in each research page's live-checks table. This project is not affiliated with the Cacti project.
> Milestone 3 adds the Cacti objects:
>
> - device, data, and graph templates shipped as Cacti template XML, and the "Fabric Port" data query
> - mapping a node to a Cacti device, or creating one on confirmation ([ADR 0010](docs/decisions/0010-one-device-per-node.md))
> - counter data sources for graphs, and GAUGE link state and rate data sources for Thold ([ADR 0011](docs/decisions/0011-derive-counters-and-gauge-alert-values.md))
> - discontinuity handling and saturated basic counters read as unknown ([ADR 0012](docs/decisions/0012-saturated-basic-counters-read-as-unknown.md)), counter validity and graph links on the port page, and a congestion ranking
> - an end-to-end test with unchanged Thold v1.8.2 and Maint v1.3, and a CI job that runs the real diagnostic tools against a simulated fabric
>
> A fabric can be swept only from the main poller until remote data collectors are supported in phase 3. It has been tested against fake tools and the ibsim fabric simulator, never on an InfiniBand fabric. Checks that need a fabric remain open in each research page's live-checks table. This project is not affiliated with the Cacti project.

## Why

Expand Down Expand Up @@ -45,6 +53,8 @@ Out of scope: changing fabric state, replacing a fabric manager or subnet manage
| UFM | UFM Enterprise REST API, phase 2; release matrix is a milestone 1 deliverable |
| Thold, Maint | No changes required |

Keep Cacti's script timeout at its default 25 seconds or higher. A sweep started by a data-query read limits tool execution to that timeout minus five seconds, reserving time to read the cache and reply. When the budget expires, the query serves the last current sample or unknown; the next cycle retries the sweep. This limit also applies to the PHP poller. A timeout of five seconds or less leaves no time to start a tool.

## Design

- [docs/PLAN.md](docs/PLAN.md) is the full plan: architecture, upstream facts it depends on (with sources) and assumptions still to confirm, identity model, counter and link-state rules, security boundaries, performance arithmetic, testing, and risks.
Expand Down
6 changes: 4 additions & 2 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version = 1

# Files that cannot carry a comment header, or whose format makes one
# awkward: documentation, repository metadata, GitHub templates, test
# configuration, tool output fixtures, and translation catalogs,
# which gettext regenerates.
# configuration, tool output fixtures, generated Cacti template and data
# query XML, and translation catalogs, which gettext regenerates.
[[annotations]]
path = [
"README.md",
Expand All @@ -17,6 +17,8 @@ path = [
"phpunit.xml",
"phpunit-integration.xml",
"tests/fixtures/**",
"templates/**",
"resource/**",
"locales/po/**",
"locales/LC_MESSAGES/**",
]
Expand Down
Loading
Loading