Commit Graph

131 Commits

Author SHA1 Message Date
Ludovic Courtès bdcbf01fa5
utils: Add tests for the resource pool.
* tests/utils.scm: New file.
* Makefile.am (TESTS): Add it.
2023-11-16 22:16:27 +01:00
Ludovic Courtès eb3f539dc9
build: Delete ‘cuirass-remote-worker.service’ upon ‘make clean’.
* Makefile.am (MOSTLYCLEANFILES): Add ‘etc/cuirass-remote-worker.service’.
2023-10-29 23:02:25 +01:00
Ludovic Courtès c949436462
build: Add missing test files to the distribution.
* Makefile.am (EXTRA_DIST): Add ‘tests/common.scm’ and ‘tests/mail.sh’.
* tests/database.scm (mailer): Use ‘search-path’ to locate ‘mail.sh’
relative to $top_srcdir.
2023-10-29 22:58:14 +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 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 b0f93551bc
Move store and GC helpers from (cuirass base) to (cuirass store).
* src/cuirass/base.scm (default-gc-root-directory, %gc-root-directory)
(%gc-root-ttl, gc-roots, gc-root-expiration-time)
(register-gc-root, register-gc-roots)
(non-blocking-port, ensure-non-blocking-store-connection)
(with-store/non-blocking, process-build-log, build-derivations&): Move
to…
* src/cuirass/store.scm: … here.  New file.
* src/cuirass/scripts/remote-server.scm: Adjust accordingly.
* src/cuirass/scripts/remote-worker.scm: Likewise.
* src/cuirass/scripts/register.scm: Likewise.
* Makefile.am (dist_pkgmodule_DATA): Add ‘src/cuirass/store.scm’.
2023-09-13 19:00:12 +02:00
Ludovic Courtès e4233a94ea
config: Define '%runstatedir'.
* configure.ac: Require 2.71.
* Makefile.am (do_subst): Substitute $(runstatedir).
* src/cuirass/config.scm.in (%runstatedir): New variable.
* src/cuirass/base.scm (%cuirass-run-state-directory): New variable.
* guix.scm <native-inputs>: Use AUTOCONF-2.71.
2023-09-12 11:51:19 +02:00
Ludovic Courtès 931597826a
utils: Remove now useless 'object->json-string' & co.
* src/cuirass/utils.scm (alist?, object->json-scm)
(object->json-string): Remove.
* tests/utils.scm: Remove.
* Makefile.am (TESTS): Remove it.
* tests/http.scm ("object->json-string"): Remove.
2023-08-23 21:50:24 +02:00
Ludovic Courtès 95ca6edca5
build: Enable more compiler warnings.
* Makefile.am (GUILE_WARNINGS): New variable.
(.scm.go): Use it.
2023-08-15 16:20:31 +02:00
Ludovic Courtès a7b7ede9e7
Remove (cuirass watchdog).
This is a followup to 1d49240cc1.

* src/cuirass/watchdog.scm: Remove.
* Makefile.am (dist_pkgmodule_DATA): Remove it.
* src/cuirass/scripts/register.scm (cuirass-register): Remove call to
'start-watchdog'.
* src/cuirass/scripts/web.scm (cuirass-web): Likewise.
2023-07-15 18:24:04 +02:00
Ludovic Courtès e2123ab896
examples: Add jobset that builds "random" jobs.
* examples/random-manifest.scm, examples/random.scm: New files.
* Makefile.am (EXTRA_DIST): Add them.
2023-07-14 15:59:57 +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 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 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 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 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
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 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 b362f06b91
Add specifications deactivation support.
Add support to deactivate specifications. This allows to keep specifications
and the associated builds around but without evaluating them.

Fixes: <https://issues.guix.gnu.org/51837> and
<https://issues.guix.gnu.org/52110>.

* src/sql/upgrade-15.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Specification)[is_active]: New field.
* src/cuirass/database.scm (db-deactivate-specification): New procedure.
(db-add-or-update-specification, db-get-specifications): Adapt them.
* src/cuirass/http.scm (url-handler): New
/admin/specifications/deactivate/spec route.
* src/cuirass/specification.scm (<specification>)[is-active?]: New field.
(specification->sexp, sexp->specification): Adapt them.
* src/cuirass/templates.scm (specifications-table): Replace "Delete" by
"Deactivate".
* tests/database.scm (db-add-or-update-specification 3): New test.
2021-11-29 11:19:58 +01:00
Mathieu Othacehe 72a30ecd0a
database: Optimize the percentage query.
This decreases the query duration from ~20 seconds to ~35ms.

