Skip to content
Snippets Groups Projects
Unverified Commit 3673fc31 authored by Mathieu Othacehe's avatar Mathieu Othacehe
Browse files

Save the build machine.

* src/sql/upgrade-17.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds): Add "machine" field.
* src/cuirass/database.scm (db-update-build-machine!): New procedure.
* src/cuirass/base.scm (handle-build-event): Use it to record the machine
performing the build.
parent 697fa145
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,8 @@ dist_sql_DATA = \
src/sql/upgrade-13.sql \
src/sql/upgrade-14.sql \
src/sql/upgrade-15.sql \
src/sql/upgrade-16.sql
src/sql/upgrade-16.sql \
src/sql/upgrade-17.sql
dist_css_DATA = \
src/static/css/cuirass.css \
......
......@@ -583,7 +583,8 @@ updating the database accordingly."
(db-update-build-status! drv (build-status started)))
(log-message "bogus build-started event for '~a'" drv)))
(('build-remote drv host _ ...)
(log-message "'~a' offloaded to '~a'" drv host))
(log-message "'~a' offloaded to '~a'" drv host)
(db-update-build-machine! drv host))
(('build-succeeded drv _ ...)
(if (valid? drv)
(begin
......
......@@ -60,6 +60,7 @@
db-add-build-product
db-register-builds
db-update-build-status!
db-update-build-machine!
db-get-output
db-get-inputs
db-get-build
......@@ -802,6 +803,12 @@ log file for DRV."
(#:event . ,(assq-ref status-names
status)))))))))
(define* (db-update-build-machine! drv machine)
"Update the database so that DRV's machine is MACHINE."
(with-db-writer-worker-thread db
(sqlite-exec db "UPDATE Builds SET machine=" machine
"WHERE derivation=" drv ";")))
(define (db-get-output path)
"Retrieve the OUTPUT for PATH."
(with-db-worker-thread db
......
......@@ -61,6 +61,7 @@ CREATE TABLE Builds (
evaluation INTEGER NOT NULL,
job_name TEXT NOT NULL,
system TEXT NOT NULL,
machine TEXT, --optional, machine performing the build.
nix_name TEXT NOT NULL,
log TEXT NOT NULL,
status INTEGER NOT NULL,
......
BEGIN TRANSACTION;
ALTER TABLE Builds ADD machine TEXT DEFAULT NULL;
COMMIT;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment