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

21 commits

Author SHA1 Message Date
Ludovic Courtès
dd75b5bec9 http: /jobsets returns a list of jobsets.
Reported by Danny Milosavljevic.

* src/cuirass/http.scm (url-handler) <"jobsets"> Return the result of
'db-get-specifications' as-is, not just the car.
2018-02-05 23:01:26 +01:00
Ludovic Courtès
0bf61ef1ff http: Evaluate DB requests in 'non-blocking'.
* src/cuirass/http.scm (handle-builds-request): Wrap 'db-get-builds'
into 'non-blocking'.
2018-01-29 18:06:47 +01:00
Ludovic Courtès
fcd1bc13bc http: /api/queue returns builds sorted by status.
* src/cuirass/database.scm (db-get-builds)[format-order-clause]: Add
'status+submission-time'.
* src/cuirass/http.scm (url-handler) <"queue">: Use it.
2018-01-29 18:06:47 +01:00
Ludovic Courtès
4558d1c869 http: Reject methods other than GET.
* src/cuirass/http.scm (url-handler): Check whether REQUEST's method is
'GET, and return 405 if not.
2018-01-26 22:41:22 +01:00
Ludovic Courtès
8b26874cac http: Provide the correct values for 'finished' and 'busy'.
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.
2018-01-26 18:28:32 +01:00
Ludovic Courtès
5d559f8021 logging: Add 'with-time-logging' and use it.
* src/cuirass/logging.scm (call-with-time-logging): New procedure.
(with-time-logging): New macro.
* src/cuirass/http.scm (handle-builds-request): Use it.
2018-01-26 14:17:18 +01:00
Ludovic Courtès
1af31c3200 http: Log incoming connections and requests.
* src/web/server/fiberized.scm (socket-loop): Add 'log-message' call.
* src/cuirass/http.scm (url-handler): Likewise.
2018-01-26 11:23:07 +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
a97665672a http: Sort /api/latestbuilds and /api/queue by time.
* 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.
2018-01-25 10:39:18 +01:00
Ludovic Courtès
c89c117c12 http: /build: Include the derivation.
* src/cuirass/http.scm (build->hydra-build): Add #:derivation.
2018-01-24 14:01:45 +01:00
Ludovic Courtès
74f3abfba3 http: /build: Gracefully handle empty output list.
* src/cuirass/http.scm (url-handler): Add case for empty #:outputs.
2018-01-24 13:59:28 +01:00
Ludovic Courtès
496b624dda http: Implement /api/queue.
* 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.
2018-01-23 23:40:07 +01:00
Ludovic Courtès
06b8af00fb http: /api/latestbuilds only returns finished builds.
* 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'.
2018-01-23 23:39:13 +01:00
Ludovic Courtès
ee11ba1d93 Introduce concurrency with Fibers.
* 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'.
2018-01-22 23:39:51 +01:00
Ludovic Courtès
9588e4d4a7 http: /build/N/log/raw redirects to /log.
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.
2018-01-07 23:59:30 +01:00
Jan Nieuwenhuizen
2a4d493e28
cuirass: Add --listen command line option.
* 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.
2017-09-18 21:57:05 +02:00
Mathieu Othacehe
8a7483a3bb
cuirass: add Hydra compatible HTTP API.
* 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.
2017-09-08 21:15:32 +02:00
Mathieu Lirzin
8a782b3e84
cuirass: Add "--port" command line option.
* 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.
2016-12-28 18:49:21 +01:00
Mathieu Lirzin
b59b8e5567
http: Add 'port' keyword argument to 'run-cuirass-server'.
* src/cuirass/http.scm (run-cuirass-server): Add 'port' keyword argument.
2016-12-28 18:19:03 +01:00
Mathieu Lirzin
5973db52c6
http: Add DB argument to 'url-handler'.
* src/cuirass/http.scm (not-found): Delete.
(url-handler): Add DB argument.
(run-cuirass-server): Likewise.  Pass it to 'run-server' STATE argument.
2016-11-03 00:20:27 +01:00
Mathieu Lirzin
651b8bbcf9
Add (cuirass http) module.
* src/cuirass/http.scm: New file.
* tests/http.scm: Likewise.
* Makefile.am (dist_pkgmodule_DATA, TESTS): Add them.
* configure.ac: Check for (json) module.
2016-07-31 01:07:00 +02:00