mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-10-03 05:04:30 +02:00
Ongoing work on node table
Sync commit: Does not compile
This commit is contained in:
@@ -1,16 +1,24 @@
|
||||
-- sqlfluff:dialect:sqlite
|
||||
--
|
||||
CREATE TABLE "node" (
|
||||
id INTEGER PRIMARY KEY,
|
||||
time_stamp INTEGER NOT NULL,
|
||||
hostname VARCHAR(255) NOT NULL,
|
||||
cluster VARCHAR(255) NOT NULL,
|
||||
subcluster VARCHAR(255) NOT NULL,
|
||||
meta_data TEXT, -- JSON
|
||||
UNIQUE (hostname, cluster)
|
||||
);
|
||||
|
||||
CREATE TABLE "node_state" (
|
||||
id INTEGER PRIMARY KEY,
|
||||
time_stamp INTEGER NOT NULL,
|
||||
jobs_running INTEGER DEFAULT 0 NOT NULL,
|
||||
cpus_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
cpus_total INTEGER DEFAULT 0 NOT NULL,
|
||||
memory_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
memory_total INTEGER DEFAULT 0 NOT NULL,
|
||||
gpus_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
gpus_total INTEGER DEFAULT 0 NOT NULL,
|
||||
cpus_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
memory_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
gpus_allocated INTEGER DEFAULT 0 NOT NULL,
|
||||
node_state VARCHAR(255) NOT NULL
|
||||
CHECK (node_state IN (
|
||||
'allocated', 'reserved', 'idle', 'mixed',
|
||||
@@ -20,7 +28,8 @@ CREATE TABLE "node" (
|
||||
CHECK (health_state IN (
|
||||
'full', 'partial', 'failed'
|
||||
)),
|
||||
UNIQUE (hostname, cluster)
|
||||
node_id INTEGER,
|
||||
FOREIGN KEY (node_id) REFERENCES node (id)
|
||||
);
|
||||
|
||||
-- Add Indices For New Node Table VARCHAR Fields
|
||||
|
Reference in New Issue
Block a user