Ingestion of evaluation results of any supported channel #8

Closed
opened 2023-11-05 23:42:04 +00:00 by RaitoBezarius · 7 comments
RaitoBezarius commented 2023-11-05 23:42:04 +00:00 (Migrated from github.com)

The security tracker acts on supported channels, and we need to ingest an evaluation of all nixpkgs for any given supported channel at any point in time.

The tracker should subscribe to channel bumps (open problem), see how https://git.qyliss.net/pr-tracker detects them and how https://git.eno.space/label-tracker.git/ tracks them.

Proposal of implementation

Every time a channel bump, repull the repository, extract a worktree of that channel (or git clone via the reference for fast checkout), run nix-eval-jobs on that commit sha and collect the result and archive it as JSON with meta results (!!!).

Run this as a background job or a cron job that can easily be managed by infrastructure people or administrators to perform any maintenance task like cancelling evaluations, restarting evaluations, configuring the number of concurrent evaluations, etc.

Ideas for the future

Expose this data of evaluations publicly and let people access it directly, it's useful in general.

The security tracker acts on supported channels, and we need to ingest an evaluation of all nixpkgs for any given supported channel at any point in time. The tracker should subscribe to channel bumps (open problem), see how https://git.qyliss.net/pr-tracker detects them and how https://git.eno.space/label-tracker.git/ tracks them. ### Proposal of implementation Every time a channel bump, repull the repository, extract a worktree of that channel (or git clone via the reference for fast checkout), run `nix-eval-jobs` on that commit sha and collect the result and archive it as JSON with meta results (!!!). Run this as a background job or a cron job that can easily be managed by infrastructure people or administrators to perform any maintenance task like cancelling evaluations, restarting evaluations, configuring the number of concurrent evaluations, etc. ### Ideas for the future Expose this data of evaluations publicly and let people access it directly, it's useful in general.
RaitoBezarius commented 2023-11-06 00:03:05 +00:00 (Migrated from github.com)

I should also be able to use a management command to seed my evaluation results in my database without having to go through nix-eval-jobs through the background task system as a starter.

I should also be able to use a management command to seed my evaluation results in my database without having to go through `nix-eval-jobs` through the background task system as a starter.
Tom-Hubrecht commented 2023-11-17 18:56:45 +00:00 (Migrated from github.com)

I believe that to track the channel bumps the easiest way is to regularly fetch https://nixos.org/channels data

I believe that to track the channel bumps the easiest way is to regularly fetch https://nixos.org/channels data
RaitoBezarius commented 2023-11-17 19:17:39 +00:00 (Migrated from github.com)

I believe that to track the channel bumps the easiest way is to regularly fetch nixos.org/channels data

It's not certain this API will stay available on the long term, I don't advise to use it.

> I believe that to track the channel bumps the easiest way is to regularly fetch [nixos.org/channels](https://nixos.org/channels) data It's not certain this API will stay available on the long term, I don't advise to use it.
Tom-Hubrecht commented 2023-11-17 19:36:21 +00:00 (Migrated from github.com)

Well, the way the other tools do it is by cloning the repo and looking at the ref of the branches linked to the channels

Well, the way the other tools do it is by cloning the repo and looking at the ref of the branches linked to the channels
RaitoBezarius commented 2023-11-17 23:16:11 +00:00 (Migrated from github.com)

Well, the way the other tools do it is by cloning the repo and looking at the ref of the branches linked to the channels

I think that's the sure way to go, or you can listen to events of the GitHub repository of nixpkgs.

> Well, the way the other tools do it is by cloning the repo and looking at the ref of the branches linked to the channels I think that's the sure way to go, or you can listen to events of the GitHub repository of nixpkgs.
RaitoBezarius commented 2023-12-05 06:55:15 +00:00 (Migrated from github.com)

So ingestion was implemented of manually evaluated nixpkgs.

All that's left is, for "perfect":

  • Track channels, e.g. track GitHub repo and poll/get notified about when a channel moves
  • Trigger nix-eval-jobs as a background task for this
  • Reuse the importing entrypoint we have in the manual importer

In the meantime, what we can hack is:

  • Perform evaluation-time configuration of channels to track, i.e. load a fixture
  • Setup crons based on known delays of channels move
  • Pick up channel move manually in systemd timers and run nix-eval-jobs
  • Throw them at the manual importer one by one
So ingestion was implemented of manually evaluated nixpkgs. All that's left is, for "perfect": - Track channels, e.g. track GitHub repo and poll/get notified about when a channel moves - Trigger nix-eval-jobs as a background task for this - Reuse the importing entrypoint we have in the manual importer In the meantime, what we can hack is: - Perform evaluation-time configuration of channels to track, i.e. load a fixture - Setup crons based on known delays of channels move - Pick up channel move manually in systemd timers and run nix-eval-jobs - Throw them at the manual importer one by one
RaitoBezarius commented 2023-12-05 20:50:57 +00:00 (Migrated from github.com)

We need to add the meta attributes in the ingester:

  • knownVulnerabilities
  • sourceProvenance
We need to add the meta attributes in the ingester: - knownVulnerabilities - sourceProvenance
Sign in to join this conversation.
No description provided.