Commit Graph

1152 Commits

Author SHA1 Message Date
Ludovic Courtès b498ff8f75
remote: Add more logging.
* src/cuirass/scripts/remote-server.scm (read-worker-exp)[update-worker!]:
Add 'log-debug' call.
* src/cuirass/scripts/remote-worker.scm (start-worker): Add 'log-info'
calls.
(cuirass-remote-worker): Likewise.
* tests/remote.scm (start-worker, start-server): Set 'CUIRASS_LOGGING_LEVEL'.
2023-06-29 11:44:56 +02:00
Ludovic Courtès 480ae5440d
Show the right program name in '--version'.
* src/cuirass/scripts/remote-server.scm (%options): Fix program name
passed as a 'show-version-and-exit' argument.
* src/cuirass/scripts/remote-worker.scm (%options): Likewise.
2023-06-28 23:41:56 +02:00
Ludovic Courtès ae4179907f
database: 'db-get-latest-checkout' might get zero rows.
* src/cuirass/database.scm (db-get-latest-checkout): Remove call to
'expect-one-row' and adjust 'match' pattern accordingly.
2023-06-26 23:36:24 +02:00
Ludovic Courtès d2ba893a39
doc: Document '--build-remote'.
* doc/cuirass.texi (Invoking cuirass register): Document
'--build-remote'.
(Invoking cuirass remote-server): Mention it.
2023-06-26 23:17:22 +02:00
Ludovic Courtès cbe31acdee
.guix-authorizations: Add Maxim Cournoyer to the committers.
* .guix-authorizations: Add key for apteryx.
2023-06-22 21:52:54 +02:00
Ludovic Courtès b724dfa322
http: Evaluation dashboard shows the full list of channels.
This is a followup to c7db7f88a2, which
would only show, say, 'guix-past' and not 'guix' (the latter being a
dependency of the former).

* src/cuirass/http.scm (dashboard-page): Call 'latest-checkouts' and
pass #:checkouts to 'evaluation-dashboard'.
* src/cuirass/templates.scm (evaluation-dashboard): Add #:checkouts and
honor it.
2023-06-18 15:14:38 +02:00
Ludovic Courtès 6c877943da
remote-server: Slight clarification.
* src/cuirass/scripts/remote-server.scm (zmq-start-proxy): Move
'fetch-msg' right where it's used.
2023-06-18 15:14:35 +02:00
Ludovic Courtès bb7579acc0
remote: Remove 'zmq-socket-ready?'.
* src/cuirass/remote.scm (zmq-socket-ready?): Remove.
* src/cuirass/scripts/remote-server.scm (zmq-start-proxy): Use 'memq'
instead.
[socket-ready?]: Remove.
2023-06-18 14:53:07 +02:00
Ludovic Courtès c74d60d194
http: Add 'Cache-Control' header on /static files.
* src/cuirass/http.scm (%static-file-ttl): New variable.
(url-handler)[respond-file]: Add #:ttl and honor it.
[respond-static-file]: Pass #:ttl.
2023-06-15 14:12:08 +02:00
Maxim Cournoyer 7c9fc0645e
doc: Document authentication.
* etc/new-client-cert.scm: Add script.
* doc/cuirass.texi (Authentication): Document it.
* Makefile.am (noinst_SCRIPTS): Register it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-06-14 23:15:12 +02:00
Ludovic Courtès b76c04199f
http: Show a longer build history.
* src/cuirass/http.scm (url-handler): in "/build/N/details", increase
'nr' for the build history.
2023-06-13 11:05:06 +02:00
Ludovic Courtès a46419fe42
http: Add route for "/eval/latest?spec=...".
* src/cuirass/http.scm (url-handler): Add route for
"/eval/latest?spec=...".
2023-06-12 23:28:30 +02:00
Ludovic Courtès c7db7f88a2
templates: Evaluation dashboard shows completion time and commits.
* src/cuirass/templates.scm (evaluation-dashboard): Rename 'evaluation'
to 'evaluation-id'.  Add #:channels.  Add 'details' block showing
completion time and checkouts.
2023-06-12 23:28:28 +02:00
Ludovic Courtès 8a4cb66123
templates: Factorize 'checkout-table'.
* src/cuirass/templates.scm (checkout-table): New procedure.
(evaluation-build-table): Use it.
2023-06-12 23:28:12 +02:00
Ludovic Courtès 7d9d7c843d
templates: Evaluation dashboard links to evaluation page.
* src/cuirass/templates.scm (evaluation-dashboard): Link to evaluation
page.
2023-06-12 23:28:11 +02:00
Ludovic Courtès 36851deac3
README: Adjust 'guix shell' instructions.
* README: Expose X.509 certificates.  Fix typos.
2023-06-12 22:16:47 +02:00
Ludovic Courtès b82596778b
README: Update instructions for development and testing.
* README (Requirements): Add '--expose' and explain.
(Database connection): Add example with 'pg_tmp'.
2023-06-02 11:11:48 +02:00
Ludovic Courtès f92fba1184
base: Log successful checkouts.
* src/cuirass/base.scm (process-specs): Add 'log-info' call in
'new-channels' value.
2023-06-02 10:01:27 +02:00
Ludovic Courtès d8ac891e0d
base: Remove extra 'log-error' call.
Typo introduced in 93d51df182.

