2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00
Commit graph

705 commits

Author SHA1 Message Date
Mathieu Othacehe b191a2a5f6
Pick the first worker build.
* src/cuirass/templates.scm (machine-status): Pick the first worker build if
multiple builds are started on the same worker.
2021-02-10 18:27:06 +01:00
Mathieu Othacehe e77a0a94fe
database: Fix db-get-build-percentage query.
* src/cuirass/database.scm (db-get-build-percentage): Consider both successful
and failing builds.
2021-02-10 18:23:41 +01:00
Mathieu Othacehe 38701970eb
remote: Discover server log-port and publish-port without Avahi.
* src/cuirass/remote.scm (zmq-server-info, zmq-worker-request-info-message):
New procedures.
* src/cuirass/remote-server.scm (%log-port, %publish-port): New parameters.
(read-worker-exp): Handle 'worker-request-info message.
(remote-server): Set the new parameters.
* src/cuirass/remote-worker.scm (start-worker): Rename "server" argument. Send
a 'worker-request-info message to discover the server log port and publish
port.
(remote-worker): Adapt it.
2021-02-10 17:37:37 +01:00
Mathieu Othacehe 23688a0e45
Fix Zabbix argument.
bin/cuirass.in (%options): Fix "zabbix-uri" argument.
2021-02-08 13:37:23 +01:00
Mathieu Othacehe 5e5850533e
Add Zabbix command line argument.
* bin/cuirass.in: Add "--zabbix-uri" argument.
* src/cuirass/zabbix.scm (%zabbix-uri): Export it.
2021-02-08 13:31:28 +01:00
Mathieu Othacehe ac98f81671
Add Zabbix support. 2021-02-08 12:26:35 +01:00
Mathieu Othacehe 7aa1d9156a
Return worker last-seen field as integer.
* src/cuirass/database.scm (db-get-worker, db-get-workers): Return last-seen
field as integer.
2021-02-07 18:16:57 +01:00
Mathieu Othacehe eea91d9a63
remote: Swallow zlib errors.
* src/cuirass/remote.scm (swallow-zlib-error): New macro.
(send-log): Use it.
2021-02-06 09:42:54 +01:00
Mathieu Othacehe 75c44bb579
remote: Stop polling once the workers are started.
* src/cuirass/remote-worker.scm (remote-worker): Stop the avahi poll loop once
the workers are started.
2021-02-06 09:41:11 +01:00
Mathieu Othacehe 485ed9182b
Fix weather query.
* src/cuirass/database.scm (db-get-builds): Add missing parens.
2021-02-02 14:48:36 +01:00
Mathieu Othacehe 8bdc7ee535
Fix weather value.
* src/cuirass/database.scm (db-get-builds): Fix weather value.
* tests/http.scm (build-query-result): Adapt it.
2021-02-02 14:29:16 +01:00
Mathieu Othacehe 6bd940fc24
Add RSS link to the home page.
* src/cuirass/templates.scm (specifications-table): Add RSS link.
2021-02-02 14:11:55 +01:00
Mathieu Othacehe 4e98cb02dd
Add RSS link to the evaluation page.
* src/cuirass/templates.scm (evaluation-info-table): Add RSS link.
2021-02-02 14:09:35 +01:00
Mathieu Othacehe 7cf304f754
Fix RSS specification handling.
* src/cuirass/http.scm (url-handler): Pass the specification to
"db-get-builds" procedure.
2021-02-02 13:57:28 +01:00
Mathieu Othacehe b33fe066d5
Use a default locale.
This prevents the dates from being formatted using the current locale.

