diff options
author | Christopher Baines <mail@cbaines.net> | 2023-03-22 15:16:44 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-03-22 15:55:34 +0000 |
commit | f9bd2f047e295beb8252af8ae1eafaa43b70aa2a (patch) | |
tree | 6a4c1fb70f64e1fd2712f16cad0164476500372b /sqitch/sqlite | |
parent | 7ee1cc4924813b1ae59958f29cf6dd5e22c3e673 (diff) | |
download | build-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/sqlite')
-rw-r--r-- | sqitch/sqlite/deploy/replace_agent_status.sql | 14 | ||||
-rw-r--r-- | sqitch/sqlite/revert/replace_agent_status.sql | 7 | ||||
-rw-r--r-- | sqitch/sqlite/verify/replace_agent_status.sql | 7 |
3 files changed, 28 insertions, 0 deletions
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; |