Skip to content

[CLUST-327] Add API key configuration for Slurm token helper - #169

Merged
yukicoder0509 merged 37 commits into
mainfrom
feat/CLUST-327-add-api-key-for-slurm-token-helper
Jul 28, 2026
Merged

[CLUST-327] Add API key configuration for Slurm token helper#169
yukicoder0509 merged 37 commits into
mainfrom
feat/CLUST-327-add-api-key-for-slurm-token-helper

Conversation

@Kyle9410-Chen

Copy link
Copy Markdown
Member

Type of changes

  • Feature

Purpose

  • Add SLURM_TOKEN_HELPER_API_KEY in configuration.
  • Add Authorization to GetNewToken() in slurm.

@Kyle9410-Chen
Kyle9410-Chen requested a review from joegoooo June 26, 2026 04:37
@Kyle9410-Chen Kyle9410-Chen self-assigned this Jun 26, 2026
Comment thread config.example.yaml Outdated
yukicoder0509 and others added 25 commits July 22, 2026 10:48
… By ID

When a system admin is also a member/owner of a group, Get Group By ID
returned type "adminOverride" while List Groups returned "membership".
GetTypeByUser short-circuited to adminOverride for any admin without
checking membership.

Now look up the group membership first and only fall back to
adminOverride when the admin has no membership in the group, matching
the List Groups behavior so group ownership takes precedence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a CreateSlurmAccount step to the group creation saga that calls the
Slurm accounts_association endpoint (the `sacctmgr add account` equivalent),
so a new group gets a matching, usable Slurm accounting account with its
cluster association. Inject the slurm service into group.Service via a
SlurmStore interface and construct it before groupService in the
composition root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The LDAP base group compensation deleted `title` instead of the group that
was actually created (baseCN), so a failed later step left the base group
orphaned in LDAP. Also make saga rollback best-effort: keep compensating the
remaining steps even if one compensation fails, and return the original action
error as the cause. Add saga tests for reverse-order and best-effort rollback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
config.example.yaml listed the slurm_* keys at the top level, but the config
loader maps them under a nested `slurm:` key, so they were silently ignored
(empty base URL and version, producing a "/slurmdb//accounts" request with an
unsupported protocol scheme). Nest them and align the version to v0.0.44.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add .deploy/local/slurm: a self-contained slurmdbd/slurmctld/slurmrestd plus
one compute node (prebuilt giovtorres image, JWT-authenticated REST on :6820),
with helper scripts (deploy, cleanup, mint-token, smoke-test), a config
snippet, and a README, wired up via make targets (slurm-up, slurm-down,
slurm-token). This lets the backend's slurm functions run against a real
slurmrestd locally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Group creation now depends on Slurm (accounts_association saga step), but the
local Slurm cluster is a separate, manually-started stack (make slurm-up), so
a forgotten step surfaces as a confusing group-creation failure. Add a fast,
non-fatal TCP check on :6820 to make run that prints a hint instead of failing
silently. Deliberately not auto-starting the cluster here: it adds an image
pull and ~30-60s to every make run, including for work that never touches
Slurm.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extend smoke-test.sh to delete the account it creates via the same REST call
slurm.DeleteAccount uses (DELETE /slurmdb/<ver>/account/<name>) — the group
creation saga's compensation path — and assert it is actually gone (fails
with a non-zero exit if the account is still present). Previously the script
only verified creation, leaving the rollback path unexercised.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add a Delete Slurm Account step to the group deletion saga, mirroring the
LDAP base/admin group deletion steps already there. Uses the same
slurm.DeleteAccount call the smoke test exercises; on a later step's
failure the compensation recreates the account via CreateAccountAssociation
so the account stays consistent with the (uncommitted) group state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
main merged #164 (CLUST-293) after this branch diverged, changing
slurm.Service.CreateAccountAssociation to return
(ParsedAccountAssociationResponse, error) instead of a bare error, which broke
the build (*slurm.Service no longer satisfied group.SlurmStore). Update the
interface and the two saga call sites to match; the parsed response isn't
needed by the saga, so it's discarded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The slurm-token target only forwarded SLURM_USER and never passed a
lifespan, so it always minted the script's default 1-hour token and the
README's 'make slurm-token username=root lifespan=infinite' could not
work. Forward both SLURM_USER and SLURM_LIFESPAN (defaults root/3600) and
document SLURM_LIFESPAN=infinite for an effectively unexpired root token.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joegoooo and others added 5 commits July 22, 2026 10:50
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.46.0 to 0.52.0.
- [Commits](golang/crypto@v0.46.0...v0.52.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.52.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@Kyle9410-Chen
Kyle9410-Chen requested a review from joegoooo July 22, 2026 02:59
Comment thread internal/config/config.go
@yukicoder0509
yukicoder0509 merged commit 5de341e into main Jul 28, 2026
8 checks passed
@yukicoder0509
yukicoder0509 deleted the feat/CLUST-327-add-api-key-for-slurm-token-helper branch July 28, 2026 12:41
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.

3 participants