Go to Mahuika

/home/baes/dashboard/db


(python3_mahuika) baes@mahuika01: ~/dashboard/db$ sqlite3 dashboard.db


(TODOs: Currently,  the process is tied to Sung Bae )


It is "allocation" table that you will need to update.

CREATE TABLE IF NOT EXISTS "allocation" (
"id" int NOT NULL,
"machine" text,
"hours" int,
"start" date,
"end" date,
"type" integer NOT NULL DEFAULT 1,
"project_id" TEXT,
PRIMARY KEY("id")
);


sqlite> select * from allocation;
1|mahuika|50000|2018-06-01|2018-11-30|1|nesi00213
2|mahuika|18000|2018-12-01|2019-05-31|1|nesi00213
3|maui|950000|2018-06-01|2019-05-31|1|nesi00213
4|mahuika|75000|2019-06-01|2019-08-31|1|nesi00213
5|maui|925000|2019-06-01|2019-08-31|1|nesi00213
6|maui|3925000|2019-06-01|2020-05-31|0|nesi00213
7|maui|300000|2019-07-26|2019-08-31|0|nesi00213
8|maui|508750|2019-09-01|2020-04-20|1|nesi00213
9|mahuika|41250|2019-09-01|2020-05-31|1|nesi00213
10|maui|681854|2020-04-20|2020-05-31|1|nesi00213
11|maui|750000|2020-06-01|2020-08-31|1|nesi00213
12|mahuika|25000|2020-06-01|2021-05-31|1|nesi00213
13|maui|925000|2019-09-01|2020-08-31|1|comm00213
14|mahuika|50000|2020-09-01|2021-05-31|1|nesi00213
15|maui|1950000|2020-09-01|2021-05-31|1|nesi00213
16|maui|3525168|2020-09-01|2021-11-15|1|comm00213
17|maui|975000|2021-06-01|2021-08-31|1|nesi00213
18|mahuika|25000|2021-06-01|2021-08-31|1|nesi00213


Mahuika 25,000 compute units is equivalent to 25,000 core hours

Maui 24,375 node hours is equivalent to 975,000 core hours. (x40)


The "type" field is historic and is now always "1".  (There was a need for a virtual allocation where you wish to know usage between two random dates)

Add the new allocations

sqlite> insert into allocation values (19,'maui',975000,'2021-09-01','2021-11-30',1,'nesi00213');
sqlite> insert into allocation values (20,'mahuika',25000,'2021-09-01','2021-11-30',1,'nesi00213');
sqlite> .quit


Sometimes, you may wish to update the existing data

sqlite> update allocation set start='2021-09-01', end='2021-11-30' where id==18;


Now, collect the latest data

(python3_mahuika) baes@mahuika01: ~/dashboard$ ./dashboard_data_collector.py --upload


Go to ucqkaoecore1p:

sudo service dashboard restart


Automatic data collection

Currently, every hour at 29th minuite, the data collection is executed


(python3_mahuika) baes@mahuika01: ~/dashboard$ crontab -l

SHELL=/usr/bin/bash
BASH_ENV="/home/baes/.bashrc"

29 * * * * python /home/baes/dashboard/dashboard_data_collector.py --upload


The --upload option sends the DB file to ucquakecore1p. Certainly, you can execute the command above to manually trigger the data collection.


Data collection for multiple days

For some reasons, if you notice missing data (cron being unstable etc), specify two days and run the following command. It does duplicate checks, so even if the data collection indeed ran ok, no need to worry about adding the same data again.

(python3_mahuika) baes@mahuika01: ~/dashboard$ ./data_collect_multiple_days.sh 2021-09-01 2021-09-06


This command sends the DB file to ucquakecore1p. 



  • No labels