The Fastest NixOS CI is now going Stable!

Dear NixOS Enthusiasts,

After - 802 days of development, - 4000 commit messages and - at least 3 burnouts later,

I am finally able to Announce…

The First Stable Release of Gradient v2.0.0 - Ready for Use in Production!

From now on every Release will include migrations for the NixOS module options, the PostgreSQL schema, cache storage, the API and the worker protocol.

… and we’re not stopping here, this release will have:

  • The Fastest and most Efficient NixOS CI currently OpenSource available
  • Gradient Teams: A way to manage User Groups and Worker Groups.
  • Gradient SSH: Adding Gradient as a Nix Remote Worker, distributing load to many Workers.
  • Web UI: Many responsiveness updates
  • Added Matrix and Slack integrations
  • Full IFD Support

on the Roadmap is:

  • Gradient Runners: A way to execute outside the Nix Sandbox
  • Cluster Jobs: Dispatch Jobs to multiple Workers Concurrently
  • Multi-Flake-Evaluations: Evaluate the same Nix Flake on multiple Workers concurrently

A Big Thank you to all Gradient Contributors and Testers in times Gradient wasn’t that stable.

A Special Thank You goes to: @Sandro and @kraftnix for dedicating their Time in Testing every single ever so unstable Feature!

26 Likes

This is really cool! Why would we look at this over, say, Hydra or eka-ci? Anything in the project you’re particularly proud of? Fun bugs you fixed during development?

1 Like

You can find a comparison table in the docs.

When comparing Hydra vs Gradient. You’ll find that Gradient has way better Integrations and UX. It is a CI made for Teams, and every Design decision was made to create something People like to use and not only have to use, because there is no better alternative.

1 Like
>fastest nix ci
>uses ssh for distributed builds

Gradient uses a zero-copy Protocol via websockets to connect to its Workers, not SSH. But you can configure Gradient remote builder on your PC, which then connects to the Gradient Server to build stuff.

1 Like

FYI, for distributed builds, you may also want to look into these projects, although you may have already seen them:

2 Likes

How does it compare to nix-grpc-store, tribuchet or rio? (architecture and performance wise)

1 Like

It isn’t strictly faster because of the Protocoll (eventhough not needing to searialize and deserialize in Memory helps). Gradient is simply faster because Evaluation and Builds run concurrently and each Build is beeing scored against Workers, minimizing Network Traffic.

The Real benefit comes from not having to worry about OOMs, if Gradient sees that no Worker currently has enough CPU or RAM it simply wont dispatch Jobs to that worker. In other Words Gradient does CPU Maxxing.

No other Nix Build System can do one of the things mentioned currently.

In tests we could bring build times down from 30 Minutes (Hydra) to only 9 Minutes with Gradient.

4 Likes

Are there benchmarks?

1 Like

Very cool.

In case others are trying to set it up:

  • could not get state.users to work right for the initial user… needed to use registration.enable = true; instead
  • reverseProxy.nginx.enable = true helps, rather than trying to set the nginx yourself, in case that is what you are used to
  • default port is 3000 … commonly clobbered

3 Likes

Also it’s recommended to Tune Eval Speeds and enable build.metrics = true; (please look at the nix code on what it changes first) on Workers for the full Performance.

You forgot to mention that it no longer hugs to death your self hosted S3, you can restart single builds, scheduling tries to estimate resource usage based on past builds and the nice progress bars that make it clear what (substituting, uploading, …) is happening right now.

We have been running Hydra for years and sometimes it looked like it wasn’t really doing something or we didn’t know where to look. With the gamified UI we have been CI watching the last weeks and seeing what is happening in the system.

I think the funniest bug we had the longest time, was that it tried to build clang over and over again despite being done with the final package already. :joy:

4 Likes

In case not everyone has seen it, yet, Gradjöng is the gamified UI that was build for fun and giggles.

There is a video in the readme, too.

8 Likes

I’m seeing several implementations and iterations of new builder and store protocols (they tend to be grpc). I think it would make sense to consolidate some of these efforts and standardize?

5 Likes

Would it be hard to build release.nix instead of just flake.nix?

1 Like

There are multiple Reason why Gradient isn’t using gRPC. Evaluation over a Protocol is a time critical and bandwidth critical Process, and everything needs to be asynchronous. Further more I usually had a bad experience getting things upstream in nix, adding features. I am not blaming anyone, because I know there are a lot of PRs, but it often seams like things only get merged once well known in the nix space has a interest in merging additions. I took almost a year to get fixes for the nix-daemon upstream. Thus I can’t sadly rely on others motivation to improve the Nix C-API and gRPC / nix-daemon protocol implemention. I am happy to continue making contributions, if they would get merged in reasonable time frame (not years).

3 Likes

out of curiosity, do the workers connect out, or does the coordinator connect back?

Gradient Proto supports both directions, but usually a Worker connects to a Server. A special case for example are the gradient.ci servers, where the e.g. Your own Gradient Instance initiates the connection to the Worker (servers.gradient.ci).

1 Like

What is “Teams” with a capital “T”?

2 Likes

*teams: A group of individuals working together to achieve their goal.

1 Like