2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2024-12-29 11:40:16 +01:00
Commit graph

901 commits

Author SHA1 Message Date
Ludovic Courtès
adabe31c30
doc: Mention authentication.
* README (Contributing): Document authentication procedure.
2023-05-09 16:26:36 +02:00
Ludovic Courtès
c75620777c
Add '.guix-authorizations'.
* .guix-authorizations: New file.
2023-05-09 15:51:29 +02:00
Ludovic Courtès
cf4e3e4ac4 tests: Make sure remote tests build a new derivation.
* tests/remote.scm (dummy-drv): Define 'none'.
2023-05-03 11:13:51 +02:00
Ludovic Courtès
6fa99ec2c9 tests: Use 'spawn' when available.
* tests/remote.scm (spawn?): New variable.
(start-worker, start-server): Use it instead of 'primitive-fork'.
2023-05-02 17:57:47 +02:00
Ludovic Courtès
af7e84b677 tests: Skip when guix-daemon and avahi-daemon are not running.
* tests/remote.scm (drv, drv-with-timeout): Wrap in a promise and adjust
users accordingly.
(guix-daemon-running?, avahi-daemon-running?): New procedures.
<top level>: Add 'test-skip' call.
2023-05-02 17:35:05 +02:00
Ludovic Courtès
ca428665c9 notification: Autoload Mastodon code.
* src/cuirass/mastodon.scm: Autoload (mastodon) modules.
* src/cuirass/notification.scm: Autoload (cuirass mastodon).
2023-05-02 17:35:05 +02:00
Ludovic Courtès
9fb6f21d29 remote-worker: Prevent non-local exits in child processes.
Previously, a non-local exit (such as an uncaught exception) in the
child process would cause it to execute the same code as its parent.

* src/cuirass/scripts/remote-worker.scm (start-worker): Wrap child body
in 'dynamic-wind'.
2022-11-23 15:23:52 +01:00
Ludovic Courtès
1c806cc64e evaluate: Enable channel authentication.
* src/cuirass/base.scm (process-specs): Remove #:authenticate? parameter
to 'latest-channel-instances*'.
2022-11-21 17:35:31 +01:00
Mathieu Othacehe
1341725f2c
remote-worker: Increase the request period to 30 seconds
* src/cuirass/scripts/remote-worker.scm (%request-period): Increase it to
reduce the server pressure.
2022-11-20 18:32:44 +01:00
Mathieu Othacehe
fc1641381d
remote-worker: Prevent a dead-hang on server disconnection.
This is a follow-up of 1fb4b0ac12 that tried to
work around the remote-worker hangs by introducing a non-blocking read.

This solution was problematic because when the server is unresponsive, the
request-work requests are queued on the worker. When the server is back
online, the requests were all sent to server.

Use instead the ZMQ_PROBE_ROUTER option that causes the server to send an
empty boostrap message to the worker when a connection is established. This
empty message will unlock the workers that were hanging on the request-work
response.

* src/cuirass/scripts/remote-server.scm (zmq-start-proxy): Set the
ZMQ_PROBE_ROUTER option on the build socket.
* src/cuirass/scripts/remote-worker.scm (start-worker): Ignore the bootstrap
message when reading server info however, when receiving a bootstrap message
while waiting for a request-work response, keep going.
2022-11-20 18:31:51 +01:00
Mathieu Othacehe
553f107d37
Revert "remote-worker: Do not block on request-work response."
This reverts commit 1fb4b0ac12.
2022-11-20 18:31:51 +01:00
Mathieu Othacehe
06745e45ad
remote-worker: Use GiB thresholds.
* src/cuirass/scripts/remote-worker.scm (show-help, %options): Adapt them.
(%minimum-disk-space): Define if before %default-options in order to use it to
set the default value. Use a 5GiB threshold because image builds that are
frequently failing due to the lack of space require a lot more than 100MiB.
2022-11-20 18:31:50 +01:00
Mathieu Othacehe
54630d87a1
remote-worker: Fix a typo.
This is a follow-up of: 228b4a4f72.

* src/cuirass/scripts/remote-worker.scm (low-disk-space?): Fix a typo.
2022-11-20 18:16:51 +01:00
Ludovic Courtès
f030486c23 evaluate: Create just as many threads as needed.
When using 'par-for-each', we'd spawn the whole thread pool of (ice-9
futures), with one thread per core.  Using 'n-par-for-each' allows us to
spawn just as many threads as needed.

* src/cuirass/scripts/evaluate.scm (cuirass-evaluate): Use
'n-par-for-each' instead of 'par-for-each'.
2022-11-18 16:37:58 +01:00
Ludovic Courtès
3813dd96c9 evaluate: Remove unnecessary module imports.
* src/cuirass/scripts/evaluate.scm: Remove unnecessary module imports.
Use #:autoload and #:select.
2022-11-18 16:33:01 +01:00
Ludovic Courtès
228b4a4f72 remote-worker: Do not request work when disk space is low.
This helps ensure workers don't pick up builds that are likely to fail
due to ENOSPC.

