Skip to content

Commit cdcdf77

Browse files
Postgres changes for 0.0.28 schema for ATLASPANDA-1444 and ATLASPANDA-1446
1 parent 04c47d7 commit cdcdf77

File tree

2 files changed

+130
-4
lines changed

2 files changed

+130
-4
lines changed

schema/postgres/sqls/patches/0.0.28.patch.sql

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,76 @@ COMMENT ON COLUMN doma_panda.error_descriptions.diagnostics IS 'Brief error diag
1717
COMMENT ON COLUMN doma_panda.error_descriptions.description IS 'Detailed description of the error';
1818
COMMENT ON COLUMN doma_panda.error_descriptions.category IS 'ID of error category';
1919

20-
ALTER TABLE doma_panda.error_descriptions OWNER TO panda;
20+
ALTER TABLE doma_panda.error_descriptions OWNER TO panda;
21+
22+
-- Create table to store GPU information for worker nodes
23+
CREATE TABLE doma_panda.worker_node_gpus (
24+
site VARCHAR(128),
25+
host_name VARCHAR(128),
26+
vendor VARCHAR(128),
27+
model VARCHAR(128),
28+
count INTEGER,
29+
vram BIGINT,
30+
architecture VARCHAR(128),
31+
framework VARCHAR(128),
32+
framework_version VARCHAR(20),
33+
driver_version VARCHAR(20),
34+
last_seen TIMESTAMP,
35+
PRIMARY KEY (site, host_name, vendor, model)
36+
);
37+
-- Comments on worker_node_gpus table and columns
38+
COMMENT ON TABLE doma_panda.worker_node_gpus IS
39+
'Stores information about the GPUs associated to a worker node seen by PanDA pilots';
40+
COMMENT ON COLUMN doma_panda.worker_node_gpus.site IS
41+
'The name of the site (not PanDA queue) where the worker node is located.';
42+
COMMENT ON COLUMN doma_panda.worker_node_gpus.host_name IS
43+
'The hostname of the worker node.';
44+
COMMENT ON COLUMN doma_panda.worker_node_gpus.vendor IS
45+
'GPU vendor, e.g. NVIDIA.';
46+
COMMENT ON COLUMN doma_panda.worker_node_gpus.model IS
47+
'GPU model, e.g. A100 80GB.';
48+
COMMENT ON COLUMN doma_panda.worker_node_gpus.count IS
49+
'Number of GPUs of this type in the worker node.';
50+
COMMENT ON COLUMN doma_panda.worker_node_gpus.vram IS
51+
'VRAM memory in MB.';
52+
COMMENT ON COLUMN doma_panda.worker_node_gpus.architecture IS
53+
'GPU architecture, e.g. Tesla, Ampere.';
54+
COMMENT ON COLUMN doma_panda.worker_node_gpus.framework IS
55+
'Driver framework available, e.g. CUDA.';
56+
COMMENT ON COLUMN doma_panda.worker_node_gpus.framework_version IS
57+
'Version of the driver framework, e.g. 12.2';
58+
COMMENT ON COLUMN doma_panda.worker_node_gpus.driver_version IS
59+
'Version of the driver, e.g. 575.51.03.';
60+
COMMENT ON COLUMN doma_panda.worker_node_gpus.last_seen IS
61+
'Timestamp of the last time the worker node was active.';
62+
63+
-- Index on last_seen for efficient time-based queries
64+
CREATE INDEX idx_worker_node_gpu_last_seen
65+
ON doma_panda.worker_node_gpus (last_seen);
66+
67+
ALTER TABLE doma_panda.worker_node_gpus OWNER TO panda;
68+
69+
-- Extend doma_panda.data_carousel_requests table
70+
ALTER TABLE doma_panda.data_carousel_requests
71+
ADD COLUMN last_staged_time TIMESTAMP,
72+
ADD COLUMN locked_by VARCHAR(64),
73+
ADD COLUMN lock_time TIMESTAMP;
74+
75+
-- Comments for new columns in data_carousel_requests
76+
COMMENT ON COLUMN doma_panda.data_carousel_requests.last_staged_time IS
77+
'Last time of update about staged files';
78+
COMMENT ON COLUMN doma_panda.data_carousel_requests.locked_by IS
79+
'The process which locks the request entry';
80+
COMMENT ON COLUMN doma_panda.data_carousel_requests.lock_time IS
81+
'Timestamp when the request entry was locked';
82+
83+
-- Update schema version
84+
UPDATE doma_panda.pandadb_version
85+
SET major = 0, minor = 0, patch = 28
86+
WHERE component = 'JEDI';
87+
88+
UPDATE doma_panda.pandadb_version
89+
SET major = 0, minor = 0, patch = 28
90+
WHERE component = 'SERVER';
91+
92+
COMMIT;

