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

79 commits

Author SHA1 Message Date
Mathieu Othacehe f6fdb13b50
Add Mastodon support.
* src/cuirass/mastodon.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/notification.scm (notification-type): Add "mastodon".
(notification-mastodon): New procedure.
(send-notifications): Add it.
2021-02-21 10:37:11 +01:00
Mathieu Othacehe 4495e08542
Add notifications support.
* src/cuirass/mail.scm: New file.
* src/cuirass/notification.scm: New file.
* src/sql/upgrade-5.sql: New file.
* Makefile.am (dist_pkgmodule_DATA, dist_sql_DATA): Add them.
* src/schema.sql (Specifications)[notifications]: New field.
* bin/cuirass.in: Wrap inside the "with-notification" macro.
* src/cuirass/remote-server.scm (remote-server): Ditto.
* src/cuirass/database.scm (db-add-specification): Add notifications field.
(db-get-specifications): Ditto.
(db-update-build-status!): Send notifications.
* tests/mail.sh: New file.
* tests/database.scm (mu-debug, tmp-mail): New variables.
(mailer): New procedure.
(example-spec): Add an email notification.
("mail-notification"): New test case.
2021-02-21 09:55:41 +01:00
Mathieu Othacehe 731bc83488
Fix dist rule.
* Makefile.am (dist_images_DATA): Update it.
2021-02-21 09:14:23 +01:00
Mathieu Othacehe ac98f81671
Add Zabbix support. 2021-02-08 12:26:35 +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 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 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 08a8215155
Fix binary generation.
* Makefile.am (install-exec-hook): Process all binaries.
2021-01-18 16:16:26 +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
Mathieu Othacehe 3673fc310d
Save the build machine.
* src/sql/upgrade-17.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds): Add "machine" field.
* src/cuirass/database.scm (db-update-build-machine!): New procedure.
* src/cuirass/base.scm (handle-build-event): Use it to record the machine
performing the build.
2020-12-09 12:16:48 +01:00
Mathieu Othacehe fd432b8e8f
Use specification for periodic builds.
When the periodic argument is passed to a job, it will be registered only if
the time difference between the current time and the registration time of the
last build is greater than the specified period. Make sure that the last job
that is searched is part of the same specification.

* src/sql/upgrade-16.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds_job_name_timestamp): New index.
* src/cuirass/database.scm (db-get-time-since-previous-build): Add
"specification" argument,
(db-register-builds): pass it.
2020-11-25 16:49:22 +01:00
Mathieu Othacehe cb2c4e3d8f
Optimize build query.
Make sure that db-get-builds only performs one query and add build products to
the result. Also add indexes so that all "order" filters are covered.

Limit the maximum of build objects returned in "/api/latestbuilds" and
"/api/queue" to 1000.

Fixes: <https://issues.guix.gnu.org/43826>.

* src/sql/upgrade-15.sql: New file.
* Makefile (dist_sql_DATA): Add it.
* src/cuirass/database.scm (db-get-builds-by-search): Add "buildproducts" to
the returned build objects.
(db-get-builds): Remove unused filters. Join Outputs and BuildProducts table
in the query. Add "buildproducts" to the returned build objects.
* src/cuirass/http.scm (build->hydra-build): Use "buildproducts" from
"db-get-builds" procedure.
(url-handler): Forbid limit parameters greater than 1000 and use
"buildproducts" from "db-get-builds" procedure.
* src/schema.sql (Builds_stoptime, Builds_stoptime_id, Builds_status_ts_id):
New indexes.
2020-10-07 13:07:05 +02:00
Mathieu Othacehe 04e95afa1e
Add index on builds table.
* src/sql/upgrade-14.sql: New file.
* src/schema.sql (dist_sql_DATA): Add it.
* src/schema.sql (Builds_timestamp_stoptime): New index.
2020-10-06 18:26:28 +02:00
Mathieu Othacehe 930c2f315c
Do not allow full search on nix_name field.
Searching for something like "%a%" can take up to ten minutes. Remove the
usage of special characters "^" and "$" in queries. Instead, always add a "%"
character at the end of the query. Also add an index on the nix_name field.

Fixes: <https://issues.guix.gnu.org/43791>.

