Commit Graph

1128 Commits

Author SHA1 Message Date
Ludovic Courtès 5ca1147af3
Update NEWS. 2023-10-29 22:39:07 +01:00
Ludovic Courtès 0b1e1ed44f
build: Distribute ‘new-client-cert.scm’.
* Makefile.am (noinst_SCRIPTS): Move ‘etc/new-client-cert.scm’ to…
(dist_noinst_SCRIPTS): … here.  New variable.
2023-10-29 22:37:25 +01:00
Ludovic Courtès dfab507438
Update NEWS. 2023-10-29 20:58:46 +01:00
Ludovic Courtès 299e95a7b6
templates: Factorize the success rate bar.
* src/cuirass/templates.scm (success-rate-bar): New procedure.
(specifications-table): Use it.
2023-10-29 17:34:10 +01:00
Ludovic Courtès 286fef2ebb
templates: Move RSS button to the right.
* src/cuirass/templates.scm (specifications-table): Make “RSS events”
the rightmost button.
(evaluation-info-table): Likewise.
2023-10-29 17:26:55 +01:00
Ludovic Courtès 6611151b7f
templates: Improve toggle button on evaluation and spec pages.
The contrast icon was arguably misleading.

* src/cuirass/templates.scm (specifications-table): Use ‘oi-dashboard’
rather than ‘oi-contrast’ for the toggle button; clarify ‘title’.
(evaluation-info-table): Likewise.
2023-10-29 17:20:42 +01:00
Ludovic Courtès b80461b75e
build-log.js: Tweak icon of the phase folding button.
* src/static/js/build-log.js: Change the class of the phase
collapse/expand button.  Give it an ID and change its icon as a function
of OPENNESS.
2023-10-28 23:01:03 +02:00
Ludovic Courtès dabc19e3f0
templates: Adjust styling for link to raw build log.
* src/cuirass/templates.scm (pretty-build-log): Add spacing after the
‘oi-external-link’ <span> tag.
2023-10-28 23:00:14 +02:00
Ludovic Courtès 57902ecb2d
templates: Clarify evaluation page for states other than ‘succeeded’.
* src/cuirass/templates.scm (evaluation-build-table): Special-case the
situation where EVALUATION is not in ‘succeeded’ state.  Do not emit
build table when BUILDS is empty and EVALUATION is not in ‘succeeded’
state.
2023-10-28 22:48:46 +02:00
Ludovic Courtès 0a9776e57d
remote-worker: Use a separate GC root directory.
* src/cuirass/scripts/remote-worker.scm (cuirass-remote-worker): Change
‘%gc-root-directory’.
2023-10-25 20:11:18 +02:00
Ludovic Courtès 476324286b
remote-worker: Periodically delete old GC roots.
With commit 55af0f70c0, GC roots created
by ‘cuirass remote-worker’ would no longer be deleted (unless it’s
running on the same machine as ‘cuirass remote-server’).

* src/cuirass/scripts/remote-worker.scm (cuirass-remote-worker): Add
call to ‘spawn-gc-root-cleaner’.
* src/cuirass/base.scm (delete-old-gc-roots): Add #:check-database? and
honor it.
(spawn-gc-root-cleaner): Likewise.
2023-10-25 20:10:39 +02:00
Ludovic Courtès 3cbaa5674f
remote-server: Tweak message.
* src/cuirass/scripts/remote-server.scm (spawn-periodic-updates-fiber):
Clarify log message.
2023-10-25 19:15:12 +02:00
Ludovic Courtès 505ce3f8dc
Switch from SRFI-11 to SRFI-71.
* src/cuirass/base.scm, src/cuirass/http.scm,
src/cuirass/scripts/remote-worker.scm, src/cuirass/zabbix.scm: Use
SRFI-71 instead of SRFI-11.
2023-10-25 19:09:40 +02:00
Ludovic Courtès 2eb3e13580
remote-worker: Discard log anytime ‘send-log’ throws.
* src/cuirass/scripts/remote-worker.scm (run-build): Discard build logs
when ‘send-log’ throws, no matter which exception is thrown.  Improve
logging.
2023-10-25 18:29:21 +02:00
Ludovic Courtès 4cc37f540c
remote-worker: Ignore the return value of ‘build-derivations&’.
* src/cuirass/scripts/remote-worker.scm (run-build): Ignore the return
value of ‘build-derivations&’ since it’s always #t.
2023-10-25 18:28:20 +02:00
Ludovic Courtès 3bbb5c8447
store: ‘build-derivations&’ enforces synchronization with the build.
Previously, it was possible for the user to call the returned thunk
before ‘build-derivations’ had completed, thereby getting #f (the
initial value of ‘result’).  This made no sense because
‘build-derivations’ always returns #t or raises an exception.