* src/cuirass/base.scm (process-specs): Remove extra 'log-error' call.
2023-06-02 10:00:17 +02:00
Ludovic Courtès 8eb67256a1
examples: Add spec for Cuirass.
* examples/cuirass.scm: New file.
* Makefile.am (EXTRA_DIST): Add it and 'examples/hello.scm'.
2023-06-02 09:49:41 +02:00
Ludovic Courtès b719f7df47
http: Remove unused variable.
* src/cuirass/http.scm (url-handler): Remove unused 'params' variable.
2023-06-02 00:28:22 +02:00
Ludovic Courtès 63b5f6db80
base: Fix logging levels for build logs.
* src/cuirass/base.scm (handle-build-event): Use logging levels more
appropriate than 'log-error'.
2023-06-02 00:28:22 +02:00
Ludovic Courtès d0b08b0d40
http: Add /eval/latest/dashboard endpoint.
* src/cuirass/http.scm (url-handler)[redirect]: New procedure.
Add clause for /eval/latest/dashboard.
* src/cuirass/templates.scm (specifications-table): Link to it.
2023-06-02 00:28:22 +02:00
Ludovic Courtès 0eb24588be
base: 'spawn-builds' keeps going upon build failure.
* src/cuirass/base.scm (spawn-builds): Add 'set-build-options' call.
Previously, we'd build with #:keep-going? #false, which made Cuirass
build very little when not using the "remote worker" mechanism.
2023-06-02 00:28:22 +02:00
Ludovic Courtès 93d51df182
base: Catch all errors occurring while processing a spec.
Previously, an error such as 'system-error would be uncaught, which
would (presumably) lead 'cuirass register' to exit right away, via
'essential-task'.

* src/cuirass/base.scm (process-specs): Use 'with-exception-handler' +
'let/ec' instead of 'catch'.  Report 'system-error' exceptions in
detail.  Print other exceptions as well.
2023-06-02 00:28:21 +02:00
Ludovic Courtès 341525a901
logging: Use 'match' instead of 'cond'.
* src/cuirass/logging.scm (log-message): Use 'match' instead of 'cond'.
2023-06-02 00:28:17 +02:00
Ludovic Courtès e50469877b
logging: Always log errors.
Fixes a regression introduced in
f1f0489ed7 where 'error-level messages
would never be logged.

* src/cuirass/logging.scm (log-message): Always log errors.
2023-06-01 19:00:21 +02:00
Ludovic Courtès 425ede115e
utils: Remove 'put-message-with-timeout' and 'get-message-with-timeout'.
These primitives are no longer used.  They're also antithetical to the
"communicating sequential processes" (CSP) model where communication is
synchronous and lack of a recipient or sender can lead to lockups.