* src/sql/upgrade-13.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds_nix_name): New index.
* src/cuirass/database.scm (query->bind-arguments): Remove support for "^" and
"$" special characters. Instead make sure that the query does not contain any
"%" character and prefix the query by "%".
(db-get-builds-by-search): Remove an useless query nesting level.
* src/cuirass/templates.scm (search-form): Adapt the search help message
accordingly.
2020-10-05 14:54:06 +02:00
Mathieu Othacehe eb8d1b88ad
Add watchdog support.
* src/cuirass/watchdog.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/utils.scm (with-timeout, get-message-with-timeout): Export them.
* bin/cuirass.in (main): Start the watchdog.
2020-09-29 17:02:45 +02:00
Mathieu Othacehe 0ffcb80ebb
Optimize database queries.
Avoid full scans of Builds table that can be very time consuming by rewriting
some queries and using new indexes.

* src/sql/upgrade-12.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
* src/schema.sql (Builds_evaluation_index, Evaluations_status_index,
Evaluations_specification_index): New indexes.
* src/cuirass/database.scm (db-get-evaluations-build-summary,
db-get-evaluation-summary): Rewrite queries to avoid full Builds table scan
and use the new indexes.
2020-09-28 17:49:55 +02:00
Mathieu Othacehe 7642748398
Add metrics testing.
* tests/metrics.scm: New file.
* Makefile.am (TESTS): Add it.
2020-09-15 17:40:05 +02:00
Mathieu Othacehe cf11b73db0
Add metrics support.
* Makefile.am: Add "upgrade-11.sql", "chart.js" and "metrics.js".
* bin/cuirass.in (main): Add 'metrics fiber.
* src/cuirass/http.scm (%file-white-list): Add "js/chart.js".
(url-handler): Add "/metrics" route.
* src/cuirass/metrics.scm: New file.
* src/cuirass/templates.scm (html-page): Add a "Global metrics" sub-menu to
"Status" dropdown menu.
(make-line-chart, global-metrics-content): New procedures.
* src/schema.sql (Metrics): New table.
* src/sql/upgrade-11.sql: New file.
* src/static/js/chart.js: New file.
2020-09-14 14:32:12 +02:00
Mathieu Othacehe 713a914e18
Add missing SQL upgrade files.
* Makefile.am (dist_sql_DATA): Add upgrade-9.sql and upgrade-10.sql.
2020-09-10 16:59:04 +02:00
Christopher Baines 76ec2967bc Add missing sql upgrade-8.sql file.
* Makefile.am (dist_sql_DATA): Add src/sql/upgrade-8.sql.
2020-06-13 16:59:44 +01:00
Mathieu Othacehe f44618fc79
Add support for build products downloading.
* src/sql/upgrade-7.sql: New file.
* Makefile.am: Add it.
* src/cuirass/base.scm (create-build-outputs): New procedure,
(build-packages): call it,
(process-spec): add the new spec argument and pass it to create-build-outputs.
* src/cuirass/database.scm (db-add-build-product, db-get-build-product-path,
db-get-build-products): New exported procedures.
* src/cuirass/http.scm (respond-static-file): Move file sending to ...
(respond-file): ... this new procedure,
(url-handler): add a new "download/<id>" route, serving the requested file
with the new respond-file procedure. Also gather build products and pass them
to "build-details" for "build/<id>/details" route.
* src/cuirass/templates.scm (build-details): Honor the new "products" argument
to display all the build products associated to the given build.
* src/schema.sql (BuildProducts): New table,
(Specifications)[build_outputs]: new field.
* tests/database.scm: Add empty build-outputs spec.
* tests/http.scm: Ditto.
* examples/guix-jobs.scm: Ditto.
* examples/hello-git.scm: Ditto.
* examples/hello-singleton.scm: Ditto.
* examples/hello-subset.scm: Ditto.
* examples/random.scm: Ditto.
* doc/cuirass.texi (overview): Document it.
2020-06-10 16:42:21 +02:00
Ricardo Wurmus 6aef31bd93
templates: Display search hints.
* src/static/css/cuirass.css: New file.
* Makefile.am (dist_css_DATA): Add it.
* src/cuirass/http.scm (%file-white-list): Add css/cuirass.css.
* src/cuirass/templates.scm (search-form): Add search-hints div.
(html-page): Load cuirass.css.
2020-04-15 19:54:09 +02:00
Christopher Baines fa412cdb59 Alter the Builds table to have an id field
The internal rowid's are used for builds as you can request builds by using
the rowid in the URL.

The motivation here is to enable running VACUUM operations in SQLite, without
risking the rowid's for Builds changing. It would be bad if they change, as
they're used in the URL's for builds.

* src/schema.sql (Builds): Add id column.
* src/curiass/dataabse.scm (db-add-build): Change PRIMARYKEY constraint to
UNIQUE constraint.
* src/sql/upgrade-6.sql: New file.
* Makefile.am (dist_sql_DATA): Add it.
2020-01-25 22:22:39 +00:00
Christopher Baines 12def48b3b Support publishing build events
Add a table to store events, which have a type and a JSON blob. These can be
used to record changes, this commit inserts events when new builds are
created, and when the status of builds change.

The EventsOutbox table is then used to track when events have been sent
out. This is done through the new cuirass-send-events script.

* Makefile.am (bin_SCRIPTS): Add bin/cuirass-send-events.
.gitignore: Add bin/cuirass-send-events.
(dist_pkgmodule_DATA): Add src/cuirass/send-events.scm.
(dist_sql_DATA): Add src/sql/upgrade-5.sql.
(EXTRA_DIST): bin/cuirass-send-events.in.
(bin/cuirass-send-events): New rule.
* bin/cuirass-send-events.in: New file.
* src/cuirass/send-events.scm: New file.
* src/sql/upgrade-5.sql: New file.
* src/cuirass/database.scm (changes-count): New procedure.
(db-update-build-status!): Call db-add-event after updating the build status.
(db-add-event): New procedure.
(db-add-build): Insert an event when a new build is inserted.
(db-delete-events-with-ids-<=-to): New procedure.
* src/schema.sql (Events): New table.
2020-01-16 08:32:52 +00:00
Clément Lassieur 4e661552c3
database: Add builds only if one of their outputs is new.
* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-4.sql'.
* src/cuirass/database.scm (db-add-output): New procedure.
(db-add-build): Call DB-ADD-OUTPUT, rollback the transaction and return #f if
DB-ADD-OUTPUT returned an empty list.
* src/schema.sql (Outputs): Set 'path' as primary key, instead of 'derivation,
name'.
* src/sql/upgrade-4.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-build): Use the #:OUTPUTS key.  Get default
OUTPUTS to depend on DRV.
("db-add-build-with-fixed-output"): New test.
2018-09-29 22:29:06 +02:00
Clément Lassieur 8d40c49170
database: Add a Checkouts table.
It is used to know when a new evaluation must be triggered and to display
input changes.

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-3.sql'.
* bin/cuirass.in (main): Call DB-SET-EVALUATION-DONE at startup to clear
'in-progress' evaluations.
* bin/evaluate.in (input-checkout, format-checkouts): Rename '#:name' to
'#:input'.
* doc/cuirass.texi (Stamps): Remove section.
(Checkouts): New section.
* src/cuirass/base.scm (fetch-input, fetch-inputs, compile-checkouts): Rename
'#:name' to '#:input'.
(evaluate): Remove the COMMITS argument.  Add an EVAL-ID argument.  Don't call
DB-ADD-EVALUATION because it was called sooner.  Remove the EVAL-ID argument
to AUGMENT-JOB because it's a closure.
(build-packages): Add an EVAL-ID argument.  Call DB-SET-EVALUATION-DONE once
all the derivations are registered.
(process-specs): Replace the stamping mechanism by the primary key constraint
of the Checkouts table: call "evaluate" only when DB-ADD-EVALUATION is true,
which means that at least one checkout was added.  Change the EVALUATE and
BUILD-PACKAGES arguments accordingly.
* src/cuirass/database.scm (db-add-stamp, db-get-stamp): Remove procedures.
(db-set-evaluations-done, db-set-evaluation-done): New exported procedure.
(db-add-checkout): New procedure that returns #f if a checkout with the same
revision already exists.
(db-add-evaluation): Replace the EVAL argument with a SPEC-NAME and a
CHECKOUTS arguments.  Insert the evaluation only if at least one checkout was
inserted.  Return #f otherwise.
(db-get-checkouts): New procedure.
(db-get-evaluations, db-get-evaluations-build-summary): Handle the
'in_progress' column, remove the 'commits' column.  Return the result of
DB-GET-CHECKOUTS as part of the evaluation.
* src/cuirass/templates.scm (input-changes, evaluation-badges): New
procedures.
(evaluation-info-table): Rename "Commits" to "Input changes".  Use
INPUT-CHANGES to display the input changes that triggered the evaluation.  Use
EVALUATION-BADGES to display a message indicating that the evaluation is in
progress.
* src/schema.sql (Stamps): Remove table.
(Checkouts): New table.
(Evaluations): Remove the 'commits' column.  Add an 'in_progress' column.
* src/sql/upgrade-3.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-eval): Remove procedure.
(make-dummy-checkouts): New procedure.
("sqlite-exec"): Remove the 'commits' column.  Add the 'in_progress' column.
("db-update-build-status!", "db-get-builds", "db-get-pending-derivations"):
Update the arguments of DB-ADD-EVALUATION accordingly.
* tests/http.scm (hash-table=?): Add support for lists of hash tables.
(evaluations-query-result): Replace '#:commits' with '#:checkouts'.  Return a
list instead of returning one element, for symmetry.
("fill-db"): Add a new input so that the second checkout can refer to it.
Replace EVALUATION1 and EVALUATION2 with CHECKOUTS1 and CHECKOUTS2.  Update
the arguments of DB-ADD-EVALUATION accordingly.
("/api/queue?nr=100"): Take the CAR of the EVALUATIONS-QUERY-RESULT list to
make it symmetrical with the other argument of HASH-TABLE=?.
2018-08-27 15:38:44 +02:00
Clément Lassieur 4db99f647b
database: Merge Derivations into Builds table.
Fixes <https://bugs.gnu.org/32190>.

* Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-2.sql'.
* doc/cuirass.texi (Derivations): Remove section.
(Builds): Update accordingly.  Add columns from the Derivations table.
(Outputs): Replace 'id' with 'derivation'.
* src/cuirass/base.scm (evaluate): Don't add jobs to the Derivations table.
(build-packages): Add columns that were in the Derivations table before.  Only
build the derivations that were successfully registered, that is, those that
didn't exist in the Builds table.  Give a derivation instead of a build id to
DB-GET-BUILD.  Compute the number of failed jobs based on the derivations that
were added to the table, instead of the jobs.
* src/cuirass/database.scm (db-add-derivation, db-get-derivation): Remove
exported procedures.
(db-add-build): Catch SQLITE_CONSTRAINT_PRIMARYKEY error, which means that two
jobs produced the same derivation, and return #f in that case.  Add columns
that were in the Derivations table before.  Use 'derivation' as primary key
for the Outputs table.
(db-get-outputs): Use 'derivation' as identifier, instead of 'build-id'.
(filters->order): Replace 'id' with 'rowid'.
(db-get-builds): Add a 'derivation' filter.  Replace 'id' with 'rowid'.
Remove the 'INNER JOIN Derivations'.  Replace Derivations with Builds.  Return
'derivation' in first position to make it clear that it's the primary key.
Pass DERIVATION instead of ID to DB-GET-OUTPUTS.
(db-get-build): Allow to take a derivation as argument.  Use NUMBER? to
differentiate between derivations and ids.
(db-get-pending-derivations): Remove the 'SELECT DISTINCT' clause now that
derivations are unique.  Remove the 'INNER JOIN Builds'.
(db-get-evaluations-build-summary, db-get-builds-min, db-get-builds-max):
Replace 'id' with 'rowid'.
* src/schema.sql (Derivations): Remove table.
(Outputs): Replace Builds.id with Builds.derivation.
(Builds): Use 'derivation' as primary key.  Remove the 'id' column.  Add
'job_name', 'system', 'nix_name' columns that were in the Derivations table
before.
(Builds_Derivations_index): Rename to Builds_index.  Update accordingly.
(Derivations_index): Remove index.
* src/sql/upgrade-2.sql: New file with SQL queries to upgrade the database.
* tests/database.scm (make-dummy-job, make-dummy-derivation): Remove
procedures.
(make-dummy-build): Add columns that were in MAKE-DUMMY-DERIVATION.  Get the
DRV parameter to be mandatory because it's a primary key.
(%id): Remove parameter.
("db-add-derivation", "db-get-derivation"): Remove tests.
("db-add-build"): Expect #f, because it adds twice the same derivation.  Pass
the derivation argument to MAKE-DUMMY-BUILD.
("db-update-build-status!"): Rename 'id' to 'derivation'.  Pass the derivation
argument to MAKE-DUMMY-BUILD.  Remove the DB-ADD-DERIVATION call.
("db-get-builds", "db-get-pending-derivations"): Pass the derivation argument
to MAKE-DUMMY-BUILD.  Remove the DB-ADD-DERIVATION calls.
* tests/http.scm ("fill-db"): Remove DERIVATION1 and DERIVATION2, and put
their content in BUILD1 and BUILD2.  Remove the DB-ADD-DERIVATION calls.
2018-08-16 19:19:23 +02:00
TSholokhova 675cd04a85
Add a web interface.
* Makefile.am (dist_sql_DATA): Add static files.
* src/cuirass/database.scm (assqx-ref): Export it.
(db-get-builds): Add 'evaluation' filter and filters for pagination.
(db-get-evaluations-build-summary, db-get-evaluations-id-min,
db-get-evaluations-id-max, db-get-builds-min, db-get-builds-max): New exported
procedures.
* src/cuirass/http.scm (%static-directory): New parameter.
(%page-size, %file-mime-types, %file-white-list): New variables.
(handle-build-request, handle-builds-request): Move the WITH-CRITICAL-SECTION
call out.
(url-handler): Add RESPOND-HTML, RESPOND-STATIC-FILE and RESPOND-NOT-FOUND
procedures.  Call WITH-CRITICAL-SECTION sooner for the '/build',
'/api/latestbuilds' and '/api/queue' routes.  Add '/', '/jobset/<name>',
'/eval/<id>', '/static/<path>' routes.  Use RESPOND-NOT-FOUND when the route
isn't found.
* src/cuirass/templates.scm: New file.
(html-page, specifications-table, evaluation-info-table,
build-eval-table): New exported procedures.
(pagination): New procedure.

Signed-off-by: Clément Lassieur <clement@lassieur.org>
2018-07-29 23:47:00 +02:00
Clément Lassieur 7b2f9e0de1
Add support for multiple inputs.
* Makefile.am (dist_sql_DATA): Add src/sql/upgrade-1.sql.
* bin/cuirass.in (show-help, %options, main): Remove the LOAD-PATH option that
was used afterwards as %GUIX-PACKAGE-PATH.
* bin/evaluate.in (absolutize, input-checkout, spec-source, spec-load-path,
spec-package-path, format-checkouts): New procedures.
(%not-colon): Remove variable.
(main): Take the load path, package path and PROC from the checkouts that
result from the inputs.  Format the checkouts before sending them to the
procedure.  Remove the LOAD-PATH argument.
* doc/cuirass.texi (Overview, Database schema): Document the changes.
* examples/{guix-jobs.scm, hello-git.scm, hello-singleton.scm,
hello-subset.scm, random.scm}: Adapt to the new specification format.
* examples/guix-track-git.scm (package->spec): Rename to PACKAGE->INPUT.
(package->git-tracked): Replace FETCH-REPOSITORY with FETCH-INPUT and handle
the new format of its return value.
* examples/random-jobs.scm (make-random-jobs): Rename RANDOM to CHECKOUT.
Rename the checkout from 'random (which is a specification) to 'cuirass (which
is a checkout resulting from an input).
* src/cuirass/base.scm (fetch-repository): Rename to fetch-input.  Rename SPEC
to INPUT.  Return a checkout object instead of returning two values.
(evaluate): Take a list of CHECKOUTS and COMMITS as arguments, instead of
SOURCE.  Remove TOKENIZE and LOAD-PATH.  Pass the CHECKOUTS instead of the
SOURCE to "evaluate".  Remove %GUIX-PACKAGE-PATH.  Build the EVAL object
instead of getting it from "evaluate".
(compile?, fetch-inputs, compile-checkouts): New procedures.
(process-specs): Fetch all inputs instead of only fetching one repository.
The result of that fetching operation is a list of CHECKOUTS whose COMMITS are
used as a STAMP.
(%guix-package-path, set-guix-package-path): Remove them.
* src/cuirass/database.scm (db-add-input, db-get-inputs): New procedures.
(db-add-specification, db-get-specifications): Adapt to the new specification
format.  Add/get all inputs as well.
(db-add-evaluation): Rename REVISION to COMMITS.  Store COMMITS as space
separated commit hashes.
(db-get-builds): Rename REPO_NAME to NAME.
(db-get-stamp): Rename COMMIT to STAMP.  Return #f when there is no STAMP.
(db-add-stamp): Rename COMMIT to STAMP.  Deal with DB-GET-STAMP's new return
value.
(db-get-evaluations): Rename REVISION to COMMITS.  Tokenize COMMITS.
* src/cuirass/utils.scm (%non-blocking): Export it.
* src/schema.sql (Inputs): New table that refers to the Specifications table.
(Specifications): Move input related fields to the Inputs table.  Rename
REPO_NAME to NAME.  Rename ARGUMENTS to PROC_ARGS.  Rename FILE to PROC_FILE.
Add LOAD_PATH_INPUTS, PACKAGE_PATH_INPUTS and PROC_INPUT fields that refer to
the Inputs table.
(Stamps): Rename REPO_NAME to NAME.
(Evaluations): Rename REPO_NAME to NAME.  Rename REVISION to COMMITS.
(Specifications_index): Replace with Inputs_index.
* src/sql/upgrade-1.sql: New file.
* tests/database.scm (example-spec, make-dummy-eval, sqlite-exec): Adapt to
the new specifications format.  Rename REVISION to COMMITS.
* tests/http.scm (evaluations-query-result, fill-db): Idem.
2018-07-16 21:33:14 +02:00
Ludovic Courtès 4ab2f2c3f0 build: Clean cuirass.go.
* Makefile.am (CLEANFILES): Add $(nodist_guilesite_DATA).
2018-02-15 10:27:12 +01:00
Ludovic Courtès a7693f4974 build: Install (web server fiberized) in its right place.
Previously it would be installed under cuirass/.

* Makefile.am (webmoduledir, webobjectdir): New variables.
(dist_pkgmodule_DATA): Remove src/web/server/fiberized.scm.
(dist_webmodule_DATA, nodist_webobject_DATA): New variables.
(CLEANFILES): Add $(nodist_webobject_DATA).
2018-02-15 10:25:19 +01:00
Ludovic Courtès eb9521d1b4 examples: Add 'random-jobs'.
* examples/random-jobs.scm, examples/random.scm: New files.
* Makefile.am (nobase_dist_pkgdata_DATA): Add them.
2018-01-29 22:42:12 +01:00
Ludovic Courtès 77769c29e7 http: Use our own 'fiberized' web server backend.
* src/web/server/fiberized.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/http.scm (run-cuirass-server): Use it.
2018-01-25 11:54:40 +01:00
Ludovic Courtès 70f21349bd Add (cuirass logging) module.
* src/cuirass/logging.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/base.scm (handle-build-event): Use 'log-message' instead
of 'log'.
2018-01-22 13:29:55 +01:00
Ludovic Courtès 6c163e4916 build: Update 'test-driver.scm' from Guix.
* build-aux/test-driver.scm: Update from current Guix.
* Makefile.am (SCM_LOG_DRIVER): Add -L and -e flags.
2018-01-07 23:59:30 +01:00
Mathieu Othacehe 4666142ca5
repo: Remove dead code.
* Makefile.am (dist_pkgmodule_DATA): Remove repo.scm,
(TESTS): Remove repo.scm.
* build-aux/guix.scm (package)[disable-repo-tests]: Remove phase.
* src/cuirass/repo.scm: Remove.
* tests/repo.scm: Remove.
2017-07-06 09:20:52 +02:00
Ludovic Courtès 870e8d6ad3 build: Fix load-path/compile-path confusion.
This is a followup to b4400bc989.

