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

461 commits

Author SHA1 Message Date
Christopher Baines
7a70e9ca6f Extract out view-revision/git-repositories
As this was duplicated in the functions for viewing known and unknown
revisions.
2019-07-22 20:29:29 +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
1f1deac296 Link from a revision to the git repository page 2019-07-19 21:29:56 +01:00
Christopher Baines
1f977f6c12 Improve how repositories and branches are handled
Make the link between repositories and branches clearer, replacing the
/branches and /branch pages by /repository/ and /repository/*/branch/* pages.
2019-07-19 21:22:15 +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
dab984b1d5 Fix match expression
Specify 'GET rather than GET, to actually match the method, rather than
binding it to GET.
2019-07-19 20:20:52 +01:00
Christopher Baines
fac3db2d14 Remove localhost from the Sqitch config
This means it'll connect over the socket, like the application.
2019-07-16 18:20:56 +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
3dfa9212f1 Kill long running load new revision jobs
There are some revisions of Guix which take forever to process (or days at
least). To avoid jobs being processed forever, kill them after they've been
running for a while (default 24 hours).
2019-07-12 23:00:44 +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
09d927cb99 Add a process-job command
This allows easily processing an individual job by id. This may be useful to
use manually, but also when processing jobs in parallel, as forking doesn't
work well with the libpq library used by squee.
2019-07-12 19:57:24 +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
fde1000cb3 Add a couple of functions for PostgreSQL advisory locks
Use symbol-hash to convert a symbol to the number for the lock. I'm hoping
this is OK, and it seems to be stable.
2019-07-12 19:51:42 +01:00
Christopher Baines
8f956aa6c2 Fix a bug where the list of 0 licenses wasn't handled correctly
This happened for a package with #f as the licenses. That's incorrect, but try
to handle it without erroring.
2019-07-12 19:50:48 +01:00
Christopher Baines
28baed2667 Fix the name for the jobs-load-new-guix-revision test module 2019-07-12 19:50:36 +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
Christopher Baines
2ea78cff47 Tweak how logs are stored
Previously, the query for the jobs page was really slow, as it checked the
load_new_guix_revision_job_log_parts table for each job, doing a sequential
scan through the potentially large table.

Adding an index didn't seem to help, as the query planner would belive the
query could return loads of rows, where actually, all that needed checking is
whether a single row existed with a given job_id.

To avoid adding the index to the load_new_guix_revision_job_log_parts table,
and fighting with the query planner, this commit changes the
load_new_guix_revision_job_logs table to include a blank entry for jobs which
are currently being processed. This is inserted at the start of the job, and
then updated at the end to combine and replace all the parts.

This all means that the jobs page should render quickly now.
2019-07-07 21:23:18 +01:00
Christopher Baines
c00405e232 Add some missing arguments to view-revision-packages 2019-07-07 16:42:00 +01:00
Christopher Baines
44b9d5658b Add buttons to scroll the page on the job page
As the page can be quite long, so jumping to the top and bottom is really
useful.
2019-06-24 21:01:23 +01:00
Christopher Baines
54b9922466 Iterate the log viewing
Replace the Guile-side HTML escaping with a less complete, but hopefully
faster PostgreSQL side HTML escaping approach.

Also, allow reading part of the log, by default, the last 1,000,000
characters, as this should render quickly.
2019-06-24 20:30:47 +01:00
Christopher Baines
afa86d6115 Add a parse-number function to the query-parameters module
Which does the same thing as parse-result-limit, which may have an overly
specific name.
2019-06-24 20:30:19 +01:00
Christopher Baines
f504eec519 Direct the build output to the logging-port
So that this is logged.
2019-06-22 15:53:44 +02:00
Christopher Baines
05165929a5 Stop closing the log-port port
This part of the soft-port seems to be called, but I don't know why, and
trying to close the output port causes issues.
2019-06-22 15:52:09 +02:00
Christopher Baines
e2c9709c7d Add a job page
Which shows the output for that job.
2019-06-22 01:51:49 +02:00
Christopher Baines
d96add30a0 Record the output from loading new revisions to the database
So that it can easily be shown through the web interface. There's two tables
being used. One which temporarily stores the output as it's output while the
job is running, and other which stores the whole log once the job has
finished.
2019-06-22 01:51:49 +02:00
Christopher Baines
baf2b17bf8 Re-arrange some of the load new revision code
Try to isolate the code that inserts in to the database, so that the relevant
tables can be locked during this time.
2019-06-21 15:47:59 +02:00
Christopher Baines
766656086f Add a couple of functions around timing
That don't rely on timing a single function.
2019-06-21 15:47:53 +02:00
Christopher Baines
398b8aab05 Log the time loading new revisions takes 2019-06-21 15:46:53 +02:00
Christopher Baines
548e628398 Set #:fallback? to #t
If a substitute fails, just build it anyway.
2019-06-21 15:45:50 +02:00
Christopher Baines
f6ffcb5f02 Remove the revision labels from the links
As that seems neater.
2019-06-20 14:42:38 +02:00
Christopher Baines
6e1a6c9808 Remove the compare form from the index page
It isn't very useful, as you have to know the commits. Now that there's Git
branch information, it should be possible to access this in a more useful way.
2019-06-20 14:34:00 +02:00
Christopher Baines
d07e3d9ba8 Move the derivations off the compare page
To the compare/derivations page. Previously, the compare/derivations page was
comparing more than the derivations, notably the package metadata. This change
avoids that, and also reduces the information overload on the compare page.
2019-06-20 14:29:56 +02:00
Christopher Baines
bb02511607 Don't have all the inputs use a monospace font
Only those where it's appropriate for the data, like commit hashes.
2019-06-20 14:19:11 +02:00
Christopher Baines
66364207f4 Process jobs starting with the most recent
Conventionally, you'd process the oldest job in a queue, but at the moment, it
would be more useful to have recent information more promptly, and fill in the
historical gaps later. I'm not sure this'll always be the case, but for now,
flip the order in which jobs are processed.
2019-06-19 23:54:12 +01:00
Christopher Baines
ea80311c49 Use revision labels on the index page as well
Also flip the branch and revision columns around, and add date information to
the branch column.
2019-06-19 23:39:53 +01:00
Christopher Baines
a168b23c24 Add labels to revisions on the branches and branch pages
And always link to the revision page. Now the label let's you know if you
should expect information or not for that revision.
2019-06-19 22:49:57 +01:00
Christopher Baines
e93b8f948e Improve the Unknown revision page
Make it similar to the revision page, as some of the information, like the
link to the relevant CGit instance might be available.
2019-06-19 22:03:55 +01:00
Christopher Baines
3df0b43146 Use line buffering for the input and output ports
As these are used for logging, which is done on a line by line basis. Remove
the now redundant calls to (force-output).
2019-06-17 18:09:10 +01:00
Christopher Baines
7f0a0ed3b1 Time everywhere a derivation is built when loading a new revision
As this is useful information.
2019-06-17 16:28:11 +01:00
Christopher Baines
ed0745096a Add a new page listing jobs 2019-06-17 11:21:58 +01:00
Christopher Baines
9c18c90505 Fix indicating if a revision is queued for processing 2019-06-17 11:21:36 +01:00
Christopher Baines
b1c0ec6c97 Remove some peek calls that have crept in 2019-06-16 14:21:34 +01:00
Christopher Baines
32ff341089 Link to the latest processed revision for a branch page 2019-06-16 10:45:22 +01:00
Christopher Baines
de8858c274 Make some pages around revisions more generic
So that they can also be used for the /branch/foo/latest-processed-revision
pages. The content is the same, but the title, link, and some of the links on
the page are different.
2019-06-16 10:27:14 +01:00