* src/cuirass/utils.scm (with-timeout)
(put-message-with-timeout, get-message-with-timeout): Remove.
2023-05-31 16:20:30 +02:00
Ludovic Courtès cd94670f1d
utils: Remove "worker thread" helpers.
* src/cuirass/utils.scm (%worker-thread-args)
(make-worker-thread-channel, call-with-worker-thread)
(with-worker-thread): Remove.
2023-05-31 16:20:29 +02:00
Ludovic Courtès c4743b5472
database: Use a connection pool.
With 'exec-query' from (squee) no longer blocking, we no longer need to
carry out 'exec-query' calls in a dedicated worker thread.  However, it
is useful to have a pool of database connections at hand to allow for
concurrent queries.

Thanks to Christopher Baines for suggesting the use of a connection pool.

* src/cuirass/database.scm (%db-channel): Remove.
(%db-connection-pool, %db-connection-pool-size): New variables.
(with-database): Rewrite to use 'make-resource-pool' when in a fiber
context.
(current-db): New variable.
(with-db-worker-thread): Rewrite to use 'current-db' or
'with-resource-from-pool' when appropriate, and plain 'db-open'
otherwise.
* tests/common.scm (test-init-db!): Remove reference to '%db-channel'.
* tests/database.scm (with-fibers): New macro.
Use it throughout.
* configure.ac: Check whether Guile-Squee is recent enough.
2023-05-31 16:20:29 +02:00
Ludovic Courtès 1f0e059557
utils: Add resource pool.
* src/cuirass/utils.scm (make-resource-pool)
(call-with-resource-from-pool): New procedures.
(with-resource-from-pool): New macro.
2023-05-31 16:20:27 +02:00
Ludovic Courtès e03a2570c6
build: "make clean" deletes src/cuirass/scripts/*.go.
* Makefile.am (CLEANFILES): Fix typo in "nodist_scriptsobject_DATA".
2023-05-31 00:16:08 +02:00
Ludovic Courtès 211b44c3c4
Remove unused '%use-substitutes?' parameter and '--use-substitutes'.
'%use-substitutes?' had an effect when it was introduced in
fca42b010e but it got lost eventually.

* src/cuirass/base.scm (%use-substitutes?): Remove.
* src/cuirass/scripts/register.scm (show-help): Remove
'--use-substitutes'.
(cuirass-register): Remove dead store to '%use-substitutes?'.
* doc/cuirass.texi (Invocation): Remove '--use-substitutes'.
2023-05-30 23:24:00 +02:00
Ludovic Courtès 4a8a4bc1f8
guix: Run tests in parallel.
* build-aux/guix/cuirass-package.scm (cuirass)[arguments]:
Remove #:parallel-tests? #f.
2023-05-10 00:14:34 +02:00
Ludovic Courtès af1580edb0
guix: Remove unnecessary build phases.
* build-aux/guix/cuirass-package.scm (cuirass)[arguments]: Remove
'disable-remote-tests' and 'set-PATH-for-tests' phases, which are
unnecessary.
2023-05-10 00:12:13 +02:00
Ludovic Courtès 899aa36993
ui: Add missing import.
This is a followup to aa47fa32b2.

* src/cuirass/ui.scm: Import (cuirass logging).
2023-05-10 00:08:41 +02:00
Ludovic Courtès febb1bd870
templates: Update copyright line in footer.
* src/cuirass/templates.scm (html-page): Update copyright line.
2023-05-09 17:16:17 +02:00
Ludovic Courtès aa47fa32b2
ui: Make 'current-logging-port' line-buffered.
* src/cuirass/ui.scm (run-cuirass): Add 'setvbuf' call.
2023-05-09 17:02:59 +02:00
Ludovic Courtès 70917dbfd0
base: Remove now unnecessary 'read-line/non-blocking' procedure.
It seems 'read-line' has always been non-blocking, according to (ice-9
suspendable-ports) history.

* src/cuirass/base.scm (read-line/non-blocking): Remove.
(process-build-log): Adjust accordingly.
2023-05-09 16:27:58 +02:00
Ludovic Courtès b9aa0f1df6
maint: Remove 'ChangeLog' generation rule.
* build-aux/gitlog-to-changelog: Remove.
* Makefile.am (gen-ChangeLog): Remove.
(dist-hook): No longer depend on it.
2023-05-09 16:27:58 +02:00
Ludovic Courtès d636906254
maint: Turn into a Guix channel.
* .guix-channel: New file.
2023-05-09 16:27:57 +02:00
Ludovic Courtès 579f674656
maint: Update Guix package definition.
* build-aux/guix.scm: Rename to...
* build-aux/guix/cuirass-package.scm: ... this.  Turn into a module and
update package definition.
* guix.scm: Add symlink.
* Makefile.am (EXTRA_DIST): Update accordingly.
2023-05-09 16:27:57 +02:00
Ludovic Courtès 56cb222381
utils: Remove unused 'bytevector-range' procedure.
* src/cuirass/utils.scm (%weak-references, bytevector-range): Remove.
2023-05-09 16:27:57 +02:00
Ludovic Courtès 89451ba090
metrics: Make "updating metric" messages debug-level.
* src/cuirass/metrics.scm (db-update-metric): Use 'log-debug' for
"updating metric" messages.
2023-05-09 16:27:57 +02:00
Ludovic Courtès f1f0489ed7
logging: Honor 'CUIRASS_LOGGING_LEVEL'.
* src/cuirass/logging.scm (current-logging-level): New variable.
(log-message): Honor it.
2023-05-09 16:27:57 +02:00
Ludovic Courtès 830e2f2901
logging: Do not include a timestamp by default.
The timestamp was redundant with that added by shepherd.

* src/cuirass/logging.scm (current-logging-procedure): Change default
value to not include a timestamp unless writing to a tty.
2023-05-09 16:27:57 +02:00
Ludovic Courtès 1d49240cc1
Require Fibers >= 1.1.0.
Fixes <https://issues.guix.gnu.org/63389>.

We were hitting an old bug from Fibers 1.0.x.

* configure.ac: Check for (fibers scheduler).
* src/cuirass/base.scm <top level>: Remove workaround for Fibers <= 1.0.0.
* src/cuirass/utils.scm (make-worker-thread-channel): Do not
parameterize 'current-fiber'.
(%non-blocking): Likewise.
(call-with-worker-thread): Remove references to 'current-fiber'.
* src/cuirass/watchdog.scm (start-watchdog): Annihilate.
2023-05-09 16:27:38 +02:00
Ludovic Courtès 642911f505
base: Remove now unnecessary 'with-store' replacement.
This 'with-store' macro has become unnecessary since Guix commit
8ed597f4a261fe188de82cd1f5daed83dba948eb, which changes its own
'with-store' macro to not rely on 'dynamic-wind'.

Furthermore, this definition of 'unwind-protect' would rewrap SRFI-34
exceptions on Guile 3.0 in something like this:

  #<&compound-exception components: (#<&error> #<&irritants irritants: (#<&evaluation-error name: "shepherd" id: 26>)> #<&exception-with-kind-and-args kind: %exception args: (#<&evaluation-error name: "shepherd" id: 26>)>)>

The 'error?' and 'evaluation-error?' predicates would return #f for
these things, thereby leaving an uncaught exception in the fiber calling
'process-specs'.

* src/cuirass/base.scm (with-store): Remove.
* src/cuirass/utils.scm (unwind-protect): Remove.
2023-05-09 16:26:37 +02:00
Ludovic Courtès 9dc92c37f8
build: Require Guile >= 3.0.6.
* configure.ac: Require Guile >= 3.0.6.
* src/cuirass/base.scm (read/non-blocking): Remove.
(evaluate): Adjust accordingly.
2023-05-09 16:26:37 +02:00
Ludovic Courtès 5543971899
build: Require Guile 3.0.
* configure.ac: Require Guile 3.0.
* src/cuirass/base.scm <top level>: Remove 'cond-expand' form.
2023-05-09 16:26:36 +02:00