Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running builds view: show build step names #1372

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Mar 16, 2024

When using Hydra to build machine configurations, you'll often see "nixosConfigurations.foo" five times, i.e. for each build step being run. This isn't very helpful I think because in such a case, a single build step can also be compiling the Linux kernel.

This change also fetches the drvpath and type from the buildsteps relation. We're already joining it, so this doesn't make much difference (confirmed via query logging that this doesn't cause extra SQL queries).

Unfortunately build steps don't have a human readable name, so I'm deriving it from the drvpath by stripping away the hash (assuming that it'll never contain a - and that /nix/store/ is used as prefix). I decided against using the Nix bindings for that to avoid too much overhead due to store operations for each build step.

When using Hydra to build machine configurations, you'll often see
"nixosConfigurations.foo" five times, i.e. for each build step being
run. This isn't very helpful I think because in such a case, a single
build step can also be compiling the Linux kernel.

This change also fetches the `drvpath` and `type` from the `buildsteps`
relation. We're already joining it, so this doesn't make much difference
(confirmed via query logging that this doesn't cause extra SQL queries).

Unfortunately build steps don't have a human readable name, so I'm
deriving it from the drvpath by stripping away the hash (assuming that
it'll never contain a `-` and that `/nix/store/` is used as prefix). I
decided against using the Nix bindings for that to avoid too much
overhead due to store operations for each build step.
@mweinelt
Copy link
Member

Annoyingly that page already takes >20s to load, but whether that is related to this change, or whether it was previously this slow (it was slow), is probably something you can tell.

https://hydra.nixos.org/status

@mweinelt
Copy link
Member

Also seems redundant with the Package / release name field.

image

@Ma27
Copy link
Member Author

Ma27 commented Mar 16, 2024

Also seems redundant with the Package / release name field.

We could skip that part in the UI if step name equals package name. It's only really interesting if you have something like a VM test or nixos configuration with lots of steps before.

When building e.g. nixpkgs, the "Running builds" view will mostly look
like this

    hello.x86_64-linux (Build of hello-X.Y)
    exa.x86_64-linux (Build of exa-X.Y)
    ...

This doesn't provide any useful information. Showing the step name only
makes sense if it's not a child of the job's derivation. With this
patch, that information will only be shown if the drv name (i.e. w/o
`/nix/store/` prefix, .drv ext & hash) is not equal to the drv name of
the job itself (build.nixname).
@Ma27
Copy link
Member Author

Ma27 commented Mar 17, 2024

I didn't get to deploy bd380f6 yet, but locally it seems as if it'd resolve the issue about showing too much information.

@mweinelt
Copy link
Member

mweinelt commented Mar 18, 2024

Deployed on hydra.nixos.org.

image

@@ -91,6 +91,17 @@ BLOCK renderDuration;
duration % 60 %]s[%
END;

BLOCK renderDrvInfo;
drvname = step.drvpath
.substr(11) # strip `/nix/store/`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$Nix::Config::storeDir I think this is a thing, can you use it?

@Ericson2314
Copy link
Member

@mweinelt

but whether that is related to this change, or whether it was previously this slow (it was slow), is probably something you can tell.

So you are fine with the performance of this, now that it deployed?

@mweinelt
Copy link
Member

mweinelt commented Mar 26, 2024

No, https://hydra.nixos.org/status is really slow compared to https://hydra.nixos.org/machines, while vaguely showing the same things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants