mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-04-03 18:55:55 +02:00
Add new tables and columns for notifications, influxdb configurations, realtime logs, LVM configuration, and machine configuration
This commit is contained in:
parent
71ae60e6c7
commit
0309720c43
@ -1,8 +1,9 @@
|
||||
{
|
||||
"addr": "127.0.0.1:8080",
|
||||
"db-driver": "mysql",
|
||||
|
||||
"db" : "root:my-secret-pw@(127.0.0.1:3306)/cockpit",
|
||||
"embed-static-files": false,
|
||||
"static-files": "./web/frontend/public/",
|
||||
"db" : "root:my-secret-pw@(127.0.0.1:3306)/clustercockpit",
|
||||
"archive": {
|
||||
"kind": "file",
|
||||
"path": "./var/job-archive"
|
||||
|
@ -3,3 +3,14 @@ DROP TABLE IF EXISTS tags;
|
||||
DROP TABLE IF EXISTS jobtag;
|
||||
DROP TABLE IF EXISTS configuration;
|
||||
DROP TABLE IF EXISTS user;
|
||||
DROP TABLE IF EXISTS notifications;
|
||||
DROP TABLE IF EXISTS influxdb_configurations;
|
||||
DROP TABLE IF EXISTS realtime_logs;
|
||||
DROP TABLE IF EXISTS lvm_conf;
|
||||
DROP TABLE IF EXISTS machines;
|
||||
DROP TABLE IF EXISTS logical_volumes
|
||||
DROP TABLE IF EXISTS volume_groups;
|
||||
DROP TABLE IF EXISTS physical_volumes;
|
||||
DROP TABLE IF EXISTS lvm_storage_issuer;
|
||||
DROP TABLE IF EXISTS machine_conf;
|
||||
|
||||
|
@ -64,3 +64,106 @@ CREATE TABLE IF NOT EXISTS configuration (
|
||||
FOREIGN KEY (username) REFERENCES user (username) ON DELETE CASCADE ON UPDATE NO ACTION);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS notifications (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
message TEXT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS influxdb_configurations (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
type VARCHAR(255) NOT NULL,
|
||||
database_name VARCHAR(255) NOT NULL,
|
||||
host VARCHAR(255) NOT NULL,
|
||||
port INT NOT NULL,
|
||||
user VARCHAR(255) NOT NULL,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
organization VARCHAR(255) NOT NULL,
|
||||
ssl_enabled BOOLEAN NOT NULL,
|
||||
batch_size INT NOT NULL,
|
||||
retry_interval VARCHAR(255) NOT NULL,
|
||||
retry_exponential_base INT NOT NULL,
|
||||
max_retries INT NOT NULL,
|
||||
max_retry_time VARCHAR(255) NOT NULL,
|
||||
meta_as_tags TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS realtime_logs (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
log_message TEXT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS lvm_conf (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
username VARCHAR(255) NOT NULL,
|
||||
minAvailableSpaceGB FLOAT NOT NULL,
|
||||
maxAvailableSpaceGB FLOAT NOT NULL
|
||||
);
|
||||
|
||||
-- linux lvm schemas
|
||||
CREATE TABLE IF NOT EXISTS machines (
|
||||
machine_id VARCHAR(255) PRIMARY KEY,
|
||||
hostname VARCHAR(255) NOT NULL,
|
||||
os_version VARCHAR(255) NOT NULL,
|
||||
ip_address VARCHAR(255) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS logical_volumes (
|
||||
lv_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
machine_id VARCHAR(255) NOT NULL,
|
||||
lv_name VARCHAR(255) NOT NULL,
|
||||
vg_name VARCHAR(255) NOT NULL,
|
||||
lv_attr VARCHAR(255) NOT NULL,
|
||||
lv_size VARCHAR(255) NOT NULL,
|
||||
FOREIGN KEY (machine_id) REFERENCES machines(machine_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS volume_groups (
|
||||
vg_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
machine_id VARCHAR(255) NOT NULL,
|
||||
vg_name VARCHAR(255) NOT NULL,
|
||||
pv_count VARCHAR(255) NOT NULL,
|
||||
lv_count VARCHAR(255) NOT NULL,
|
||||
snap_count VARCHAR(255) NOT NULL,
|
||||
vg_attr VARCHAR(255) NOT NULL,
|
||||
vg_size VARCHAR(255) NOT NULL,
|
||||
vg_free VARCHAR(255) NOT NULL,
|
||||
FOREIGN KEY (machine_id) REFERENCES machines(machine_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS physical_volumes (
|
||||
pv_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
machine_id VARCHAR(255) NOT NULL,
|
||||
pv_name VARCHAR(255) NOT NULL,
|
||||
vg_name VARCHAR(255) NOT NULL,
|
||||
pv_fmt VARCHAR(255) NOT NULL,
|
||||
pv_attr VARCHAR(255) NOT NULL,
|
||||
pv_size VARCHAR(255) NOT NULL,
|
||||
pv_free VARCHAR(255) NOT NULL,
|
||||
FOREIGN KEY (machine_id) REFERENCES machines(machine_id)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS lv_storage_issuer (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
machine_serial_number VARCHAR(255) NOT NULL,
|
||||
hostname VARCHAR(255) NOT NULL,
|
||||
username VARCHAR(255) NOT NULL,
|
||||
minAvailableSpaceGB FLOAT NOT NULL,
|
||||
maxAvailableSpaceGB FLOAT NOT NULL,
|
||||
FOREIGN KEY (machine_serial_number) REFERENCES machines(machine_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS machine_conf (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
machine_serial_number VARCHAR(255) NOT NULL,
|
||||
hostname VARCHAR(255) NOT NULL,
|
||||
username VARCHAR(255) NOT NULL,
|
||||
passphrase LONGTEXT,
|
||||
port_number INT NOT NULL,
|
||||
password VARCHAR(255),
|
||||
host_key VARCHAR(255),
|
||||
folder_path VARCHAR(255) ,
|
||||
FOREIGN KEY (machine_serial_number) REFERENCES machines(machine_id)
|
||||
);
|
||||
|
@ -5,7 +5,7 @@ if [ -d './var' ]; then
|
||||
./cc-backend -server -dev
|
||||
else
|
||||
make
|
||||
# wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-demo.tar
|
||||
wget https://hpc-mover.rrze.uni-erlangen.de/HPC-Data/0x7b58aefb/eig7ahyo6fo2bais0ephuf2aitohv1ai/job-archive-demo.tar
|
||||
tar xf job-archive-demo.tar
|
||||
# rm ./job-archive-demo.tar
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user