2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/data-service.git synced 2023-12-14 03:23:03 +01:00
Commit graph

93 commits

Author SHA1 Message Date
Christopher Baines
2062badf51 Add a small table of recent job events
To make it easier to see what recently happened.
2020-01-12 17:30:52 +00:00
Christopher Baines
b26ba82dad Add more timing and debugging output to the load process
To help identify what's taking the most time.
2020-01-04 11:20:02 +00:00
Christopher Baines
f2343b5fc9 Switch to using package-supported-systems, not the transitive one
This seems to work better for both generating the non-cross and cross
derivations. Previously, using the package-transitive-supported-systems
approach didn't generate some cross derivations.
2019-12-31 10:29:02 +00:00
Christopher Baines
df9d0bbdd1 Improve generating derivations for foreign architectures
Use the second argument to package-transitive-supported-systems to correctly
identify the different bootstrap path for non x86_64 and i686-linux. The
previous implementation did work, but only up until a merge of core-updates
changed the bootstrap approach.
2019-12-31 10:23:29 +00:00
Christopher Baines
5163398e54 Add pagination to the jobs page 2019-12-26 23:03:12 +00:00
Christopher Baines
0cea51cc79 Add copyright and license headers to a bunch of source files
That were missing them.
2019-12-26 10:16:55 +00:00
Christopher Baines
dd94f59acf Fix the representation of the fixed output derivation hashes
Previously, they were nix-base32-string encoded, but the representation in the
derivations is base16, so it doesn't make sense to use a different
representation in the database.

Therefore, add some code that runs before the start of each job to convert the
data in the database. It was easier to do this in Guile with the existing
support for working with these bytevector representations. After some
migration period, the code for converting the old hashes can be removed.
2019-12-26 08:53:51 +00:00
Christopher Baines
474d942cbb Better handle errors within process-load-new-guix-revision-job 2019-12-23 19:28:13 +00:00
Christopher Baines
639f24bb22 Extract management of package_derivations_by_guix_revision_range
... entries in to a separate module, to split the code up a little further.
2019-12-22 16:09:32 +00:00
Christopher Baines
ebefc7815e Fix the use of defined? in relation to channel news
This worked fine in a REPL, but here it seems the module needs to be passed.
2019-12-22 15:23:16 +00:00
Christopher Baines
c8b93cb0d0 Add new derivation_output_details_set_id column to the builds table
As this will hopefully provide a faster way of associating derivations with
builds.
2019-12-12 20:07:22 +00:00
Christopher Baines
78695c46a1 Just update the package derivation entries that need updating
Previously, all the entries for the branch were deleted, but not, only the
entries for the branch, that are present in the revision that was loaded will
be deleted. This is more efficient, as it avoids deleting and recreating
entries in the table that shouldn't have changed.
2019-11-24 20:18:08 +00:00
Christopher Baines
f23ee71ea7 Insert channel news entries when loading new guix revisions
If the channel-news-for-commit function is present.
2019-11-21 19:56:19 +00:00
Christopher Baines
2e8ca7f547 Extract out creating the guix-revision from extract-information-from
To allow for using the guix-revision-id when inserting channel news entries.
2019-11-21 19:56:19 +00:00
Christopher Baines
66d726f1fd Refactor channel handling in the load-new-guix-revision module
To allow for passing the channel to channel-news-for-commit.
2019-11-21 19:56:19 +00:00
Christopher Baines
1442d17a3d Add a new table to describe the history of derivations
There's already the package_versions_by_guix_revision_range table, but I think
it would be also useful to be able to see how derivations change over time.
2019-11-09 19:59:55 +00:00
Christopher Baines
5e1808b4c2 Work around a problem loading guix revisions
Between b13b9384bc43bf93c754c037956c8ef9a99c2b41 and
601171a9bc7ca6e4acb932895a07c0ca9aedfdac, this method failed, so catch the
error to allow loading the affected revisions.
2019-11-03 15:46:44 +00:00
Christopher Baines
c9e0e311bb Send inferior error output to stderr
Ideally this would go in to the database somehow as well, but the only idea I
have for that is pass in a pipe, and then spawn a thread to read from the
other end of that pipe in a loop to send the output to the database.

That hasn't been written yet, so just send the output to stderr for now.
2019-10-18 17:15:45 +01:00
Christopher Baines
917d031d4f Remove unused inferior-package-transitive-supported-systems function 2019-10-18 17:15:25 +01:00
Christopher Baines
af1ffc2393 Add a page for queued jobs 2019-10-12 21:16:39 +01:00
Christopher Baines
427063c812 Make it easier to retry jobs
Add a new event 'retry', and run jobs where the number of retry events is
greater or equal to the number of failure events.

Also add an index to the git_branches table to make the finding jobs query a
bit faster.
2019-10-02 21:54:11 +01:00
Christopher Baines
580900b0f4 Fail early if the inferior is #f
This happens when the repl can't be loaded for example.
2019-09-29 10:45:46 +01:00
Christopher Baines
208122317a Try setting the en_US.UTF-8 locale, if the normalised fails
Older versions of the glibc-locales package just contain the UTF-8 variants,
not utf8.
2019-09-29 10:44:53 +01:00
Christopher Baines
d236f05d0f Don't error when processing revisions of Guix without graft support 2019-09-29 10:44:25 +01:00
Christopher Baines
c81d1e04ea Handle loading revisions without the (guix lint) module
This is a recent addition, so to support loading revisions without it, better
handle the error when loading the module.
2019-09-29 00:21:25 +01:00
Christopher Baines
15b94238c5 Unset the GUILE_LOAD_* environment variables when using inferiors
Otherwise modules from outside of the inferior can leak in.
2019-09-28 23:56:41 +01:00
Christopher Baines
43bc7cab91 Add a new table to store package versions by revision ranges
This isn't new information, but derived from information already in the
database. It's collected here to make querying faster.