schema/postgres/sqls/pg_PANDA_TABLE.sql

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,10 @@ CREATE TABLE data_carousel_requests (
27762776
"modification_time" timestamp,
27772777
"check_time" timestamp,
27782778
"source_tape" VARCHAR(64),
2779-
"parameters" JSONB NOT NULL
2779+
"parameters" JSONB NOT NULL,
2780+
"last_staged_time" TIMESTAMP,
2781+
"locked_by" VARCHAR(64),
2782+
"lock_time" TIMESTAMP
27802783
);
27812784
COMMENT ON TABLE data_carousel_requests IS E'Table of Data Carousel requests';
27822785
COMMENT ON COLUMN data_carousel_requests.request_id IS E'Sequential ID of the request, generated from PostgreSQL sequence object jedi_data_carousel_request_id_seq when new request is inserted';
@@ -2794,8 +2797,12 @@ COMMENT ON COLUMN data_carousel_requests.start_time IS E'Timestamp when the requ
27942797
COMMENT ON COLUMN data_carousel_requests.end_time IS E'Timestamp when the request ended';
27952798
COMMENT ON COLUMN data_carousel_requests.modification_time IS E'Timestamp of the last request update';
27962799
COMMENT ON COLUMN data_carousel_requests.check_time IS E'Last time when the request was checked';
2797-
COMMENT ON COLUMN doma_panda.data_carousel_requests.source_tape IS E'Physical tape behind source RSE';
2798-
COMMENT ON COLUMN doma_panda.data_carousel_requests.parameters IS E'Extra parameters of staging in JSON';
2800+
COMMENT ON COLUMN data_carousel_requests.source_tape IS E'Physical tape behind source RSE';
2801+
COMMENT ON COLUMN data_carousel_requests.parameters IS E'Extra parameters of staging in JSON';
2802+
COMMENT ON COLUMN data_carousel_requests.last_staged_time IS E'Last time of update about staged files';
2803+
COMMENT ON COLUMN data_carousel_requests.locked_by IS E'The process which locks the request entry';
2804+
COMMENT ON COLUMN data_carousel_requests.lock_time IS E'Timestamp when the request entry was locked';
2805+
27992806
ALTER TABLE data_carousel_requests OWNER TO panda;
28002807
ALTER TABLE data_carousel_requests ADD PRIMARY KEY (request_id);
28012808

@@ -2899,6 +2906,53 @@ COMMENT ON COLUMN worker_node."total_local_disk" IS 'Total local disk in GB.';
28992906

29002907
ALTER TABLE worker_node OWNER TO panda;
29012908

2909+
CREATE TABLE worker_node_gpus (
2910+
site VARCHAR(128),
2911+
host_name VARCHAR(128),
2912+
vendor VARCHAR(128),
2913+
model VARCHAR(128),
2914+
count INTEGER,
2915+
vram BIGINT,
2916+
architecture VARCHAR(128),
2917+
framework VARCHAR(128),
2918+
framework_version VARCHAR(20),
2919+
driver_version VARCHAR(20),
2920+
last_seen TIMESTAMP,
2921+
PRIMARY KEY (site, host_name, vendor, model)
2922+
);
2923+
-- Comments on worker_node_gpus table and columns
2924+
COMMENT ON TABLE worker_node_gpus IS
2925+
'Stores information about the GPUs associated to a worker node seen by PanDA pilots';
2926+
COMMENT ON COLUMN worker_node_gpus.site IS
2927+
'The name of the site (not PanDA queue) where the worker node is located.';
2928+
COMMENT ON COLUMN worker_node_gpus.host_name IS
2929+
'The hostname of the worker node.';
2930+
COMMENT ON COLUMN worker_node_gpus.vendor IS
2931+
'GPU vendor, e.g. NVIDIA.';
2932+
COMMENT ON COLUMN worker_node_gpus.model IS
2933+
'GPU model, e.g. A100 80GB.';
2934+
COMMENT ON COLUMN worker_node_gpus.count IS
2935+
'Number of GPUs of this type in the worker node.';
2936+
COMMENT ON COLUMN worker_node_gpus.vram IS
2937+
'VRAM memory in MB.';
2938+
COMMENT ON COLUMN worker_node_gpus.architecture IS
2939+
'GPU architecture, e.g. Tesla, Ampere.';
2940+
COMMENT ON COLUMN worker_node_gpus.framework IS
2941+
'Driver framework available, e.g. CUDA.';
2942+
COMMENT ON COLUMN worker_node_gpus.framework_version IS
2943+
'Version of the driver framework, e.g. 12.2';
2944+
COMMENT ON COLUMN worker_node_gpus.driver_version IS
2945+
'Version of the driver, e.g. 575.51.03.';
2946+
COMMENT ON COLUMN worker_node_gpus.last_seen IS
2947+
'Timestamp of the last time the worker node was active.';
2948+
2949+
-- Index on last_seen for efficient time-based queries
2950+
CREATE INDEX idx_worker_node_gpu_last_seen
2951+
ON doma_panda.worker_node_gpus (last_seen);
2952+
2953+
ALTER TABLE doma_panda.worker_node_gpus OWNER TO panda;
2954+
2955+
29022956
CREATE TABLE cpu_benchmarks (
29032957
"cpu_type" VARCHAR(128),
29042958
"smt_enabled" SMALLINT,

0 commit comments

Comments
 (0)