Skip to content

hydra: Evaluate jobsets in Rust - #1940

Open
Ericson2314 wants to merge 2 commits into
NixOS:masterfrom
obsidiansystems:more-rust-eval
Open

Ericson2314 wants to merge 2 commits into
NixOS:masterfrom
obsidiansystems:more-rust-eval

Conversation

@Ericson2314

Copy link
Copy Markdown
Member

Most of what hydra-eval-jobset did doesn't need Perl. Fetching inputs does, because input plugins are written in Perl. Declarative projects need it too: their specification is fetched through a plugin, then applied by Perl helpers that hydra-notify's DeclarativeJobsets plugin also uses. Those two jobs become small scripts that the evaluator runs, hydra-fetch-input and hydra-prepare-declarative-jobset. Everything else is now Rust, in hydra-evaluator.

The Rust is meant to behave the same as the Perl did. Comments mark the places where matching it took extra work.

There are two intended changes:

  • hydra-evaluator <project> <jobset> evaluates a single jobset, and exits non-zero if the evaluation fails.

  • sysbuild inputs work now. The Perl called a result set that doesn't exist, so they always failed.

The evaluator's settings move from hydra.conf to /etc/hydra/evaluator.toml, and Hydra warns about any left behind.

Assisted-by: Claude Code (Opus 5.5)

…rocess

Two parts of `hydra-eval-jobset` become programs of their own, which it
now runs:

- `hydra-fetch-input` fetches inputs of plugin-provided types, one
  request at a time over JSON on standard streams, with one worker for
  the whole run.

- `hydra-prepare-declarative-jobset` fetches a declarative project's
  specification and applies it, either creating the jobsets it names or
  reconfiguring `.jobsets`.

These are the two parts that must stay Perl: input plugins are written
in Perl, and the declarative helpers are shared with `hydra-notify`'s
`DeclarativeJobsets` plugin. Moving them out first means replacing the
rest of `hydra-eval-jobset` doesn't also have to move them. Behaviour is
unchanged, and `hydra-eval-jobset` no longer loads plugins itself.
What remained of `hydra-eval-jobset` is now Rust, in `hydra-evaluator`,
which runs `hydra-fetch-input` and `hydra-prepare-declarative-jobset`
for the parts that must stay Perl.

The Rust is meant to behave the same as the Perl did. Comments mark the
places where matching it took extra work.

There are two intended changes:

- `hydra-evaluator <project> <jobset>` evaluates a single jobset, and
  exits non-zero if the evaluation fails.

- `sysbuild` inputs work now. The Perl called a result set that doesn't
  exist, so they always failed.

The evaluator's settings move from `hydra.conf` to
`/etc/hydra/evaluator.toml`, and Hydra warns about any left behind.

Assisted-by: Claude Code (Opus 5.5)

This branch has not been deployed

No deployments
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.

1 participant