| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Split result for "eval" page in tabs.
* src/cuirass/templates.scm (build-eval-table): Remove border from table head;
Remove lead paragraph.
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Use "jobset" instead of "spec".
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Add handler for /build/<id>/details.
* src/cuirass/templates.scm (build-details): New procedure.
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Skip computation of builds-id-min and
builds-id-max when query is missing.
|
|
|
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds-by-search, db-get-builds-query-min,
db-get-builds-query-max): New procedures.
* src/cuirass/http.scm (handle-builds-search-request): New procedure.
(url-handler): Handle "search" route.
* src/cuirass/templates.scm (search-form): New variable.
(html-page): Use it.
(build-search-results-table): New procedure.
|
|
|
|
| |
* src/cuirass/http.scm (run-cuirass-server): Remove useless lambda expression.
|
|
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Pass the ID argument to
BUILD-EVAL-TABLE.
* src/cuirass/templates.scm (build-eval-table): Add an EVAL-ID argument, add
title.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-evaluation-specification): New exported
procedure.
* src/cuirass/http.scm (respond-html): Allow to pass CODE as argument.
(respond-html-eval-not-found): New procedure.
(url-handler): Fill navigation arguments. Handle the case where the
evaluation doesn't exist.
* src/cuirass/templates.scm (navigation-items): New procedure.
(html-page): Add navigation bar.
Co-authored-by: Clément Lassieur <clement@lassieur.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds): Add 'succeeded' and 'failed'
status filters.
(db-get-builds-min, db-get-builds-max): Add support for a new 'status'
argument.
* src/cuirass/http.scm (url-handler): Add a status argument for the '/eval/id'
endpoint.
* src/cuirass/templates.scm (evaluation-badges): Add links to the buttons.
(build-eval-table): Add a 'status' argument.
Co-authored-by: Clément Lassieur <clement@lassieur.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes <https://bugs.gnu.org/32234>.
* bin/cuirass.in (main): Keep only one WITH-DATABASE call around all fibers.
Remove all DB arguments.
* src/cuirass/base.scm (evaluate, update-build-statuses!, spawn-builds,
handle-build-event, build-packages): Remove all DB arguments.
(clear-build-queue, cancel-old-builds): Wrap in WITH-DB-CRITICAL-SECTION,
remove all DB arguments.
(restart-builds): Remove the NON-BLOCKING call, remove all DB arguments.
(process-specs): Remove all DB arguments, remove the WITH-DATABASE call.
* src/cuirass/database.scm (%db-channel): New parameter.
(with-db-critical-section): New macro.
(db-add-input, db-add-specification, db-get-inputs, db-get-specifications,
db-add-evaluation, db-add-build, db-update-build-status!, db-get-outputs,
db-get-builds, db-get-build, db-get-pending-derivations, db-get-stamp,
db-add-stamp, db-get-evaluations, db-get-evaluations-build-summary,
db-get-evaluations-id-min, db-get-evaluations-id-max, db-get-builds-min,
db-get-builds-max): Wrap in WITH-DB-CRITICAL-SECTION, remove all DB arguments.
(with-database): Wrap BODY in PARAMETERIZE form that sets %DB-CHANNEL to the
channel returned by MAKE-CRITICAL-SECTION.
* src/cuirass/http.scm (handle-build-request, handle-builds-request): Remove
all DB arguments.
(url-handler): Remove all DB arguments, remove the DB-CHANNEL state, remove
the WITH-CRITICAL-SECTION calls.
(run-cuirass-server): Remove the DB arguments, remove the
MAKE-CRITICAL-SECTION call.
* src/cuirass/utils.scm (make-critical-section): Replace SPAWN-FIBER with
CALL-WITH-NEW-THREAD. Wrap body in PARAMETERIZE form that clears
CURRENT-FIBER.
* tests/database.scm (with-temporary-database, "db-add-specification",
"db-add-build", "db-update-build-status!", "db-get-builds",
"db-get-pending-derivations"): Remove the DB arguments.
("db-init"): Set the %DB-CHANNEL parameter to the channel returned by
MAKE-CRITICAL-SECTION, and return #t.
("database"): Set %DB-CHANNEL to #f during cleanup.
* tests/http.scm ("db-init"): Set the %DB-CHANNEL parameter to the channel
returned by MAKE-CRITICAL-SECTION, and return #t.
("cuirass-run", "fill-db"): Remove the DB arguments.
("http"): Set %DB-CHANNEL to #f during cleanup.
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds): Rename 'repo-name' to
'specification'.
* src/cuirass/http.scm (build->hydra-build): Idem.
|
|
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (assqx-ref): Remove exported procedure.
(db-get-builds, db-get-build): Adapt to new format.
* src/cuirass/http.scm (request-parameters): Use (cons key param) instead
of (list key param).
(url-handler): Adapt to new format.
* tests/database.scm ("db-get-builds"): Idem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the possibility to filter specifications by branch, because
branches were previously called 'jobset'. But it doesn't matter because later
on, specifications will have as many branches as inputs. And people should
filter by specification name instead.
* doc/cuirass.texi (Build Information, Latest builds): Remove 'jobset',
replace 'project' with 'jobset'.
* src/cuirass/http.scm (build->hydra-build): Idem.
* tests/database.scm (db-get-builds): Idem.
* tests/http.scm (build-query-result, /api/latestbuilds?nr=1&jobset=guix,
/api/latestbuilds?nr=1&jobset=gnu): Idem.
* src/cuirass/database.scm (db-format-build, db-get-builds): Don't associate
builds with branches (which were called 'jobset' afterwards).
(db-get-builds): Remove the #:project filter.
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-evaluations): New exported procedure.
* src/cuirass/http.scm (url-handler): Add /api/evaluations route.
* tests/http.scm ("http"): Add /api/evaluations test route.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/cuirass/utils.scm (make-critical-section)
(call-with-critical-section): New procedures.
(with-critical-section): New macro.
* src/cuirass/http.scm (with-database-access): Remove.
(handle-build-request, handle-builds-request, url-handler): Use
'with-critical-section' instead of 'with-database-access'.
(run-cuirass-server): Remove 'spawn-fiber' call. Use
'make-critical-section' instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reinstates c47dfdf82b4be62501a7932eaec4c124566a1829 and fixes the
issues that led to the revert in
b71f0cdca5aeb82e5eb24f54b32e3f09fee22bad.
Before that, 'run-server' would force sequential processing of client
requests one after another.
* src/cuirass/http.scm (run-cuirass-server): Rewrite to use its own loop
instead of 'run-server'. Spawn a database fiber.
(with-database-access): New macro.
(handle-build-request): Expect 'db-channel' and use 'with-database-access'.
(handle-builds-request): Likewise.
(url-handler): Likewise.
|
|
|
|
|
|
|
|
|
| |
Fixes a regression introduced in
f083282fd3bf813fda0b54ed33278d2d5325dfa1, whereby we'd return 0 as the
timestamp for everything in /api/queue.
* src/cuirass/http.scm (build->hydra-build): Make 'finished?' a
Boolean. Move 'bool->int' call in #:finished definition.
|
|
|
|
|
| |
* src/cuirass/http.scm (build->hydra-build): Set #:timestamp to
#:stoptime when BUILD is finished.
|
|
|
|
|
| |
* src/cuirass/http.scm (request-parameters): Return the empty list when
QUERY is #f.
|
|
|
|
|
|
|
|
|
|
| |
Fixes a regression introduced in
593cb7be108ed97bca5371aad2e53fa8ce4817ba.
* src/cuirass/http.scm (request-parameters): Fix fallback case in
'match' form. Previously it would return a procedure in this case, as
returned by (const param), leading to a failure down the road in
'sqlite-bind-arguments' as could be seen by running tests/http.scm.
|
|
|
|
|
| |
* src/cuirass/http.scm (request-parameters): Interpret id and nr parameters as
numbers.
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Convert build-id URL part to number.
|
|
|
|
|
|
|
|
| |
This reverts commit c47dfdf82b4be62501a7932eaec4c124566a1829.
Processing connections concurrently would require having separate
database handles. See
<https://lists.gnu.org/archive/html/guix-devel/2018-02/msg00206.html>.
|
|
|
|
|
|
|
|
| |
Before that, 'run-server' would force sequential processing of client
requests one after another.
* src/cuirass/http.scm (run-cuirass-server): Rewrite to use its own loop
instead of 'run-server'.
|
|
|
|
|
|
|
| |
Reported by Danny Milosavljevic.
* src/cuirass/http.scm (url-handler) <"jobsets"> Return the result of
'db-get-specifications' as-is, not just the car.
|
|
|
|
|
| |
* src/cuirass/http.scm (handle-builds-request): Wrap 'db-get-builds'
into 'non-blocking'.
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds)[format-order-clause]: Add
'status+submission-time'.
* src/cuirass/http.scm (url-handler) <"queue">: Use it.
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Check whether REQUEST's method is
'GET, and return 405 if not.
|
|
|
|
|
|
|
|
| |
This should placate 'guix-hydra-queued-builds', for instance, which
checks these values to choose between "Running" and "Scheduled".
* src/cuirass/http.scm (build->hydra-build): Provide the correct value
for #:finished and #:busy.
|
|
|
|
|
|
| |
* src/cuirass/logging.scm (call-with-time-logging): New procedure.
(with-time-logging): New macro.
* src/cuirass/http.scm (handle-builds-request): Use it.
|
|
|
|
|
| |
* src/web/server/fiberized.scm (socket-loop): Add 'log-message' call.
* src/cuirass/http.scm (url-handler): Likewise.
|
|
|
|
|
|
| |
* src/web/server/fiberized.scm: New file.
* Makefile.am (dist_pkgmodule_DATA): Add it.
* src/cuirass/http.scm (run-cuirass-server): Use it.
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds)[format-order-clause]: Add
'order' clauses.
* src/cuirass/http.scm (url-handler): Default to (order finish-time) for
/latestbuilds and (order submission-time) for /queue.
|
|
|
|
| |
* src/cuirass/http.scm (build->hydra-build): Add #:derivation.
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Add case for empty #:outputs.
|
|
|
|
|
|
|
|
| |
* src/cuirass/http.scm (url-handler): Add /api/queue handler.
* tests/http.scm ("http"): Add a BUILD2 and DERIVATION2, and rename
BUILD and DERIVATION accordingly.
("/build/2", "/build/2/log/raw"): Rename to /42.
("/api/queue?nr=100"): New test.
|
|
|
|
|
|
|
| |
* src/cuirass/database.scm (db-get-builds)[format-where-clause]:
Honor (status done) filter.
* src/cuirass/http.scm (url-handler): Always add (status done)
to the filters passed to 'handle-builds-request'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* README: Mark Fibers as required.
* configure.ac: Check for Guile 2.2 only. Check for (fibers).
* bin/cuirass.in (main): Use (fibers). Run 'process-specs' and web
server in separate fibers.
* src/cuirass/base.scm (with-store): New macro.
(non-blocking-port): New procedure.
(evaluate): Use 'non-blocking-port'. Use 'read-string' followed by 'read'.
(process-specs): Move 'db-add-stamp' right after 'string=?' comparison.
Run evaluation and subsequent builds in a separate fiber.
* src/cuirass/http.scm (run-cuirass-server): Pass 'fibers as the second
argument to 'run-server'. Use 'log-message' instead of 'format'.
* src/cuirass/database.scm (with-database): Remove 'dynamic-wind'.
|
|
|
|
|
|
|
|
|
|
|
| |
This moves log handling responsibility to 'guix publish'.
* src/cuirass/http.scm (handle-log-request): Remove.
(url-handler): Change /log/raw URI handler to return 302 to /log/OUTPUT.
* tests/http.scm (log-file-name): Remove, and remove code to create and
delete it.
("fill-db"): Change #:log value.
("/build/1/log/raw"): Expect 302.
|
|
|
|
|
|
|
|
| |
* bin/cuirass.in (show-help): Add help for --listen option.
(%options): Add listen option.
(main): Pass host to run-cuirass-server.
* doc/cuirass.texi (Invocation): Add --listen option.
* src/cuirass/http.scm (run-cuirass-server): Add named #:host parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* doc/cuirass.texi (Sections)[Web API]: New section describing the HTTP API.
* src/cuirass/http.scm (spec->json-string): Move it to utils.scm and rename it
object->json-string.
(object->json-scm): Move it utils.scm.
(handle-*-request): New helpers procedures.
(request-parameters): New procedure to parse a request query.
(url-handler): Add new API's.
* src/cuirass/utils.scm (object->json-scm, object->json-string): Exported
procedures moved from http.scm.
* tests/http.scm: Add various tests on new HTTP API.
|
|
|
|
|
|
|
|
| |
* bin/cuirass.in (%options): Add "--port" and "-p" command line options.
(show-help): Adapt.
(main): Set default to 8080. Call 'run-cuirass-server' with this.
* src/cuirass/http.scm (run-cuirass-server): Display the port number.
* doc/cuirass.texi (Invocation): Document new option.
|
|
|
|
| |
* src/cuirass/http.scm (run-cuirass-server): Add 'port' keyword argument.
|
|
|
|
|
|
| |
* src/cuirass/http.scm (not-found): Delete.
(url-handler): Add DB argument.
(run-cuirass-server): Likewise. Pass it to 'run-server' STATE argument.
|
|
* src/cuirass/http.scm: New file.
* tests/http.scm: Likewise.
* Makefile.am (dist_pkgmodule_DATA, TESTS): Add them.
* configure.ac: Check for (json) module.
|