aboutsummaryrefslogtreecommitdiff
path: root/sqitch
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-03-22 15:16:44 +0000
committerChristopher Baines <mail@cbaines.net>2023-03-22 15:55:34 +0000
commitf9bd2f047e295beb8252af8ae1eafaa43b70aa2a (patch)
tree6a4c1fb70f64e1fd2712f16cad0164476500372b /sqitch
parent7ee1cc4924813b1ae59958f29cf6dd5e22c3e673 (diff)
downloadbuild-coordinator-f9bd2f047e295beb8252af8ae1eafaa43b70aa2a.tar
build-coordinator-f9bd2f047e295beb8252af8ae1eafaa43b70aa2a.tar.gz
Implement and extend the agent status functionality
Previously, updating the status was used by the agent just to get back the list of builds it was already allocated. Now the status sent is actually stored, along with the 1min load average.
Diffstat (limited to 'sqitch')
-rw-r--r--sqitch/pg/deploy/replace_agent_status.sql7
-rw-r--r--sqitch/pg/revert/replace_agent_status.sql7
-rw-r--r--sqitch/pg/verify/replace_agent_status.sql7
-rw-r--r--sqitch/sqitch.plan1
-rw-r--r--sqitch/sqlite/deploy/replace_agent_status.sql14
-rw-r--r--sqitch/sqlite/revert/replace_agent_status.sql7
-rw-r--r--sqitch/sqlite/verify/replace_agent_status.sql7
7 files changed, 50 insertions, 0 deletions
diff --git a/sqitch/pg/deploy/replace_agent_status.sql b/sqitch/pg/deploy/replace_agent_status.sql
new file mode 100644
index 0000000..18b581b
--- /dev/null
+++ b/sqitch/pg/deploy/replace_agent_status.sql
@@ -0,0 +1,7 @@
+-- Deploy guix-build-coordinator:replace_agent_status to pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/pg/revert/replace_agent_status.sql b/sqitch/pg/revert/replace_agent_status.sql
new file mode 100644
index 0000000..edcf272
--- /dev/null
+++ b/sqitch/pg/revert/replace_agent_status.sql
@@ -0,0 +1,7 @@
+-- Revert guix-build-coordinator:replace_agent_status from pg
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/pg/verify/replace_agent_status.sql b/sqitch/pg/verify/replace_agent_status.sql
new file mode 100644
index 0000000..1ab295d
--- /dev/null
+++ b/sqitch/pg/verify/replace_agent_status.sql
@@ -0,0 +1,7 @@
+-- Verify guix-build-coordinator:replace_agent_status on pg
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;
diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan
index 83935e8..6ed7af9 100644
--- a/sqitch/sqitch.plan
+++ b/sqitch/sqitch.plan
@@ -41,3 +41,4 @@ recreate_unprocessed_builds_with_derived_priorities 2021-12-22T11:09:54Z Christo
derivation_output_details 2022-07-07T18:12:27Z Chris <chris@felis> # Add derivation_output_details
build_counts 2022-10-28T09:36:25Z Chris <chris@felis> # Add builds_counts
build_results_counts 2022-10-28T09:36:35Z Chris <chris@felis> # Add build_results_counts
+replace_agent_status 2023-03-22T14:17:35Z Chris <chris@felis> # Replace agent_status
diff --git a/sqitch/sqlite/deploy/replace_agent_status.sql b/sqitch/sqlite/deploy/replace_agent_status.sql
new file mode 100644
index 0000000..0d579ef
--- /dev/null
+++ b/sqitch/sqlite/deploy/replace_agent_status.sql
@@ -0,0 +1,14 @@
+-- Deploy guix-build-coordinator:replace_agent_status to sqlite
+
+BEGIN;
+
+DROP TABLE agent_status;
+
+CREATE TABLE agent_status (
+ agent_id TEXT PRIMARY KEY ASC REFERENCES agents (id),
+ timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ status TEXT NOT NULL,
+ load_average_1min INTEGER
+);
+
+COMMIT;
diff --git a/sqitch/sqlite/revert/replace_agent_status.sql b/sqitch/sqlite/revert/replace_agent_status.sql
new file mode 100644
index 0000000..d92489f
--- /dev/null
+++ b/sqitch/sqlite/revert/replace_agent_status.sql
@@ -0,0 +1,7 @@
+-- Revert guix-build-coordinator:replace_agent_status from sqlite
+
+BEGIN;
+
+-- XXX Add DDLs here.
+
+COMMIT;
diff --git a/sqitch/sqlite/verify/replace_agent_status.sql b/sqitch/sqlite/verify/replace_agent_status.sql
new file mode 100644
index 0000000..0526dd0
--- /dev/null
+++ b/sqitch/sqlite/verify/replace_agent_status.sql
@@ -0,0 +1,7 @@
+-- Verify guix-build-coordinator:replace_agent_status on sqlite
+
+BEGIN;
+
+-- XXX Add verifications here.
+
+ROLLBACK;