This situation could happen in ‘cuirass remote-worker’ if the
corresponding ‘cuirass remote-server’ process disappeared in the middle
of a build, because ‘send-logs’ would return early, leading the finish
thunk of ‘build-derivations&’ to be called before build completion.

This change uses a channel to enforce synchronization with the thread
that calls ‘build-derivations’.

Partly fixes <https://issues.guix.gnu.org/66692>.

* src/cuirass/store.scm (build-derivations&): Use
‘with-exception-handler’ and ‘put-message’ in the thread.  Use
‘get-message’ instead of ‘atomic-box-ref’ in the finalization procedure.

Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-25 18:22:27 +02:00
Ludovic Courtès 159cadca3f
remote: Improve error messages in ‘send-log’.
* src/cuirass/remote.scm (sockaddr->string): New procedure, moved from…
(receive-logs): … here.
(send-log): Print the zlib error when it occurs.  Print the peer’s
address upon invalid handshake.
2023-10-25 18:06:52 +02:00
Ludovic Courtès c5ecec38ce
remote-server: Slightly improve ‘ensure-path*’ error messages.
* src/cuirass/scripts/remote-server.scm (ensure-path*): Tweak error
messages.
2023-10-25 18:06:42 +02:00
Ludovic Courtès 966505d22e
Update TODO. 2023-10-25 00:43:36 +02:00
Ludovic Courtès 623beb5288
remote-server: Tweak error message.
* src/cuirass/scripts/remote-server.scm (cuirass-remote-server): Adjust
error message.
2023-10-25 00:41:41 +02:00
Ludovic Courtès ba3278866f
templates: Link to /build/ID/log.
* src/cuirass/templates.scm (build-details): Add link to /build/ID/log.
(build-eval-table, build-search-results-table, running-builds-table):
Link to /build/ID/log.
2023-10-25 00:14:29 +02:00
Ludovic Courtès 2ab4df3fdd
templates: Add /build/ID/log, with client-side build log highlighting.
* src/static/js/build-log.js: New file.
* Makefile.am (dist_js_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Add it.
(url-handler): Add “/build/ID/log” handler.
* src/cuirass/templates.scm (pretty-build-log): New procedure.
2023-10-25 00:06:22 +02:00
Ludovic Courtès 18337a7608
templates: For new failures, link to a view of the commit range.
* src/cuirass/templates.scm (%vcs-web-commit-range-views): New variable.
(commit-range-hyperlink): New procedure.
(checkout-change-table): Use it.
2023-10-21 22:01:01 +02:00
Ludovic Courtès b5ea2cb620
templates: Show which checkouts have changed on evaluation pages.
* src/cuirass/http.scm (evaluation-html-page): Define ‘checkout-changes’
and pass it to ‘evaluation-build-table’.
* src/cuirass/templates.scm (checkout-table): Add #:changes parameter
and honor it.
(evaluation-build-table): Add #:checkout-changes parameter and pass it
on to ‘checkout-table.
(evaluation-dashboard): Define ‘checkout-changes’ and pass it to
‘checkout-table’.
2023-10-21 19:05:12 +02:00
Ludovic Courtès ab3265bad0
store: Remove ‘%gc-root-ttl’ parameter.
This is a followup to 55af0f70c0.

* src/cuirass/store.scm (%gc-root-ttl): Remove.
* src/cuirass/scripts/register.scm (cuirass-register): Remove references
to ‘%gc-root-ttl’.
* src/cuirass/scripts/remote-server.scm (%options): Warn about ‘--ttl’
having no effect.  Remove reference to ‘%gc-root-ttl’.
* src/cuirass/scripts/remote-worker.scm (%options): Warn about ‘--ttl’
having no effect.  Remove reference to ‘%gc-root-ttl’.
2023-10-21 18:44:30 +02:00
Ludovic Courtès 1ee143c0c0
maint: Build against the latest ‘guile-fibers’.
Fibers 1.1 has bugs that have long been fixed in 1.3.

* guix.scm: Use ‘guile-fibers’ instead of ‘guile-fibers-1.1’.
2023-10-19 08:51:49 +02:00
Ludovic Courtès 8cd9986cbd
database: ‘db-get-first-build-failure’ really does that.
There could potentially be cases where it would return a succeeding
build.

* src/cuirass/database.scm (db-get-first-build-failure):
Add (status . failed) filter.
2023-10-18 17:50:09 +02:00
Ludovic Courtès e9c27b7ce5
templates: Do not show “Weather” row when weather is unknown.
* src/cuirass/templates.scm (build-details): Do not emit “Weather” row
when WEATHER is unknown.
2023-10-18 16:03:07 +02:00
Ludovic Courtès 5fbbd26a78
http: Really fix previous checkout computation.
This a followup to c6fa409ad0.

* src/cuirass/http.scm (url-handler): Deal with the case where BUILD is
false or ‘db-get-previous-eval’ returns #f.
2023-10-18 15:58:45 +02:00
Ludovic Courtès c6fa409ad0
http: Grab checkouts of the previous evaluations for “/build/ID/details”.
In commit df606ce452, we were showing the
checkouts of the evaluation of the previous build.  However, that’s
typically much older than checkouts of the previous evaluation, which
are known to have led to the same successful build.

* src/cuirass/http.scm (url-handler): In “/build/ID/details”, compute
‘previous-checkouts’ based on the previous evaluation.
2023-10-18 15:44:24 +02:00
Ludovic Courtès df606ce452
templates: Provide hints for build failures.
The goal is to make it easier to find the origin of a build failure.

* src/cuirass/templates.scm (build-details): Add #:channels,
 #:checkouts, #:previous-checkouts, and #:first-failure.
[build-failure-info]: New procedure.
Use it.
(checkout-change-table): New procedure.
* src/cuirass/http.scm (url-handler): In “/build/ID/details”, pass extra
arguments to ‘build-details’.
* TODO: Update.
2023-10-18 15:03:27 +02:00
Ludovic Courtès 1db03a8c61
templates: Make “Build history” heading more visible.
* src/cuirass/templates.scm (build-details): Use ‘div’ instead of ‘h6’
for the “Build history” heading.
2023-10-18 15:03:27 +02:00
Ludovic Courtès cc31d28621
templates: ‘commit-hyperlink’ can display shortened commit IDs.
* src/cuirass/templates.scm (commit-hyperlink): Add #:shorten?
parameter, and honor it.
2023-10-18 15:03:27 +02:00
Ludovic Courtès ef3d3164b6
examples: random: Define a “build product” for some jobs.
* examples/random.scm: Add ‘build-outputs’ field.
2023-10-18 15:03:27 +02:00
Ludovic Courtès 8536509804
database: Add ‘db-get-first-build-failure’.
* src/cuirass/database.scm (db-get-previous-successful-build)
(db-get-first-build-failure): New procedures.
* tests/database.scm ("db-get-first-build-failure"): New test.
2023-10-18 15:03:26 +02:00
Ludovic Courtès 203b282220
tests: Avoid hard-coded ‘build-status’ values.
* tests/database.scm ("db-update-build-status!"): Replace hard-coded
‘build-status’ constants.
2023-10-18 15:03:26 +02:00
Ludovic Courtès fcab29cd36
base: Improve build product logging.
* src/cuirass/base.scm (create-build-outputs): Tweak logging.
2023-10-18 15:03:26 +02:00
Ludovic Courtès 053fff02e4
doc: Fix typo.
* doc/cuirass.texi (Specifications): Fix typo.
2023-10-18 15:03:26 +02:00
vicvbcun f63bd5ea64
doc: Fix remaining evaluation hook example.
This is a follow-up to commit 0b63c3b698.

* doc/cuirass.texi (Triggering an Evaluation): Fix URL in example.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-17 10:36:09 -04:00
vicvbcun 0b63c3b698
doc: Fix evaluation hook URL example.
* doc/cuirass.texi (Invocation): Fix URL in the example of the push hook.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
2023-10-16 11:49:00 -04:00
Ludovic Courtès 8ce46502f1
base: Hide unused binding.
* src/cuirass/base.scm: Hide ‘build’ from (guix store).
2023-10-15 22:13:17 +02:00
Ludovic Courtès 55af0f70c0
base: Keep GC roots for derivations that are still queued.
Previously, ‘maybe-remove-expired-cache-entries’ would periodically
delete old GC roots, regardless of whether there were still builds
queued for them.  This approach addresses that.

Partly fixes <https://issues.guix.gnu.org/54447>.

* src/cuirass/base.scm (derivation-queued?, delete-old-gc-roots)
(spawn-gc-root-cleaner): New procedures.
* src/cuirass/scripts/register.scm (cuirass-register): Call
‘spawn-gc-root-cleaner’.
* src/cuirass/store.scm (gc-roots, gc-root-expiration-time): Remove.
(register-gc-roots): Remove call to ‘maybe-remove-expired-cache-entries’.
2023-10-15 22:07:41 +02:00
Ludovic Courtès f03b94ea26
Update TODO. 2023-10-15 17:56:33 +02:00
Ludovic Courtès 1d9606566a
remote-server: Improve logging.
* src/cuirass/scripts/remote-server.scm (run-fetch): Log the number of
outputs being fetched.
2023-10-15 16:15:40 +02:00
Ludovic Courtès 711981e4cb
base: Set the checkout thread’s name.
This is meant as a debugging aid.

* src/cuirass/base.scm (channel-update-service): Add call to
‘set-thread-name’ within ‘non-blocking’.
2023-10-15 16:15:16 +02:00
Ludovic Courtès 93e27ff07c
http: Really gracefully handle missing file on /download.
This is a followup to 103a6ec27b.

* src/cuirass/http.scm (url-handler): Remove ‘catch 'system-error’ for
“/download” handler since ‘respond-file’ cannot possibly throw to
'system-error.  Add explicit ‘file-exists?’ call instead.
2023-10-12 23:15:51 +02:00
Ludovic Courtès db6b633711
base: Update the mtime of GC roots still in use.
This should prevent GC roots from being evicted when they are in fact
still used by recent evaluations.

See <https://issues.guix.gnu.org/54447>.

* src/cuirass/store.scm (register-gc-root): Add call to ‘utime’ upon EEXIST.
2023-10-10 18:38:12 +02:00
Ludovic Courtès 598902a57d
remote-server: Add ‘--log-expiry’ option.
* src/cuirass/scripts/remote-server.scm (show-help, %options): Add
‘--log-expiry’ option.
(%default-options): Add default value.
(delete-old-build-logs, spawn-build-log-cleaner): New procedures.
(cuirass-remote-server): Call it.
* doc/cuirass.texi (Invocation): Document it.
2023-10-10 15:57:25 +02:00
Ludovic Courtès 343c92bbad
remote-server: Rename ‘zmq-start-proxy’.
* src/cuirass/scripts/remote-server.scm (zmq-start-proxy): Rename to…
(serve-build-requests): … this.  Update docstring.
(cuirass-remote-server): Adjust accordingly.
2023-10-10 12:15:45 +02:00
Ludovic Courtès 9d60a88b63
base: Create an actor for inactive jobsets.
Fixes a bug whereby inactive jobsets would not get a corresponding
actors.  Consequently, marking them as “active” in the database and/or
modifying their spec via the web UI wouldn’t have any effect.

* src/cuirass/base.scm (jobset-monitor): Check whether SPEC is active,
and if not, wait for an ‘update-spec’ message.
(jobset-registry): Pass #:filter-inactive? #f.
2023-10-10 12:03:51 +02:00