* src/cuirass/scripts/remote-worker.scm (show-help, %options): Add
'--minimum-disk-space' option.
(%default-options): Add 'minimum-disk-space'.
(%minimum-disk-space): New variable.
(low-disk-space?): New procedure.
(start-worker): Call 'request-work' only when 'low-disk-space?' returns #f.
(cuirass-remote-worker): Parameterize %MINIMUM-DISK-SPACE.
2022-11-18 16:32:21 +01:00
Mathieu Othacehe
1fb4b0ac12
remote-worker: Do not block on request-work response.
When the worker sends a request-work message to the server, it then waits
undefinitely for a response. If the server receives the response but dies
before answering, the client can be blocked forever.

* src/cuirass/remote.scm (EAGAIN-safe): New macro.
(zmq-get-msg-parts-bytevector/no-wait): New procedure.
* src/cuirass/scripts/remote-worker.scm (start-worker): Use the above
procedure not to wait the server response undefinitely.
2022-11-12 11:50:51 +01:00
Tobias Geerinckx-Rice
4745c81875
templates: Warn of the perils of stateful changes.
* src/cuirass/templates.scm (specification-edit): Add a warning
explaining that such changes might be overwritten.
2022-10-23 02:00:00 +02:00
Tobias Geerinckx-Rice
01c9398225
Fix typo in cuirass-remote-worker.service's description.
…and add a note about customisation to the header comment.

etc/cuirass-remote-worker.service.in (Description): ‘remmote’ → ‘remote’.
2022-10-23 02:00:00 +02:00
Tobias Geerinckx-Rice
d0369fc729
cuirass.js: Increase Dashboard colour contrast 2022-09-25 02:00:00 +02:00
Ludovic Courtès
f087aaf685 evaluate: Explicitly close inferiors no longer used.
* src/cuirass/scripts/evaluate.scm (inferior-evaluation): Add call to
'close-inferior'.
2022-05-16 12:05:15 +02:00
Mathieu Othacehe
51748d7d52
templates: Forbid '/' character in specification name.
* src/cuirass/templates.scm (specification-edit): Forbid it.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-04-26 10:18:54 +02:00
Mathieu Othacehe
1c45ae3c6b
http: Decode all URI arguments.
Fixes: <https://issues.guix.gnu.org/55024>.

* src/cuirass/http.scm (body->specification): Decode all arguments and not
only channel URL and build params.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-04-26 10:17:35 +02:00
Mathieu Othacehe
1174185377
templates: Update copyright.
* src/cuirass/templates.scm (html-page): Update it.
2022-01-20 15:30:01 +01:00
Mathieu Othacehe
9f08035f94
tests: Fix database tests.
* tests/database.scm: Fix it.
2022-01-19 10:55:18 +01:00
Mathieu Othacehe
07a419e34a
database: Do not always filter specifications.
* src/cuirass/database.scm (db-get-specification): Always return the requested
specification even if it is inactive.
2022-01-19 10:40:18 +01:00
Mathieu Othacehe
9a50aa17b8
build: Fix typo.
* Makefile.am: Fix it.
2022-01-19 09:21:02 +01:00
Mathieu Othacehe
95c29ab9ab
Revert "Build cuirass scripts."
This reverts commit 3d91c44714. It also makes
sure that the scripts are compiled.
2022-01-09 18:52:33 +01:00
Mathieu Othacehe
16906595cf
remote-server: Show wider backtraces.
* src/cuirass/scripts/remote-server.scm (cuirass-remote-server): Set "COLUMNS"
to 500.
2022-01-09 18:00:27 +01:00
Mathieu Othacehe
3d91c44714
Build cuirass scripts.
* Makefile.am (scriptsmoduledir, scriptsobjectdir, dist_scriptsmodule_DATA):
Remove them.
(dist_pkgmodule_DATA): Add the scripts.
2022-01-09 17:59:28 +01:00
Mathieu Othacehe
d81d994979
remote-server: Increase max open files limit.
* src/cuirass/scripts/remote-server.scm (cuirass-remote-server): Increase it.
2022-01-09 10:50:13 +01:00
Mathieu Othacehe
d9a4ea25e4
templates: Display the build weather text.
Fixes: <https://issues.guix.gnu.org/52840>.

* src/cuirass/templates.scm (build-details): Display it.
2021-12-28 10:18:27 +01:00
Mathieu Othacehe
ca37049a70
database: Record the starttime and stoptime of failed dependency builds.
Proposed by Leo Famulari here: <https://issues.guix.gnu.org/52487>.

* src/cuirass/database.scm (db-update-failed-builds!): Record the starttime
and stopttime.
2021-12-17 15:55:37 +01:00
Mathieu Othacehe
5314c5dc4b
templates: Factorize completed? procedures.
Also distinguish between a build that is completed from a build that is
completed with some available logs.