* src/sql/upgrade-14.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/cuirass/database.scm (db-get-build-percentages): Optimize it.
* src/schema.sql (Builds_id_job_status_index): Add it.
2021-11-26 13:55:10 +00:00
Mathieu Othacehe b726b017f0
Improve pending build selection perfomances.
* src/sql/upgrade-13.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (pending_dependencies): Remove it.
* src/cuirass/database.scm (db-get-pending-build): New procedure.
(db-get-builds): Remove "no-dependencies" support.
* src/cuirass/scripts/remote-server.scm (pop-build): Adapt to use the new
procedure.
* tests/database.scm: Adapt it.
2021-10-04 10:47:39 +00:00
Thiago Jung Bauermann bef5a7744f Add systemd unit file for remote worker service.
* etc/cuirass-remote-worker.service.in: New file.
* doc/cuirass.texi (Build modes): Mention it.
* .gitignore: Ignore it.
* Makefile.am (systemdservicedir): New variable.
(dist_systemdservice_DATA): Likewise.
(EXTRA_DIST): Add ‘etc/cuirass-remote-worker.service’.
(etc/cuirass-remote-worker.service): New target.
* configure.ac: Check for ‘(guix config)’ module.
Set and substitute ‘guix_localstatedir’ variable.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2021-09-16 22:00:15 +02:00
Mathieu Othacehe f0be14a95a
Add badge types.
* src/static/images/badge-per.svg: Rename it ...
* src/static/images/badge-percentage.svg: ... into this.
* src/static/images/badge-spec-percentage.svg: New file.
* Makefile.am (dist_images_DATA): Adapt it.
* src/cuirass/http.scm (url-handler): Add badge type support.
* src/cuirass/templates.scm (badge-svg): Add type parameter.
* doc/cuirass.texi (Badges): Document it.
2021-05-30 11:09:02 +02:00
Mathieu Othacehe 19da9be47a
Remove builds trigger.
The build_dependencies trigger scales really poorly when there is a large
number of pending builds. Remove this trigger and replace it with a
periodical update thread.

* src/sql/upgrade-12.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (update_build_dependencies, build_dependencies): Remove them.
* src/cuirass/database.scm (db-update-resumable-builds!): New procedure.
* src/cuirass/scripts/remote-server.scm (start-periodic-updates-thread): New
procedure.
(remote-server): Call it.
2021-05-29 15:34:15 +02:00
Mathieu Othacehe e6bfa48061
Fix badge display.
* src/static/images/badge-running.svg: Remove it.
* Makefile.am (dist_images_DATA): Ditto.
* src/cuirass/database.scm (db-get-latest-evaluation,
db-get-evaluation-absolute-summary): New procedures.
* src/cuirass/http.scm (url-handler): Fix badge display.
* src/cuirass/templates.scm (badge-svg): Adapt it.
* tests/database.scm ("db-get-evaluation-absolute-summary",
"db-get-latest-evaluation"): New tests.
* doc/cuirass.texi (Badges): Adapt it.
2021-05-28 14:11:42 +02:00
Mathieu Othacehe 54bff10fc7
Add badges support.
* src/static/images/badge-error.svg: New file.
* src/static/images/badge-per.svg: New file.
* src/static/images/badge-running.svg: New file.
* Makefile.am (dist_images_DATA): Add them.
* src/cuirass/templates.scm (badge-svg): New procedure.
* src/cuirass/http.scm (badge-string): New procedure.
(url-handler): Add a new "/jobset/spec/badge" route.
* doc/cuirass.texi (Badges): New section.
2021-05-28 11:21:58 +02:00
Mathieu Othacehe d1a95e8b33
Add build dependencies support.
* src/schema.sql (BuildDependencies): New table.
* src/sql/upgrade-11.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/cuirass/database.scm (db-add-build-dependencies,
db-get-build-dependencies,
db-update-failed-builds): New procedures.
* src/cuirass/http.scm (http-handler): Pass the build dependencies to the
build-details procedure.
* src/cuirass/scripts/remote-server.scm (pop-build): Select a build with no
dependencies.
(read-worker-exp): Remove the scheduled builds with failed dependencies.
* src/cuirass/templates.scm (build-details): Add a dependencies argument and
use it to display the build dependencies and their status.
* src/static/js/cuirass.js: Animate the dependencies collapse button.
* tests/database.scm ("db-add-build-dependencies",
"db-get-build-dependencies", "dependencies trigger"): New tests.
2021-05-25 13:19:37 +02:00
Mathieu Othacehe 97cf5b56d5
Make sure that the cached Job build status is always synchronized.
* src/sql/upgrade-10.sql: New file.
* Makefile.am (dist_sql_DATA): Update it.
* src/schema.sql (update_job_status): New function,
(build_status): new trigger.
2021-04-28 21:18:18 +02:00
Mathieu Othacehe 53d87e849d
Rationalize static files.
* src/static/js/popper.min.js: New file.
* src/static/js/jquery-3.6.0.min.js: Remove it.
* src/static/js/jquery-3.3.1.min.js: New file.
* src/static/js/cuirass.js: New file.
* src/static/js/bootstrap.min.js: New file.
* src/static/css/bootstrap.css: Rename it ...
* src/static/css/bootstrap.min.css: ... into this new file.
* src/cuirass/templates.scm (html-page): Adapt it.
* Makefile.am (dist_css_DATA, dist_js_DATA): Adapt them.
2021-04-23 15:06:42 +02:00
Mathieu Othacehe 428eacf9c4
Add bootstrap.bundle.min.js.
* src/static/js/bootstrap.bundle.min.js: New file.
* Makefile.am (dist_js_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Ditto.
* src/cuirass/templates.scm: Ditto.
2021-04-23 09:59:32 +02:00
Mathieu Othacehe f20309c559
Add indexes on Builds id foreign keys.
This considerably speeds up cascade deleting.

* src/sql/upgrade-9.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Jobs_build, BuildProducts_build, Notifications_build): New
indexes.
2021-04-21 09:53:36 +02:00
Mathieu Othacehe 17e8759efe
Optimize Jobs table. 2021-04-14 15:05:00 +02:00
Mathieu Othacehe d601fe0e4c
Fix Jobs Builds foreign key.
* src/sql/upgrade-6.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
2021-04-09 11:32:53 +02:00
Mathieu Othacehe 3dc6cf78b2
Add missing Jobs primary key.
* src/sql/upgrade-5.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
2021-04-09 10:15:30 +02:00
Mathieu Othacehe d86c4edee7
Add specification period support.
* src/sql/upgrade-4.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Specifications)[period]: New field.
* src/cuirass/base.scm (process-specs): Honor the specification period.
* src/cuirass/database.scm (db-get-time-since-previous-build): Rename it into ...
(db-get-time-since-previous-eval): ... this new procedure.
* src/cuirass/specification.scm (<specification>)[period]: New field.
(specification->sexp, sexp->specification): Adapt accordingly.
* src/cuirass/templates.scm (specification-edit): Ditto.
* tests/database.scm ("db-get-time-since-previous-build"): Remame it into ...
("db-get-time-since-previous-eval"): ... this new procedure.
2021-04-08 15:37:43 +02:00
Mathieu Othacehe 2c3440de5c
Use the Build id as Jobs foreign key.
Join Build and Jobs tables using the build id instead of the build derivation
to speed queries.

