Files
llmgw/internal/store/migrations/sqlite/0054_slurm_jobs.sql
T
Ilker ManapandClaude Opus 5.5 fcda4d3f85
CI / test (push) Failing after 7m24s
Slurm's jobs in llmgw's accounting: projects as accounts, jobs priced
With slurm.users llmgw, each project is a Slurm account, its organization's
and team's above it, with the project's members and its team's and
organization's on it; slurm.conf holds a job to its user's accounts. The
controller's agent keeps them with sacctmgr, only what it made, and reports
the jobs that ended in the last day; the leader records each once, its
GPU-hours (core-hours without cards) priced at auth.gpu_hour_cost into its
project's usage as model slurm/PARTITION.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:54:01 +01:00

20 lines
889 B
SQL

-- The Slurm jobs that ended, each recorded once (job_key is the cluster's
-- name and the job's id), with what it used and cost; a usage row (model
-- "slurm") carries the cost into the usage pages with the requests'.
CREATE TABLE slurm_jobs (
job_key TEXT PRIMARY KEY,
user_id TEXT NOT NULL DEFAULT '',
project_id TEXT NOT NULL DEFAULT '',
login TEXT NOT NULL DEFAULT '',
account TEXT NOT NULL DEFAULT '',
partition TEXT NOT NULL DEFAULT '',
state TEXT NOT NULL DEFAULT '',
started_at BIGINT NOT NULL DEFAULT 0,
ended_at BIGINT NOT NULL DEFAULT 0,
elapsed_seconds BIGINT NOT NULL DEFAULT 0,
cpus BIGINT NOT NULL DEFAULT 0,
gpus BIGINT NOT NULL DEFAULT 0,
cost_micros BIGINT NOT NULL DEFAULT 0
);
CREATE INDEX slurm_jobs_by_project ON slurm_jobs(project_id, ended_at);