summaryrefslogtreecommitdiff
path: root/bin/evaluate.in
Commit message (Collapse)AuthorAge
* database: Add a Checkouts table.Clément Lassieur2018-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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=?.
* Add support for multiple inputs.Clément Lassieur2018-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* evaluate: Use a generic key to identify Cuirass arguments.Clément Lassieur2018-06-18
| | | | | | | | | | | | | | | | | So that Cuirass specifications used to build 'guix-modular' can be named differently than "guix" and "guix-modular" (see Guix's build-aux/hydra/guix-modular.scm). The name is used as a primary key, so before that commit, it was also impossible to have several such specifications. This is a workaround, Cuirass should normally support several inputs per specification, as Hydra does. The specification's name would then only be used to identify it. See <https://bugs.gnu.org/31813>. * bin/evaluate.in (main): Replace custom NAME (passed to PROC) with 'guix'. Co-authored-by: Mathieu Othacehe <m.othacehe@gmail.com>
* evaluate: Change '%load-path' once and for all.Ludovic Courtès2018-04-09
| | | | * bin/evaluate.in (main): Do not restore the original '%load-path'.
* evaluate: Leave GUILE_LOAD_PATH unchanged.Ludovic Courtès2018-04-09
| | | | | | | | | | | | Previously we'd systematically add the first argument to the search path. When that first argument was the empty string (as with the 'guix-modular' jobset), we'd thus add the current directory to the search path, even if the intent was to leave the load path unchanged. Furthermore, a3a7c09b06027bd30a96ae4607fa40bd790af840 changed load-path handling to be explicit in Scheme. * bin/evaluate.in: Remove GUILE_LOAD_PATH assignment.
* evaluate: Change directory to SOURCE.Ludovic Courtès2018-04-09
| | | | | * bin/evaluate.in (with-directory-excursion): Remove. (main): chdir to SOURCE.
* evaluate: Do not load Guix/Cuirass modules upfront.Ludovic Courtès2018-04-09
| | | | | | | | | | | | | | This avoids a situation whereby, when evaluating from a Guix checkout, we'd have already loaded slightly different and incompatible (guix …) modules. Hydra's 'hydra-eval-guile-jobs' implemented the same solution as in this patch already. * bin/evaluate.in: Remove use of (cuirass …) and (guix …) modules. (ref): New procedure. (with-directory-excursion): New macro. (main): Use 'ref'. Remove uses of Guix or Cuirass modules.
* evaluate: Honor the given load path.Ludovic Courtès2018-04-07
| | | | | * bin/evaluate.in (main): Prepend LOAD-PATH to '%load-path' for the dynamic extend of the 'primitive-load' call.
* evaluate: Really support 'build-derivations' RPCs.Ludovic Courtès2018-04-07
| | | | | | | Fixes a thinko introduced in 1872dd95253b4805a00bfe5dee8d1a0ed90af149. * bin/evaluate.in (main): Make sure 'real-build-things' is bound.
* evaluate: Really pass arguments like Hydra.Ludovic Courtès2018-04-06
| | | | | * bin/evaluate.in (main): Use SPEC's #:name as a key in ARGS. * examples/random-jobs.scm (make-random-jobs): Adjust accordingly.
* evaluate: Pass the file name and revision to the user procedure.Ludovic Courtès2018-04-05
| | | | | | | * bin/evaluate.in (main): Always pass an alist as the arguments to PROC, containing at least 'file-name' and 'revision'. * examples/random-jobs.scm (make-random-jobs): Display 'file-name' and 'revision' from ARGUMENTS.
* base: Make a writable copy of the checkout only when #:no-compile? is false.Ludovic Courtès2018-04-01
| | | | | | | | | | | | | | | This avoids copying things back and forth. * src/cuirass/base.scm (fetch-repository): Add #:writable-copy? parameter. Call 'make-writable-copy' when it's true. (copy-repository-cache): Remove. (make-writable-copy): New procedure. (evaluate): Add 'source' parameter and pass it to the 'evaluate' program. (process-specs): Define 'compile?'. Pass #:writable-copy? to 'fetch-repository'. Remove call to 'copy-repository-cache'. Remove computation of the checkout directory name. Pass CHECKOUT to 'evaluate'. * bin/evaluate.in (main): Replace 'cachedir' with 'source'. Remove computation of the checkout directory name.
* evaluate: Tolerate calls to 'build-things' during evaluations.Ludovic Courtès2018-03-28
| | | | * bin/evaluate.in (main): 'build-things' replacement no longer calls 'exit'.
* base: Move database update from 'evaluate' process to the main process.Ludovic Courtès2018-03-01
| | | | | | | | | | | | Fixes <https://bugs.gnu.org/30618>. Reported by Andreas Enge <andreas@enge.fr>. * bin/evaluate.in (fill-job): Remove. (main): Remove 'database' command-line argument. Remove DB and its uses. Write an (evaluation EVAL JOBS) sexp. * src/cuirass/base.scm (evaluate)[augment-job]: New procedure. Use it. Adjust to read (evaluation EVAL JOBS) sexp. Call 'db-add-evaluation' and 'db-add-derivation'.
* cuirass: Store new information in database to prepare new HTTP APIMathieu Othacehe2017-09-08
| | | | | | | | | | | | | | | | | | | | | integration. * bin/evaluate.in (fill-job): New procedure. (main): Use it to fill informations (nix-name, system) that will later be added to database. * doc/cuirass.texi (Database)[Derivation]: Add system and nix_name fields. (Database)[Builds]: Add id, status, timestamp, starttime and stoptime fields. Remove output field. (Database)[Outputs]: New table describing the build outputs. * src/cuirass/base.scm (build-packages): Add new fields to build object before adding it to database. * src/cuirass/database.scm (db-get-build, db-get-builds): New procedures to get a build by id from database and a list of builds using filter parameters respectively. * src/schema.sql (Outputs) : New table. (Derivations): Add system and nix_name columns. (Builds): Remove output column and add id, status, timestamp, starttime and stoptime columns.
* cuirass: Stop λ/lambda mixing.Mathieu Othacehe2017-07-06
| | | | | | | | | | | | | * bin/cuirass.in: Replace λ by lambda. * bin/evaluate.in: Ditto. * build-aux/guix.scm: Ditto. * examples/gnu-system.scm: Ditto. * examples/guix-track-git.scm: Ditto. * src/cuirass.scm: Ditto. * src/cuirass/base.scm: Ditto. * src/cuirass/database.scm: Ditto. * src/cuirass/ui.scm: Ditto. * src/cuirass/utils.scm: Remove λ* macro.
* utils: Remove useless procedures.Mathieu Othacehe2017-07-01
| | | | | | | | | | | * src/cuirass/utils.scm (mkdir-p, make-user-module, call-with-temporary-directory, with-directory-excursion): Remove because already defined in guix. * tests/utils (with-directory-excursion): Remove associated test. * src/cuirass/base.scm: Use (guix build utils) to provide procedure removed from (cuirass utils). * bin/evaluate.in: Ditto. * bin/cuirass.in: Use "make-user-module" provided by (guix ui).
* evaluate: Use specification #:name in evaluation alists.Mathieu Lirzin2017-02-24
| | | | | | | | This fixes an issue in the database, where rows from the 'Evaluations' table were having an "#f" value instead of a valid reference to their corresponding specification. * bin/evaluate.in (main): Use specification #:name instead of obsolete #:id.
* cuirass: Add "--load-path" option.Mathieu Othacehe2017-01-29
| | | | | | | | | | | | * bin/cuirass.in (%options): Add "--load-path" and "-L" command line options. (show-help): Adapt. * src/cuirass/base.scm (%guix-package-path): New parameter. (set-guix-package-path!): New procedure. (evaluate): Call "evaluate" script with '%guix-package-path'. * bin/evaluate.in (main): Match 'guix-package-path' command line argument and handle it. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>
* cuirass: Hard code Guile load paths.Mathieu Lirzin2016-11-12
| | | | | | | | | | | | | * configure.ac (bin/cuirass, bin/evaluate): Let 'make' generate them. * bin/cuirass.in: Hard code load paths to find Cuirass modules. * Makefile.am (do_subst): Update substitution. (bin/cuirass, bin/evaluate): New rules. (EXTRA_DIST): Distribute 'bin/cuirass.in' and 'bin/evaluate.in'. (MOSTLYCLEANFILES): Add '$(bin_SCRIPTS)'. (install-exec-hook): New target. (local_load_path, local_load_compiled_path): New variables. (AM_TESTS_ENVIRONMENT): Set Guile load paths. * build-aux/pre-inst-env.in: Don't modify Guile load paths.
* tests: Track Cuirass' git.Jan Nieuwenhuizen2016-09-23
| | | | | | | | | | | * guix.scm: New file; specify Guix package. * guix/ci.scm: New file; expose to Guix. * build-aux/pre-inst-env.in: Add it to GUIX_PACKAGE_PATH. * bin/evaluate.in (main): Lookup proc using name specified by #:proc. * tests/guix-track-git.scm: New file. * tests/hello-git.scm: Test it. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>
* cuirass: Optionally support using of substitutes.Jan Nieuwenhuizen2016-09-23
| | | | | | | | * bin/cuirass.in (options): Add --use-substitutes. (show-help): Idem. (main): Set %use-substitutes?. Signed-off-by: Mathieu Lirzin <mthl@gnu.org>
* Add (cuirass) module.Mathieu Lirzin2016-08-02
| | | | | | | | | | * src/cuirass.scm: New file. * Makefile.am (guilesitedir, dist_guilesite_DATA) (nodist_guilesite_DATA): New variables. (pkgmoduledir): Refer to 'guilesitedir'. (CLEANFILES): Add 'nodist_guilesite_DATA'. * bin/cuirass.in: Use (cuirass) module. * bin/evaluate.in: Likewise.
* schema: Evaluations: Add 'revision' column.Mathieu Lirzin2016-07-30
| | | | | | * src/schema.sql (Evaluations): Add 'revision' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. All callers changed.
* schema: Separate "Derivations" from "Evaluations".Mathieu Lirzin2016-07-27
| | | | | | | | | | | | | * src/schema.sql (Derivations): New table. (Evaluations): Remove 'derivation' and 'job_name' columns. Add 'id' column. * src/cuirass/database.scm (db-add-evaluation): Adapt. (db-get-derivation, db-add-derivation): New procedures. (evaluation-exists?, db-get-evaluation): Delete. * bin/evaluate.in (main): Adapt. * tests/database.scm ("sqlite-exec"): Likewise. ("db-add-derivation", "db-get-derivation"): New tests. ("db-add-evaluation", "db-get-evaluation"): Delete.
* evaluate: Store evaluations in evaluate script.Mathieu Lirzin2016-07-25
|
* evaluate: Use (cuirass ...) modules.Mathieu Lirzin2016-07-25
| | | | This avoids code duplication.
* evaluate: Use simple-format explicitely.Mathieu Lirzin2016-07-25
|
* evaluate: Use 'read' instead of 'eval-string'.Mathieu Lirzin2016-07-25
|
* maint: Update file headers.Mathieu Lirzin2016-07-25
|
* Evaluate derivations in a separate process.Mathieu Lirzin2016-07-13
This fixes a bug where different Guix branches gave the same derivations.