Commit graph

1593 commits

Author SHA1 Message Date
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
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
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
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
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
c00405e232 Add some missing arguments to view-revision-packages 2019-07-07 16:42:00 +01:00
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
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
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
f504eec519 Direct the build output to the logging-port
So that this is logged.
2019-06-22 15:53:44 +02:00
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
e2c9709c7d Add a job page
Which shows the output for that job.
2019-06-22 01:51:49 +02:00
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
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
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
398b8aab05 Log the time loading new revisions takes 2019-06-21 15:46:53 +02:00
548e628398 Set #:fallback? to #t
If a substitute fails, just build it anyway.
2019-06-21 15:45:50 +02:00
f6ffcb5f02 Remove the revision labels from the links
As that seems neater.
2019-06-20 14:42:38 +02:00
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
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
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
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
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
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
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
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
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
ed0745096a Add a new page listing jobs 2019-06-17 11:21:58 +01:00
9c18c90505 Fix indicating if a revision is queued for processing 2019-06-17 11:21:36 +01:00
b1c0ec6c97 Remove some peek calls that have crept in 2019-06-16 14:21:34 +01:00
32ff341089 Link to the latest processed revision for a branch page 2019-06-16 10:45:22 +01:00
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
33956b394f Improve the error message when a load revision job fails
It's useful to know the commit.
2019-06-15 11:07:42 +01:00
13e2f87555 Support accessing the latest processed revision for a branch
This makes is easier to get the latest data for a branch in a single request,
rather than making one request to find the latest revision, then another to
get the data.
2019-06-13 23:14:04 +01:00
0bd1fc7e87 Display a backtrace for errors in channel->derivation-file-name
To help with debugging.
2019-06-13 23:13:34 +01:00
11144a5fe9 Catch the guix available when built
And use it for the hosting the inferiors, rather than computing the guix
package at runtime. This simplifies the behaviour when the Guix Data Service
is deployed as a Guix package.
2019-06-13 23:11:35 +01:00
6f379c7937 Rework creating /etc when building the derivation for a revision
Within an inferior. Just use the presence of open-inferior/container directly,
as this is more explicit.
2019-06-13 22:58:15 +01:00
7c75591f44 Don't show failing jobs on the index page
I'm not sure quite how to treat these yet, but for now, just stick with the
previous behaviour of showing revisions which haven't been processed yet,
along with the ones that have been successfully processed.
2019-06-13 19:19:04 +01:00
3a073d402d Display the request in one go
Otherwise, concurrent requests can cause the output to be interleaved.
2019-06-13 19:07:07 +01:00
5323f24133 Add --port and --host as options to the guix-data-service 2019-06-13 19:06:53 +01:00
bd292d6f57 Add an option to create a pid-file
This'll help the a service manager (like the shepherd) know when the service
is ready, which at the moment, means the database migrations have happened.
2019-06-11 07:40:26 +01:00
cf5dace846 Change to the sqitch directory to run deploy
As this means it can find the relevant files.
2019-06-11 07:22:17 +01:00
93fdefc7b1 Pass the --db-client option to sqitch deploy
So that it can always find psql.
2019-06-11 07:15:01 +01:00
d7586e88fa Pass --plan-file to the sqitch deploy command 2019-06-08 10:28:14 +01:00
64be346c8d Add sqitch and asset related config values 2019-06-08 10:28:03 +01:00
88922d9f11 Tweak the Makefile.am to install the right things
Install the assets and sqitch files, as they are needed. Remove the test
related sources.
2019-06-08 10:27:07 +01:00
42c608e004 Add a --update-database option
This runs Sqitch on startup, which should make managing the database easier,
as you just have to restart the service with this option, and the database
should be updated if necessary.
2019-06-07 07:33:34 +01:00
33cf8d66f6 Add a healthcheck endpoint
This indicates currently if the database is accessible and a simple query can
be performed. I'm mostly looking at using this when writing a system test for
this service.
2019-06-06 21:08:34 +01:00
aad2c9d9e8 Extract the database connection handling from the server
Previously, one of the first things that happened when responding to a request
was a database connection was made, even when serving the CSS. This is
unnecessary, so move the database connection handling in to the controller.

Also, to allow for separating it out from the assets, separate the assets out
from the parts of the controller that require a database connection.
2019-06-06 20:43:54 +01:00
544dc1558f Add a new test to cover some of the loading new revisions code 2019-06-02 22:02:12 +01:00