Skip to content

Standalone Slurm exporter - No Kubernetes needed#1415

Merged
ali-sattari merged 9 commits intonebius:mainfrom
mateusclira-nv:mateusclira-nv/standalone-slurm
Aug 14, 2025
Merged

Standalone Slurm exporter - No Kubernetes needed#1415
ali-sattari merged 9 commits intonebius:mainfrom
mateusclira-nv:mateusclira-nv/standalone-slurm

Conversation

@mateusclira-nv
Copy link
Contributor

Summary

Add a minimal, backward-compatible path to run the exporter against a standalone Slurm cluster (slurmrestd with rest_auth/jwt)—no Kubernetes required.

Changes

  • New Flags
    • --standalone: skip k8s client/JWT flow.
    • --static-token (optional): alternative to env; CLI still has highest precedence.
  • Auth
    • Prefer SLURM_EXPORTER_TOKEN from the environment for REST calls.
    • Do not rely on SLURM_JWT (kept out to avoid collisions with Slurm internals).
  • HTTP client
    • Use Header.Set instead of Header.Add for X-SLURM-USER-TOKEN (and Content-Type) to avoid duplicate headers on retries.
  • Docs
    • README section describing standalone mode usage, and troubleshooting.

Testing

  • Verified with Slurm 24.05.x + slurmrestd v0.0.40.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds standalone mode support to the Slurm exporter, allowing it to run without Kubernetes dependencies by using static JWT tokens for authentication with slurmrestd.

  • Introduces --standalone and --static-token flags for non-Kubernetes deployments
  • Updates HTTP client to use Header.Set instead of Header.Add to prevent duplicate headers on retries
  • Adds retry configuration to the default HTTP client for improved reliability

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
cmd/exporter/main.go Adds standalone mode flags, optional Kubernetes client initialization, and static token issuer
internal/slurmapi/client.go Improves HTTP client with retry configuration and fixes header handling to prevent duplicates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@ali-sattari ali-sattari left a comment

Choose a reason for hiding this comment

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

Linter is unhappy about go fmt and there is one comment from Copilot that I kept, please address those.

@ali-sattari ali-sattari merged commit cf787f6 into nebius:main Aug 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants