Skip to content

feat(cli): add slurm resource attr export - #53

Merged
ahmadki merged 1 commit into
mainfrom
rhewett/pr5-slurm-resource-attrs-cli
Sep 4, 2026
Merged

feat(cli): add slurm resource attr export#53
ahmadki merged 1 commit into
mainfrom
rhewett/pr5-slurm-resource-attrs-cli

Conversation

@rhewett-nv

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds nemo-lens set-slurm-resource-attrs, an eval-friendly CLI for appending
Lens-derived Slurm launch resource attributes to OTEL_RESOURCE_ATTRIBUTES.

Issues

N/A

Usage

eval "$(nemo-lens set-slurm-resource-attrs --stage sbatch)"

srun ... bash -lc '
  eval "$(nemo-lens set-slurm-resource-attrs \
    --stage task \
    --container-image "$CONTAINER_IMAGE")"
  exec "$@"
'

Before your PR is "Ready for review"

Pre checks:

  • I read the Contributor guidelines.
  • All commits are signed off (git commit -s) per the DCO.
  • I added or updated tests under tests/ for any behavior change.
  • I ran pytest and pre-commit run --all-files locally; both pass.
  • I updated docs/ and README.md where behavior, configuration, or public API changed.
  • If this changes a lens public API symbol, I updated the cross-repo _fallbacks.py files in Megatron-LM / RL / Gym.

Additional information

Validation on pr5-slurm-resource-attrs-cli:

  • ../.venv/bin/pre-commit run --all-files: passed
  • PYTHONPATH=src ../.venv/bin/python -m pytest -q: 265 passed, 7 warnings
  • ../.venv/bin/python -m compileall -q src tests: passed
  • npm --prefix docs/fern run check: passed with 0 errors; one warning because the unauthenticated redirects check is skipped without fern login / FERN_TOKEN

Notes:

  • PR5 is one signed commit: eb98291 feat(cli): add slurm resource attr export.
  • The command prints one shell export for OTEL_RESOURCE_ATTRIBUTES.
  • Existing OTEL_RESOURCE_ATTRIBUTES values are preserved and take precedence
    over locally derived fallback values.
  • --stage sbatch captures scheduler/script-context Slurm attributes such as
    slurm.head_node.name when Slurm exposes them.
  • --stage task captures task-local attributes such as host.name,
    slurm.topology.*, and optional nv.dl.launch.container.image.
  • --container-image is valid only with --stage task; sbatch usage returns 2.
  • New SDK-specific imports are not introduced, no frozen
    docs/fern/versions/0.1.0/ pages are changed, and no top-level Lens API or
    fallback surface changes are required.

@rhewett-nv
rhewett-nv requested a review from ahmadki as a code owner August 30, 2026 23:56
@copy-pr-bot

copy-pr-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from 1f5fbcb to b8255b1 Compare September 3, 2026 18:31
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from b8255b1 to ef53d0c Compare September 3, 2026 18:47
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from ef53d0c to 1d6b9d1 Compare September 3, 2026 19:05
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch 2 times, most recently from 953819e to fead619 Compare September 3, 2026 20:05
ahmadki
ahmadki previously approved these changes Sep 3, 2026
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from fead619 to 9fa38e0 Compare September 4, 2026 00:30
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from 9fa38e0 to e151da0 Compare September 4, 2026 03:58
ahmadki
ahmadki previously approved these changes Sep 4, 2026
@ahmadki

ahmadki commented Sep 4, 2026

Copy link
Copy Markdown
Member

/ok to test e151da0

@ahmadki
ahmadki force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from e151da0 to b2682f5 Compare September 4, 2026 14:17
Base automatically changed from rhewett/pr4-provider-participant-attrs to main September 4, 2026 14:33
@ahmadki
ahmadki requested a review from a team as a code owner September 4, 2026 14:33
@rhewett-nv
rhewett-nv dismissed ahmadki’s stale review September 4, 2026 14:33

The merge-base changed after approval.

Signed-off-by: Russell Hewett <rhewett@nvidia.com>
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr5-slurm-resource-attrs-cli branch from b2682f5 to 20da74a Compare September 4, 2026 14:44
@ahmadki
ahmadki merged commit ec4ba0c into main Sep 4, 2026
6 checks passed
@ahmadki
ahmadki deleted the rhewett/pr5-slurm-resource-attrs-cli branch September 4, 2026 14:45
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.

2 participants