From a33494d8ca62362420e90ad6ff8b3815fdfa8be3 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 26 Nov 2026 02:51:37 +0100 Subject: [PATCH 1/2] docs: README names binary-only commands, COMPAT lists failed and rotate options --- COMPAT.md | 2 +- README.md | 19 +++++++++++++++++-- changelog.d/+readme-matches-code.doc.md | 1 + 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 changelog.d/+readme-matches-code.doc.md diff --git a/COMPAT.md b/COMPAT.md index 834d300..7df713d 100644 --- a/COMPAT.md +++ b/COMPAT.md @@ -9,7 +9,7 @@ on the same invocations. | | | |---|---| -| commands | `failed STATUS NAME LOGDIR [TMP_LOGDIR]`, `rotate ROOT --compress-after DAYS [--delete-after DAYS] [--dry-run] [--lock-timeout SECONDS]`, `-h`, `--help`, `--version` | +| commands | `failed [--syslog TARGET] [--metrics-file PATH] STATUS NAME LOGDIR [TMP_LOGDIR]`, `rotate [--syslog TARGET] [--metrics-file PATH] ROOT --compress-after DAYS [--delete-after DAYS] [--dry-run] [--lock-timeout SECONDS]`, `-h`, `--help`, `--version` | | usage | the same text on stdout for `-h`, `--help` and no arguments | | exit codes | 0 on success and on every `failed` that got past its arguments; 2 for a refused invocation, after `eb-keep-logs: MESSAGE` on stderr; 2 with the usage text on stdout for no arguments; 75 when another `rotate` holds ROOT's lock past `--lock-timeout`, after `eb-keep-logs: another rotate holds the lock ROOT/.eb-keep-logs-rotate.lock; gave up after N s (--lock-timeout)` on stderr | | one rotate at a time | `rotate` holds an exclusive flock(2) on `ROOT/.eb-keep-logs-rotate.lock`, created when missing, from before it reads ROOT until it exits; it waits up to `--lock-timeout` seconds for it, 600 without the option or with an empty value, 0 not at all, 999999999 at most; it opens the file for reading when it may not write it; a lock file that cannot be opened, or a symbolic link or non-regular file at its name, is refused, exit 2; on a file system that cannot lock, `rotate` says so on stderr and rotates without the lock | diff --git a/README.md b/README.md index cbe7a44..4288375 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ sha256sum --check --ignore-missing SHA256SUMS install -m 0755 "eb-keep-logs-$v-$arch-linux-musl" ~/.local/bin/eb-keep-logs ``` -The shell script `eb-keep-logs` in this repository is the same tool; copy it onto `PATH`. +The shell script `eb-keep-logs` in this repository is the reference for `failed` and `rotate`, with the same options and output; copy it onto `PATH`. +It refuses `why`, `history`, `failures`, `loads`, `runs`, `used`, `usage`, `pending`, `test-bundle`, `test-compare` and `lifecycle` with `is in the Zig build only` and exit 2: only the binary has them. It needs `bash`, coreutils, GNU `grep` (for `grep -P`), `sed`, `find`, `gzip`, `awk`, `flock` from util-linux for `rotate` and, for `failed`, `eb`. Without `grep -P` it still keeps the log and the command output, but not the meson testlog. @@ -118,7 +119,21 @@ For a failure class, feed the kept log to eb-stack. `--json` prints any of these as one line of JSON with `schema_version` 1, for a pipeline's run summary. All three are in the Zig build only. -## Emit syslog and journald events +Four more commands read records other tools wrote, and are in the Zig build only: + +- `eb-keep-logs loads --module NAME FILE` prints who loaded a module, from Lmod's ModuleUsageTracking lines. +- `eb-keep-logs runs --exec PATH FILE` prints who ran an executable, from XALT run records. +- `eb-keep-logs pending FILE` prints what an `eb --dry-run` or `--missing-modules` report still has to build. +- `eb-keep-logs used --prefix PREFIX FILE...` lists the paths under a prefix that XALT and Lmod records name. + +Two commands compare test runs, also in the Zig build only: + +- `eb-keep-logs test-bundle` writes one JSON evidence bundle for a test run: its id, suite revision, EESSI target, stdout and stderr files, modules, seed and allocation. +- `eb-keep-logs test-compare BUNDLE...` lists which evidence fields differ across two or more bundles, without deciding pass or fail. + +## Emit syslog and journald events, and metrics + +Pass `--metrics-file PATH` to `failed` or `rotate` to update Prometheus counters for the logs and bytes kept, atomically; `rotate --dry-run` writes none. Pass `--syslog TARGET` (or set `EB_KEEP_LOGS_SYSLOG`) to `failed` or `rotate` to emit structured RFC 5424 messages (`ebKeepLogs@`, with `EB_KEEP_LOGS_SYSLOG_PEN` defaulting to `32473`, the IANA RFC 5398 documentation placeholder until a site or project PEN is assigned) or native `systemd-journald` fields (`journald`, `syslog`, `unix:///path`, `journal+unix:///path`, `udp://host:port`, `tcp://host:port`) with stable `MSGID` values (`EB_KEEP_FAILED`, `EB_KEEP_NONE`, `EB_ROTATE_DONE`) without copying log file contents into syslog. diff --git a/changelog.d/+readme-matches-code.doc.md b/changelog.d/+readme-matches-code.doc.md new file mode 100644 index 0000000..ea6a89d --- /dev/null +++ b/changelog.d/+readme-matches-code.doc.md @@ -0,0 +1 @@ +The README says which commands only the Zig binary has and lists loads, runs, used, pending, test-bundle, test-compare and --metrics-file, and COMPAT.md lists --syslog and --metrics-file for failed and rotate. From e12e1202537a490d5f75c5c7d0015d33c90c651a Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 26 Nov 2026 02:58:17 +0100 Subject: [PATCH 2/2] docs: add CITATION.cff --- CITATION.cff | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..cfdba91 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,21 @@ +cff-version: 1.2.0 +title: 'eb-keep-logs: keep failed EasyBuild logs and rotate pipeline logs' +message: If you use eb-keep-logs, please cite it using the metadata below. +type: software +authors: +- given-names: Rohit + family-names: Goswami + email: rgoswami@ieee.org + orcid: https://orcid.org/0000-0002-2393-8056 +license: MIT +repository-code: https://github.com/stackhands/eb-keep-logs +url: https://stackhands.github.io/eb-keep-logs/ +keywords: +- EasyBuild +- logs +- HPC +- Lmod +- XALT +abstract: Keeps a failed EasyBuild build's logs, command output and meson testlog, + rotates a pipeline log tree, and in the Zig build also reports build failures + and software usage from XALT and Lmod records.