* src/cuirass/templates.scm (completed?, completed-with-logs?): New
procedures.
2021-12-17 15:54:23 +01:00
Mathieu Othacehe
04e3adcbb2
remote-server: Fix cache-directory creation.
* src/cuirass/scripts/remote-server.scm (cuirass-remote-server): Create the
cache-directory only once user privileges have been gathered.
2021-12-17 15:21:59 +01:00
Mathieu Othacehe
4b7bc873b3
remote: Handle client premature disconnections.
* src/cuirass/remote.scm (receive-logs): Catch premature client disconnections
and report them.
2021-12-17 15:09:04 +01:00
Mathieu Othacehe
b9c36654cc
remote-worker: Catch send-log errors.
* src/cuirass/scripts/remote-worker.scm (run-build): If the worker was not
able to send the build logs, report it, dump the build logs them and keep
things going.
2021-12-17 15:07:29 +01:00
Mathieu Othacehe
ee82d72566
remote: Remove extra new-line.
* src/cuirass/remote.scm: Remove extra new-line.
2021-12-17 15:06:54 +01:00
Mathieu Othacehe
5092f08a3e
remote-server: Log wrongly formatted messages.
* src/cuirass/scripts/remote-server.scm (zmq-start-proxy): Log wrongly
formatted messages.
2021-12-17 14:27:34 +01:00
Mathieu Othacehe
7160b182a0
database: Optimize db-clear-build-queue.
* src/cuirass/database.scm (db-clear-build-queue): Ignore builds that are
already scheduled.
2021-12-14 13:19:11 +01:00
Leo Famulari
d6a186ca18
templates: Suggest a specification example that works on ci.guix.gnu.org
The specification used to build our master branch was renamed from
"guix-master" to "master".

* doc/cuirass.texi (API description): Change "guix-master" to "master".
* src/cuirass/templates.scm: Change "guix-master" to "master".
2021-12-14 08:26:43 +01:00
Mathieu Othacehe
a1f11b6bd6
remote-server: Turn log-info into log-debug.
* src/cuirass/scripts/remote-server.scm (read-worker-exp): Turn log-info into
log-debug.
2021-12-07 09:43:14 +01:00
Mathieu Othacehe
4c2b45216e
Introduce log levels.
* src/cuirass/logging.scm (log-info, log-debug, log-warning, log-error): New procedures.
* src/cuirass/base.scm: Introduce log levels.
* src/cuirass/database.scm: Ditto.
* src/cuirass/http.scm: Ditto.
* src/cuirass/metrics.scm: Ditto.
* src/cuirass/notification.scm: Ditto.
* src/cuirass/remote.scm: Ditto.
* src/cuirass/scripts/register.scm: Ditto.
* src/cuirass/scripts/remote-server.scm: Ditto.
* src/cuirass/scripts/remote-worker.scm: Ditto.
* src/cuirass/scripts/web.scm: Ditto.
* src/cuirass/utils.scm: Ditto.
* src/cuirass/watchdog.scm: Ditto.
2021-12-06 14:15:41 +01:00
Mathieu Othacehe
d05ef0bb5c
remote-server: Fix add-to-store procedure.
* src/cuirass/scripts/remote-server.scm (add-to-store): Add a drv argument.
2021-12-06 12:10:43 +01:00
Mathieu Othacehe
41c10b6688
remote-server: Move trigger-substitutes-baking procedure.
* src/cuirass/scripts/remote-server.scm: Move trigger-substitutes-baking upper.
2021-12-06 12:04:58 +01:00
Mathieu Othacehe
e8a233eb0b
remote-server: Fix typo.
* src/cuirass/scripts/remote-server.scm: Fix typo.
2021-12-06 12:03:55 +01:00
Mathieu Othacehe
3529f68cbb
remote-server: Add missing include.
* src/cuirass/scripts/remote-server.scm: Add missing include.
2021-12-06 12:03:00 +01:00
Mathieu Othacehe
d4777f562d
remote-server: Only register gc-roots when ensure-path is successful.
* src/cuirass/scripts/remote-server.scm (add-to-store): Take care of
registering the GC roots and triggering the baking if the ensure-path call is
successful.
(trigger-substitutes-baking): Take a single output argument.
(need-fetching?): Add logging.
(run-fetch): Adapt it.
2021-12-06 11:57:15 +01:00
Mathieu Othacehe
c832d1523d
ensure-path: Catch nar-error exceptions.
* src/cuirass/scripts/remote-server.scm (ensure-path*): Catch &nar-error.
2021-12-06 11:56:28 +01:00
Mathieu Othacehe
6dcf2f65ce
Ignore ENOENT in register-gc-roots.
* src/cuirass/base.scm (register-gc-roots): Ignore ENOENT exceptions.
* src/cuirass/scripts/remote-server.scm (run-fetch): Adapt it.

Suggested-by: Ludovic Courtès <ludo@gnu.org>
2021-12-06 09:44:56 +01:00