* Makefile.am (nodist_pkgmodule_DATA): New variable.
(nodist_pkgobject_DATA): Remove config.scm.
(do_subst): Use $(guileobjectdir).
2017-05-10 16:58:50 +02:00
Ludovic Courtès b4400bc989 build: Install .go files to $(libdir)/guile.
* Makefile.am (guileobjectdir): New variable.
(nodist_guilesite_DATA): Rename to...
(nodist_guileobject_DATA): ... this.
(pkgobjectdir): New variable.
(nodist_pkgmodule_DATA): Rename to...
(nodist_pkgobject_DATA): ... this.
2017-05-10 16:42:05 +02:00
Ludovic Courtès ece0773ca8 build: Prefer building with Guile 2.2.
* Makefile.am (guilesitedir): Append @GUILE_EFFECTIVE_VERSION@.
* configure.ac: Use 'GUILE_PKG', and pass "2.2" first.
2017-05-10 16:32:26 +02:00
Mathieu Lirzin 3adf32e742
build: Don't generate ".version" since it has no use.
* Makefile.am (.version): Remove target.
(EXTRA_DIST): Adapt.
(BUILT_SOURCES): Likewise.
* build-aux/guix.scm (git-version-gen): Call 'git-version-gen' with
'.tarball-version'.
* .gitignore: Update.
2017-01-23 02:41:53 +01:00
Mathieu Lirzin 8988070725
maint: Fix mistake in copying permission statement.
This was mistakenly added in commit 05e5495e8f.

* Makefile.am: Declare GPLv3+ instead of GPLv2+.
* configure.ac: Likewise.
2017-01-09 00:41:13 +01:00
Mathieu Lirzin b29820b8bb
build: Reformat assignments.
* Makefile.am (guilesitedir, pkgmoduledir, BUILT_SOURCES): Add whitespaces
around '='.
2017-01-08 18:06:02 +01:00
Mathieu Lirzin 4ac708b0f6
build: Do not require "build-aux/guix.scm".
When building Cuirass with 'guix build -f build-aux/guix.scm' we don't want to
add "build-aux/guix.scm" in the repository snapshot since it is considered as
metadata.  As a consequence we can't make 'autoconf' require it.

* configure.ac (AC_REQUIRE_AUX_FILE): Remove "build-aux/guix.scm".
* Makefile.am (EXTRA_DIST): Only distribute it.
2016-12-29 12:00:18 +01:00
Mathieu Lirzin b32791d4bd
build: Fix typo "the" => "they".
* Makefile.am <Generated files>: Fix typo "the" => "they".
2016-12-28 19:12:29 +01:00
Mathieu Lirzin c26ffda7d6
build: Use portable substitution references.
* Makefile.am (nodist_guilesite_DATA, nodist_pkgmodule_DATA, CLEANFILES): Use
portable substitution references.
2016-12-28 19:12:29 +01:00
Mathieu Lirzin 17dbfe679d
maint: Generate version number.
* build-aux/git-version-gen: New script.
* configure.ac (AC_INIT): Use it.
(AC_REQUIRE_AUX_FILE): Distribute it.
* Makefile.am (.version): New target.
(BUILT_SOURCES, EXTRA_DIST): Add it.
(dist-hook): Generate ".tarball-version".
* .gitignore: Update.
2016-12-28 18:51:39 +01:00
Mathieu Lirzin 57e10c6056
build: Set Guile load paths in 'pre-inst-env'.
This reverts most of 4f0d665746.  The load paths
are still hard coded after installation, however 'pre-inst-env' wrapper is
used for defining them in the local build environment.  This is more
convenient for running the tests manually or launching a Guile REPL with all
the Cuirass modules accessible.

* build-aux/pre-inst-env.in (GUILE_LOAD_PATH, GUILE_LOAD_COMPILED_PATH): New
variables.
* bin/cuirass.in: Comment Guile load paths.
* Makefile.am (local_load_path, local_load_compiled_path): Delete.
(AM_TESTS_ENVIRONMENT): Don't set Guile load paths.
(do_subst): Use install directories for Guile load paths.
(install-exec-hook): Uncomment 'cuirass' hard coded load paths.
2016-12-28 18:19:03 +01:00
Mathieu Lirzin 16aec469d4
repo: Add <repo> record datatype.
* src/cuirass/utils.scm (call-with-temporary-directory): New procedure.
* src/cuirass/repo.scm: Use it.  New file.
* tests/repo.scm: New tests.
* Makefile.am (dist_pkgmodule_DATA, TESTS): Add them.
2016-12-28 18:18:37 +01:00