Repository navigation
Skip unavailable fixed roots in Slurm job evidence - #118
Merged
Merged
Conversation
slurmJobEvidence() always searched /var/log and /etc/slurm. When either root was outside EVIDENCE_ROOTS (site-specific roots, as documented) or missing on the node, searchFiles() threw and /slurm/job returned 400, dropping the job files already found. Return an empty section instead, as findJobFiles() already does for missing roots. Paths outside the allowed roots are still never read. Closes NVIDIA#117 Signed-off-by: Dezhen Lu <dezhen.lu@student.uni-tuebingen.de>
Member
|
@coderabbitai review |
Action performed
|
Member
|
Thanks for the PR! Feel free to share if you have any other feedback! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
slurm_job_evidencefails with HTTP 400 whenever/var/logis not an allowlisted root, which is the case for the site-specificslurmEvidenceCollector.rootssetup in docs/installation.md. It also fails when/etc/slurmdoes not exist on the collector's node. In both cases, the job output files the collector already found are discarded.slurmJobEvidence()searches the fixed roots/var/logand/etc/slurmfor theslurm_logsandslurm_configsections.searchFiles()with an explicit root throws when the root is outsideEVIDENCE_ROOTSor missing, and nothing caught that error. This change returns[]for such a section, which matches howfindJobFiles()andsearchFiles('/')already treat missing roots ("Missing paths are expected on many clusters" in docs/installation.md).The fix does not widen access. A path outside
EVIDENCE_ROOTSstill yields no data, and explicit/grepor/readrequests outside the roots still return 400.Before and after,
GET /slurm/job?id=4242with one matching job file (Node.js 24, macOS arm64):EVIDENCE_ROOTS/etc/slurm/shared/slurmNew tests in
helm/mosaic-stack/tests/slurm-evidence.test.mjscover both setups. They fail on main (400 instead of 200) and pass with this change. The file runs 4 pass / 0 fail.Closes #117
Checklist
This change was drafted with Claude Code (claude-opus-5-5); the test results above are from the runs described.
Summary by CodeRabbit