The table is updated when each new revision is entered.
2019-09-27 17:28:46 +01:00
Christopher Baines
38adedcede Add newline to the end of the duplicate lint warning output 2019-09-05 16:07:23 +02:00
Christopher Baines
1a55022524 Improve the package and package-metadata modules
Add tests around the package module, extract out the use of the
inferior-package record assessors so that they aren't part of the tests, and
switch across the package-metadata module to use
insert-missing-data-and-return-all-ids.
2019-09-05 16:07:23 +02:00
Christopher Baines
91a9ba4349 Add a new table guix_revision_lint_checkers
To associate a set of lint checkers with a specific revision. While there is
the association through the lint warnings, that only works for checkers where
there are lint warnings for that revision.

Therefore, to allow finding all the checkers for a specific revision, also
associate them directly with the revision.
2019-09-01 18:32:09 +01:00
Christopher Baines
3ad100bedc Log the manifest derivation when loading new revisions
As this is useful to know.
2019-09-01 17:40:16 +01:00
Christopher Baines
07f368a54b Include glibc-locales from the inferior guix in the environment
When loading data from an inferior Guix, first build it's latest version of
glibc-locales, and include that in the environment from the inferior.

This improves locale support, which is currently relevant for extracting lint
warnings.

Without this change, you'd only be able to switch to locales supported by the
glibc-utf8-locales package, assuming that the right version is available.
2019-09-01 13:12:10 +01:00
Christopher Baines
af581784b2 Log the guix store path being used
In the load-new-guix-revision module.
2019-09-01 13:12:10 +01:00
Christopher Baines
f118ed0bf9 Improve handling of errors when changing locale
In the load-new-guix-revision module.
2019-09-01 13:12:10 +01:00
Christopher Baines
6b9977f62e Store lint warnings in the database
This commit adds the relevant tables and code to store lint warnings in the
database.

Currently, only lint checkers which don't require access to the network will
be run, as this allows the processing to happen without network access. Also,
this functionality won't work in older versions of Guix which don't expose the
lint warnings in a compatible way.
2019-09-01 13:12:10 +01:00
Christopher Baines
bf469504eb Add buffering to the log handling for jobs
To increase the log output speed, avoiding inserting one character at a time
in to the database.
2019-08-31 12:10:54 +01:00
Christopher Baines
9e80bda4f9 Avoid erroring when processing emails again
These changes allow processing emails again, and just creating job and branch
entries where data is missing.
2019-08-05 20:59:48 +01:00
Christopher Baines
002ae7685c Clear the previous log entry when starting a job 2019-08-04 09:42:21 +01:00
Christopher Baines
91be72df03 Display the jobs related to a revision on the revision page 2019-07-22 20:00:11 +01:00
Christopher Baines
6dd52f08ed Remove restrictions in select-job-for-update
This allows running jobs manually that have failed.
2019-07-19 20:25:53 +01:00
Christopher Baines
71607eff66 Close the logging port once it's been used 2019-07-19 20:25:13 +01:00
Christopher Baines
413ef9ea6e Prioritise processing the latest revisions for branches
Reserve some capacity to process revisions which are the tip of a branch. This
should reduce the time between new revisions appearing, and then being
processed.
2019-07-16 18:20:02 +01:00
Christopher Baines
6904547bf2 Record jobs as failed when they are killed
So that they aren't retried again and again.
2019-07-14 14:43:47 +01:00
Christopher Baines
83ef624b97 Switch to processing jobs in parallel
This should speed up processing new revisions, reduce latency between finding
out about new revisions and processing them, as well as help manage memory
usage, by processing each job in a process that then exits.
2019-07-12 23:00:44 +01:00
Christopher Baines
a6bd46b829 Obtain a lock when inserting the data for a new revision
This is working towards running the jobs in parallel. Each job looks at the
records in the database, and adds missing ones. If other jobs, running in
different transactions insert the same missing records at the same time, this
could cause an error.

Therefore, to just avoid this problem, lock before inserting the data. This
will allow the jobs to be processed in parallel, and it shouldn't have too
much of an effect on performance, as the slow bit is outside of the
transaction.
2019-07-12 19:57:13 +01:00
Christopher Baines
05c8287965 Lock around the channel fetch when loading new revisions
This is in preparation for running jobs in parallel. The channels code in Guix
uses a cached copy of the Git repository. Multiple jobs can't concurrently
access this without causing issues, so use an advisory lock to ensure that
only one job is using the repository at a time.
2019-07-12 19:56:58 +01:00
Christopher Baines
743cec7cb6 Associate a name with database connections
This helps when working out which connection to the database is doing what.
2019-07-12 19:49:26 +01:00
Christopher Baines
1b5db7adac Fix using defined? to check for the open-inferior/container function
It doesn't work as intended unless the module is also specified, so do that.
2019-07-09 19:48:01 +01:00
Christopher Baines
502dc93618 Fix issue inserting the empty log row
If the job started, and then was restarted, the row will already exist. So
don't error on a conflict.
2019-07-09 18:43:21 +01:00
Christopher Baines
f2d28b4def Move around some of the load new revision code
To better separate the code that needs to happen after a lock has been
acquired to allow concurrently loading revisions without concurrent insertion
issues.
2019-07-07 21:59:36 +01:00