* bin/cuirass.in: Use a default locale.
2021-02-02 13:08:52 +01:00
Mathieu Othacehe 2befdc6a0d
Use a XML header for the RSS feed.
* src/cuirass/http.scm (respond-xml): New procedure.
(url-handler): Use it for the RSS feed.
2021-02-02 13:06:38 +01:00
Mathieu Othacehe f8ddf8ca09
Add basic RSS support.
* src/cuirass/rss.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/http.scm (url-handler): Add "/events/rss" route.
2021-02-02 11:58:29 +01:00
Mathieu Othacehe 4f4d7ff7db
Move weather field to database.
* src/sql/upgrade-4.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds)[weather]: New field.
(Builds_weather_evaluation): New index.
* src/cuirass/database.scm (db-get-last-status): New procedure.
(db-update-build-status!): Use it and update the new weather field.
(db-get-builds): Adapt it.
* tests/http.scm (build-query-result): Ditto.
2021-02-02 11:56:28 +01:00
Mathieu Othacehe f6662298c9
Move weather icon next to build status icon.
* src/cuirass/templates.scm (build-details): Move the weather icon.
2021-02-01 19:02:27 +01:00
Mathieu Othacehe 79b77b4377
remote: Start workers only once.
* src/cuirass/remote-worker.scm (%workers-started?): New variable.
(remote-worker): Use it to start workers only once.
2021-02-01 18:16:23 +01:00
Mathieu Othacehe a57b066e4f
Add build history support.
* src/cuirass/database.scm (db-get-builds): Add "oldevaluation" filter.
* src/cuirass/templates.scm (build-details): Add "history" argument.
* src/cuirass/http.scm (url-handler): Adapt it.
2021-02-01 17:49:00 +01:00
Mathieu Othacehe f9a5cbe0dd
Add weather support in build details.
* src/cuirass/templates.scm (build-details): Display weather.
2021-02-01 15:15:13 +01:00
Mathieu Othacehe d7282c05c0
Add build weather support.
* src/cuirass/database.scm (build-weather): New macro.
(build-status->weather): New procedure.
(db-get-builds): Return the build weather using the new procedure.
* src/cuirass/http.scm (build->hydra-build): Also return the weather.
* src/cuirass/templates.scm (weather-class, weather-title): New procedures.
(build-eval-table): Display the weather.
* tests/database.scm ("db-get-build weather"): New tests.
* tests/http.scm (build-query-result): Adapt it.
2021-02-01 14:27:24 +01:00
Mathieu Othacehe 54244e6e97
database: Fix "db-update-build-status!".
* src/cuirass/database.scm (db-update-build-status): Only consider evaluations
that happened before the current one. This is useful when updating the build
status of old evaluations.
2021-02-01 12:30:38 +01:00
Mathieu Othacehe 7697735fce
database: Fix "db-get-worker".
* src/cuirass/database.scm (db-get-worker): Handle the case where no worker
were found.
2021-02-01 12:22:56 +01:00
Mathieu Othacehe da93cb96ff
Fix SQL syntax.
* src/sql/upgrade-3.sql: Fix syntax.
2021-02-01 12:06:05 +01:00
Mathieu Othacehe 74c1a94a4d
Introduce build "last_status" field.
* src/sql/upgrade-3.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds)[last_status]: New field.
* src/cuirass/database.scm (db-update-build-status!): Honor it.
(db-get-builds): Return it.
* tests/database.scm ("db-update-build-status!"): New test.
2021-02-01 11:45:10 +01:00
Mathieu Othacehe 158966dca0
Fix /api/latestbuilds ordering.
Evaluations are added sequentially to database but builds are not always
registered nor performed in order. This means that a build corresponding to an
older evaluation can be returned first if it was completed last. Order by
descending evaluation id to prevent it.

