Commit Graph

63 Commits

Author SHA1 Message Date
Christopher Baines c7048abe31 Change a package_descriptions index to use MD5 of the description
To avoid the index data being too large.

This was first seen in guix commit 1bb4fd64b7bbe5a17eda6f0ca8105283c038f7c8:

  psql-query-error (fatal-error PGRES_FATAL_ERROR ERROR: index row size 2808
  exceeds maximum 2712 for index "package_descriptions_locale_description_key"
  HINT: Values larger than 1/3 of a buffer page cannot be indexed.
2020-08-23 14:42:32 +01:00
Danjela Lura ee613cdb30 Add the package_metadata_tsvectors table
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-08-12 08:53:35 +01:00
Christopher Baines 5dc9ed65ff Add a index to derivation_output_details_sets
This helps with queries like:

  SELECT *
  FROM derivation_output_details_sets
  WHERE ARRAY[5563227] <@ derivation_output_details_ids;
2020-07-04 08:59:29 +01:00
Christopher Baines 0242bc6a2e Remove the constraint on having one derivation build per server
As the Guix Build Coordinator can build one derivation many times.
2020-07-01 09:35:40 +01:00
Christopher Baines 5ee8207565 Avoid duplicate build status entries
This effectively makes adding build status entries idempotent to some degree.
2020-07-01 09:35:29 +01:00
Christopher Baines ddbe4c2192 Support storing the id's representing builds in other services
Like Cuirass, or the Guix Data Service. This isn't so necessary with Cuirass,
as the derivation/output are unique identifiers, but for the Guix Build
Coordinator, one derivation/output can be built many times, with potentially
differing results.
2020-06-27 14:05:51 +01:00
Christopher Baines 1d48885e6a Make build_status.timestamp nullable
The Guix Build Coordinator doesn't record timestamps for events
currently. This is something to fix, but allow for build statuses without
timestamps as they're not necessary.
2020-06-27 14:05:51 +01:00
Danjela Lura 8d9a4d105c Get the translated package synopsis and descriptions into the database
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-19 16:03:32 +01:00
Danjela Lura f67bea719d Get the translated lint checker descriptions into the database
Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-06-07 20:17:03 +01:00
Christopher Baines 916b594473 Make nar_urls file sizes optional 2020-06-03 06:56:59 +01:00
Christopher Baines b6754c8a4c Add a lookup_builds field to the build_servers table
This is to allow for build servers where only the substitutes should be
queried, and it shouldn't be assumed that they're running Cuirass.
2020-05-24 17:02:53 +01:00
Christopher Baines 111576e3f9 Remove odd package derivations with mismatched systems
This follows on from 79993bfaef, disassociating
the relevant derivations from the revisions.
2020-04-24 21:47:06 +01:00
Christopher Baines 776d0462e9 Fix a missing ; in a Sqitch migration 2020-03-29 12:05:00 +01:00
Christopher Baines b30904e1af Make jobs unique by commit
Given that a commit, regardless of what repository it comes from should
contain the same exactly the same data, just track jobs by commit.
2020-03-28 19:59:35 +00:00
Christopher Baines 0c4e6a2fe4 Create an index on narinfo_fetch_records
This greatly improves the performance of the derivation-outputs page.
2020-03-25 19:11:03 +00:00
Christopher Baines ca0d3ee754 Stop using package_versions_by_guix_revision_range
It's been replaced by the package_derivations_by_guix_revision_range table.
2020-03-24 20:44:57 +00:00
Christopher Baines c44297b615 Generate and store system test derivations for all supported systems
Rather than just the native system. I'm not quite sure of the value here, as I
guess system tests should behave the same regardless of the way the software
is compiled, but this seems like it could be useful, and being explicit about
the system the derivation is for is good.
2020-03-20 08:28:55 +00:00
Christopher Baines e5a6680808 Make a constraint deferrable
To allow for deferring it in a transaction when deleting derivations.
2020-02-16 22:28:37 +00:00
Christopher Baines dfccbf911c Update the build_servers_build_config values
Change target to '' if it matches system, as this matches the updated way of
storing derivations.
2020-02-13 23:11:36 +00:00
Christopher Baines 9be7dbac0b Start storing channel instance derivations
These are the ones that relate to Guix pull.
2020-02-11 08:56:24 +00:00
Christopher Baines c31c9575e0 Support excluding and including branches from a repository
So that you can have the Guix Data Service only pay attention to some of the
branches.
2020-02-08 12:03:41 +00:00
Christopher Baines f1989e8758 Rework cross derivations support
Stop using the system values as targets, and remove package derivation entries
where this is the case.

Switch the non-cross derivation case to have a target of "", rather than
matching the system, as this makes more sense, and is more consistent now that
the target values no longer match the system values.

Hardcode some more correct target values, and use these instead. Hopefully
this can be better integrated with Guix in the future.

This commit also includes a migration attempting to shrink some indexes.
2020-02-08 11:16:08 +00:00
Christopher Baines a3d84b1aec Add missing migration 2020-02-03 22:57:57 +00:00
Christopher Baines 8f0d5b51b1 Store information about system tests 2020-02-03 09:57:02 +01:00
Christopher Baines 2f36d47b1b Don't hardcode the expected x-git-repo header value
Rather than expecting it always to be "guix", store the expected value in the
database, and use the value of the header to find the relevant repository.
2020-01-11 17:25:08 +00:00
Christopher Baines 1679c985c4 Add a table to configure which build servers build what 2020-01-05 12:16:21 +00:00
Christopher Baines 82b797ee98 Create an index on the hash component of the store path
For derivation_source_files.
2019-12-29 17:55:04 +00:00
Christopher Baines c84b21be7c Add a new table to nars for derivation source files
This will allow serving the nars for derivation source files.
2019-12-28 22:47:58 +00:00
Christopher Baines ff01144e87 Create an index for the hash component of derivation filenames
This is to aid rendering of narinfo files. They're requested with the path
/HASH.narinfo, so to quickly find the relevant derivation, this index can be
used.
2019-12-26 09:28:20 +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 a965ba1f6a Start storing and identifying sets of derivation outputs
Derivations are effectively equivalent if they produce the same set of
outputs, which is possible because of the equivalence of fixed output
derivations. A fixed output derivation can be different, but equivalent,
because it produces the same fixed output.

To better allow tracking equivalent derivations, primarily to allow working
out what derivations might correspond to a build, store the sets of derivation
outputs, and which derivations they relate to.
2019-12-12 20:07:22 +00:00
Christopher Baines 0e97c55c0c Add some database indexes 2019-12-12 20:07:22 +00:00
Christopher Baines 0291bda98a Deduplicate builds and add a unique index
Duplicate builds could creep in if the code to create them ran concurrently. I
didn't exclude them initially, as I was unsure if there should be such a
restriction, but at least for now, Cuirass builds map exactly to a single
derivation, so use the same restriction here.
2019-12-12 20:07:22 +00:00
Christopher Baines 8a5beb7f88 Change nar_urls size to bigint
As some nars can be bigger than the size of an int.
2019-12-12 20:07:22 +00:00
Christopher Baines 5168b38c2a Change nars size to bigint
As some nars can be bigger than the maximum size of an int.
2019-12-12 20:07:22 +00:00
Christopher Baines d2405f6c77 Add a table to record where narinfo files were fetched from
Otherwise it's hard to associated narinfo files to build servers.
2019-12-12 20:07:22 +00:00
Christopher Baines 299f9dc480 Add an index on the derivation_file_name field in the builds table
As this helps when finding builds relating to specific derivations.
2019-12-12 20:07:22 +00:00
Christopher Baines b6194e7b3d Begin to add support for importing narinfo files
This commit adds the tables, as well as code to support extracting data from
narinfo files.
2019-11-30 10:51:58 +00:00
Christopher Baines 5663235048 Rework the builds and build_status tables as well as related code
Allow for build status information to be submitted by POST request. This
required some changes to the builds and build_status tables, as for example,
the Cuirass build id may not be available, and the derivation may not be know
yet, so just record the derivation file name.
2019-11-24 20:18:08 +00:00
Christopher Baines 9a3dbb1d5b Add new table to store token seeds for build servers 2019-11-23 11:30:36 +00:00
Christopher Baines 3ef99acc79 Add a new channel-news module, along with tables the relevant data 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 9fc6dd08e6 Remove duplicates from the guix_revisions table 2019-10-05 09:14:40 +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 b90e6289ac Fix the 'NULL' values in git_branches for the commits
The git_branches table had 'NULL' values for some commits where the branch was
deleted, importantly this was the string 'NULL', not an actual NULL value.

This commit fixes that, migrating the existing values to be '', and changing
the relevant code.

The primary key is also extended to include the datetime field, as this is
important to allow a branch to be deleted twice.
2019-09-29 17:10:04 +01:00
Christopher Baines bd47a03c22 Add migration to create an index on load_new_guix_revision_job_events
To speed up the rendering of the index page.
2019-09-29 12:04:57 +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 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 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 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