* src/sql/upgrade-3.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Jobs)[derivation]: Replace it by ...
[build]: this new column.
* src/cuirass/database.scm (db-add-job, db-get-jobs): Adapt them.
2021-04-08 10:49:41 +02:00
Mathieu Othacehe 63ce1c940b
Add d3.js support.
* src/static/js/d3.v6.min.js: New file.
* Makefile.am (dist_js_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Add it.
* src/cuirass/templates.scm (html-page): Add it.
2021-04-06 15:27:58 +02:00
Mathieu Othacehe bba1311478
Add jobs support.
Each evaluation registration produces a list of new jobs. Until now, only the
jobs which build outputs were not stored in the "Outputs" table were added to
the "Builds" table.

It means that Cuirass looses track of the job list associated to a given
evaluation.  This is problematic to provide the overall build status of an
evaluation or to find the evaluation providing the best build coverage.

Add a new "Jobs" table that stores the job list of each evaluation.  Also add
a new "/api/jobs" API to consult it.

* src/sql/upgrade-2.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Jobs): New table.
* src/cuirass/database.scm (db-add-job, db-get-jobs): New procedures.
(db-register-builds): Call db-add-job.
* src/cuirass/http.scm (url-handler): New "/api/jobs" route.
* tests/database.scm ("db-get-jobs", "db-get-jobs names"): New tests.
* doc/cuirass.texi (Web API, Database): Document it.
2021-04-06 15:18:55 +02:00
Mathieu Othacehe 1ed9360108
Add table order buttons. 2021-03-25 10:31:38 +01:00
Mathieu Othacehe 6f4a203a0b
Fix distribution. 2021-03-23 11:57:58 +01:00
Mathieu Othacehe 2efa062a4a
Update copyrights. 2021-03-22 18:31:41 +01:00
Mathieu Othacehe b645f4eb0c
Add remote building tests. 2021-03-22 18:29:07 +01:00
Mathieu Othacehe 34ab5c9912
Remove ui test. 2021-03-22 18:29:06 +01:00
Mathieu Othacehe 43d29317d9
Use a single Cuirass binary. 2021-03-22 18:29:06 +01:00
Mathieu Othacehe 9fbf6991fa
Add build parameter edition field. 2021-03-21 15:52:49 +01:00
Mathieu Othacehe 2eda35bf68
Remove send events binary.
This is superseeded by the notification system.
2021-03-14 20:48:25 +01:00
Mathieu Othacehe b24d55e368
Add specification creation and edition pages. 2021-03-11 19:31:35 +01:00
Mathieu Othacehe 463f5cd0f1
Reset database.
* src/sql/upgrade-2.sql: Remove it.
* src/sql/upgrade-3.sql: Remove it.
* src/sql/upgrade-4.sql: Remove it.
* src/sql/upgrade-5.sql: Remove it.
* Makefile.am (dist_sql_DATA): Adapt it.
2021-03-10 08:53:39 +01:00
Mathieu Othacehe 325edf2ffa
Rewrite evaluation. 2021-03-05 09:08:15 +01:00