* src/cuirass/database.scm (db-get-builds): Add "evaluation" order.
* src/cuirass/http.scm (url-handler): Order latestbuilds by descending
evaluation number.
2021-01-31 21:09:17 +01:00
Mathieu Othacehe e9e0943945
Remove workers hash table.
* src/cuirass/database.scm (db-add-worker): Rename ...
(db-add-or-update-worker): ... into this new procedure.
(db-get-worker, db-remove-unresponsive-workers): New procedures.
* src/cuirass/remote-server.scm (%workers): Remove it.
(pop-build): Adapt it.
(remove-unresponsive-workers!): Remove it.
(read-worker-exp): Adapt it.
(zmq-start-proxy): Ditto.
* tests/database.scm ("db-add-worker"): Rename ...
("db-add-or-update-worker"): ... into this new test.
("db-get-worker", "db-remove-unresponsive-workers"): New tests.
2021-01-31 10:31:01 +01:00
Mathieu Othacehe b993f3d433
Truncate long lines.
* src/cuirass/templates (workers-status): Truncate long lines.
2021-01-30 20:50:51 +01:00
Mathieu Othacehe 4370acce19
Sort workers consistently.
* src/cuirass/templates.scm (workers-status): Sort workers consistently.
2021-01-30 18:10:31 +01:00
Mathieu Othacehe 6c0298e12c
Remove left-over procedure.
* src/cuirass/templates.scm (workers-status): Remove unused "build-row"
procedure.
2021-01-30 18:02:35 +01:00
Mathieu Othacehe 5f770638bb
Fix workers display.
* src/cuirass/templates.scm (workers-status): Handle the case where multiple
builds are started on a worker.
2021-01-30 16:55:22 +01:00
Mathieu Othacehe 6838ec2eac
database: Prevent division by zero.
* src/cuirass/database.scm (db-get-build-percentage): Prevent division by zero.
2021-01-30 16:14:04 +01:00
Mathieu Othacehe 158dd2bd42
Fix build duration display.
* src/cuirass/templates.scm (build-details): Fix build duration display.
2021-01-30 16:11:50 +01:00
Mathieu Othacehe 154653b4c8
database: Fix starttime update.
* src/cuirass/database.scm (db-update-build-status!): Set starttime when the
build status is "submitted".
2021-01-30 16:10:50 +01:00
Mathieu Othacehe 7a7c26c628
Sort machines consistently.
* src/cuirass/templates.scm (workers-status): Sort machines.
2021-01-30 15:54:29 +01:00
Mathieu Othacehe 1e8d075d70
Improve workers page.
* src/cuirass/templates.scm (workers-status): Improve display.
* src/cuirass/http.scm (url-handler): Adapt it.
2021-01-30 14:24:29 +01:00
Mathieu Othacehe 213683ad27
database: Add "db-get-build-percentage".
* src/cuirass/database.scm (db-get-build-percentage): New procedure.
* tests/database.scm ("db-get-build-percentage"): New test.
2021-01-30 14:23:29 +01:00
Mathieu Othacehe 1271b11725
Add machine field to Worker table.
* src/sql/upgrade-2.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Workers): Add "machine field".
* src/cuirass/database.scm (db-get-builds): Return "worker" field.
(db-add-worker): Honor new "machine" field.
(db-get-workers): Ditto.
* src/cuirass/remote-worker.scm (remote-worker): Adapt it.
* src/cuirass/remote.scm (<worker>)[machine]: New field.
(worker-machine): New procedure.
(worker->sexp, sexp->worker): Adapt accordingly.
(generate-worker-name): Ditto.
* tests/database.scm (%dummy-worker): Add "machine" field.
2021-01-30 14:18:59 +01:00
Mathieu Othacehe 68532aee90
Fix logging.
* src/cuirass/remote-server.scm (remote-server): Have stdout/stderr
line-buffered.
* src/cuirass/remote-worker.scm (remote-worker): Ditto.
* src/cuirass/remote.scm (publish-server): Discard publish logs.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2021-01-28 16:16:43 +01:00
Mathieu Othacehe da6a5c0355
Add TODO.org.
* TODO.org: New file.
2021-01-21 13:04:19 +01:00
Mathieu Othacehe 08a8215155
Fix binary generation.
* Makefile.am (install-exec-hook): Process all binaries.
2021-01-18 16:16:26 +01:00
Mathieu Othacehe dea5707750
database: Fix search pagination.
* src/cuirass/database.scm (db-get-builds-by-search): Fix pagination.
2021-01-17 19:47:54 +01:00
Mathieu Othacehe e61e7a5ca4
Fix tests.
* tests/database.scm (db-init): Force database creation.
* tests/http.scm (db-init): Ditto.
* tests/metrics (db-init): Ditto.
2021-01-17 12:05:31 +01:00
Mathieu Othacehe 53d8b66bf9
database: Fix regression.
Fix a regression introduced by cbc462679d.

* src/cuirass/database.scm (db-get-builds): Collect BuildProducts id field.
2021-01-17 11:53:47 +01:00
Mathieu Othacehe 508ed333a6
Fix concurrent database creation. 2021-01-15 15:07:15 +01:00
Mathieu Othacehe 5982316c5c
Fix tests.
* tests/database.scm: Fix tests.
2021-01-13 14:55:22 +01:00
Mathieu Othacehe cbc462679d
Switch to PostegreSQL. 2021-01-11 12:28:13 +01:00
Mathieu Othacehe ca7a7ca989
Add remote build support.
* src/cuirass/remote.scm: New file.
* src/cuirass/remote-server.scm: New file.
* src/cuirass/remote-worker.scm: New file.
* bin/remote-server.in: New file.
* bin/remote-worker.in: New file.
* Makefile.am (bin_SCRIPTS): Add new binaries,
(dist_pkgmodule_DATA): add new files,
(EXTRA_DIST): add new binaries,
(bin/remote-server, bin/remote-worker): new targets.
* .gitignore: Add new binaries.
* bin/cuirass.in (%options): Add "--build-remote" option,
(show-help): document it,
(main): honor it.
* src/cuirass/base.scm (with-build-offload-thread): New macro,
(%build-remote?, %build-offload-channel): new parameters,
(make-build-offload-thread): new procedure,
(build-derivations/offload): new procedure,
(restart-builds): use it to offload builds when %build-remote? is set,
(build-packages): ditto.
2021-01-06 21:06:04 +01:00