github wavelens/gradient v2.1.0

47 minutes ago

Breaking Changes

  • Workers and server need to upgrade together. The oldest worker protocol for the server changed from 35 to 66. A v2.0.1 worker cannot connect to a v2.1.0 server.
  • Git host connections replace integrations. Replace integrations with git_host_connections and tasks.<name>.triggers.*.integration with tasks.<name>.git_host_connection in the state file. API route /api/v1/projects/{project}/integrations* disappeared. Use /api/v1/{projects,teams,admin}/.../git-host-connections instead.
  • Moved State Options
    • projects.<name>.restrict_evaluation_fetches and projects.<name>.extra_allowed_uri_prefixes moved to tasks.<name> (#1091).
    • tasks.<name>.sign_cache moved to caches.<name>.projects.*.sign_outputs.
    • workers.<name>.enable_fetch disappeared. Use enable_network and enable_secrets.
  • Removed NixOS Options
    • services.gradient.worker.nixBin and services.gradient.worker.packages.nix. Workers no longer run the nix binary. Set nix.package for the daemon.
    • services.gradient.gc.wedgedEvalHours. Stuck evaluations no longer block garbage collection.
    • services.gradient.nar.verifyDigest. Hash checks for every uploaded NAR now run on the server.
    • services.gradient.publicStats. The worker list moved to the admin API. Only superusers can use that list.
    • services.gradient.storePath. The server stopped reading that option.
  • services.gradient.database.url must no longer contain a password. Move the URL to a file and set services.gradient.database.urlFile.
  • API routes /api/v1/teams/{team}/evaluations and /api/v1/user/invites disappeared (use /api/v1/user/requests).
  • Database migrations have no rollback. v2.0.1 cannot run after the upgrade. The server can no longer start on a database with migrations that the server does not recognize.
  • With several server instances, only one instance can run migrations at a time, with protection from a PostgreSQL advisory lock. Connect through session pooling or directly. Transaction-mode PgBouncer won't work.
  • Email addresses are now unique without case sensitivity. The migration can keep the address on one account and clear it on the other when two accounts differ only by case.
  • Upgrade steps remove cache entries with no file hash, no NAR hash and no NAR size. Gradient can rebuild or fetch those paths again on demand.
  • Permissions are stricter now. The view role is read-only. API keys work only inside their own scope. Superuser keys now split into read permission and write permission. Existing full superuser keys keep both.

New Features

  • Gradient Exec: run programs in VMs on workers, outside the Nix sandbox. Turn the feature on per task, pick a guest size and a working disk and keep prewarmed guests ready. Jobs start automatically after a build. Custom images work and jobs spread across several workers (#692, #1090, #1077).
  • gradient run can start programs and -L can forward local ports. Exec jobs come with a terminal, SSH access, live metrics and reasons for exit and restart. Jobs abort when no worker can run them (#1057, #1032, #1028).
  • Multi-node evaluations: tasks split large evaluations into shards based on cost estimates. Workers evaluate shards in parallel (#568, #927).
  • SBOMs gives every successful build and task a software bill of materials in CycloneDX format. Download it from the build menu or the API. Evaluation outputs list licenses for entry points (#819).
  • Admin Area targets server administrators. Tabs cover an overview, workers, storage, Git hosts and settings. Server options come with sources. Administrators can drain the instance, drain one worker or all workers and run deep garbage collection.
  • Superusers can abort any running job from the job board (#812).
  • Pinned cache paths: pin packages and pin everything those packages reference when needed. Garbage collection leaves pinned paths alone (#688).
  • A team or the whole instance can share a Git host connection. Connections come with a test, health status, delivery logs and a list of tasks that use them. Gitea and Forgejo connect over OAuth2. For GitHub, install a GitHub App from the task wizard (#518, #541, #902, #991, #992).
  • AGit pull requests on Gitea and Forgejo, /gradient abort commands in pull request comments and pull requests that update a lock file on any branch through gradient pr open (#911, #1139).
  • Triggers: a default trigger per task, branch triggers, cron triggers with 5 fields and path filters. There's also a generic POST trigger for any webhook sender, [skip ci] in commit messages and flake updates on push to an input repository (#682, #971, #995, #996).
  • Pull requests from forks don't evaluate before approval (#540).
  • Restricted evaluation: fetches during evaluation stay within the URLs in flake.lock and the allowed prefixes set for each task (#687, #1091).
  • Projects can use HTTPS Git credentials per project and verification of SSH host keys for Git per project.
  • Project secrets, including sops files that workers decrypt with SSH keys.
  • Flakes in a subdirectory of a repository through ?dir= in the repository URL.
  • Tasks can run evaluation only, without a build.
  • Dynamic derivations, recursive Nix and content-addressed outputs (#873).
  • A build can come partly from the cache when only some outputs are missing (#930).
  • Build attempts each get their own log. Use the selector in the log view to switch between them (#953).
  • Workers keep running jobs across reconnects and server restarts and the server can take them over instead of starting again.
  • New UI navigation: a command palette with Ctrl+K or /, Live Jobs on the job board, readiness cards on the project page, a single members page and Rename in the Danger Zone of projects, caches and tasks. The state file can rename by id (#1159).
  • API keys: regenerate the key secret, use any scope, check allowed IP ranges in the form and see missing permissions on a rejected request (#1049, #1050, #1150).
  • Browser and CLI sessions refresh automatically while in use (#990).
  • CLI: commands for teams, webhooks, secrets, Git host connections, evaluation and build control, worker drain, cache sharing and admin tasks. Also Git refs, --wait, exit codes and saved accounts.
  • The web port can serve a grpc:// Nix store for nix-grpc-store clients.
  • macOS workers through nix-darwin modules (#815) and useACMEHost for nginx setups (#870).
  • Export of OpenTelemetry traces and log output without timestamps under journald (#682).
  • Rotate cache signing keys while old signatures stay valid. Uploads to a cache with a storage limit fail at capacity.
  • Webhooks show the last delivery and the reason that a delivery skipped a task. Incoming deliveries go to the log.

Bug Fixes

  • Gradient now reports commit statuses for failed evaluations and for all entry points. Status posts retry on server errors and rate limits (#1189).
  • Fixed evaluations that failed when a store path or input source was missing from the cache (#1187, #805).
  • Large S3 uploads now split once they exceed 256 MiB. A stopped transfer causes the failure, not a fixed timeout (#1160).
  • Builds that a worker restart kills now return to the queue instead of failing (#1157).
  • Fixed the stall at "copying 0 paths" (#1069).
  • ECDSA keys for user SSH now work and RSA keys authenticate again. Gradient replaced the SSH client library (#913, #1067).
  • Builds of Git tasks set self.rev and self.shortRev (#1034).
  • Fixed cache downloads that failed with Invalid path format, NARs that shared files and store paths of empty directories that failed substitution (#952, #1012).
  • Keep evaluations now applies to actions that update flakes too (#1011).
  • Fixed the aggregation of cache storage, busy workers shown as 0% on the dashboard and wrong formats for worker percentages (#937, #981, #983).
  • Large builds no longer hit the rate limit for logs and remote builders over SSH no longer hit the rate limit for .narinfo (#891, #943).
  • Gradient stopped discarding entry points with the same name (#925).
  • gradient generate apikey --json now shows output and gradient build links every result (#787, #921).
  • The end of an evaluation no longer stops builds over SSH remote builders (#890).
  • Workers now read system features from the Nix store, so system features and experimental features stay separate (#886).
  • Gradient signs reused dependencies with the cache of the project that uses them (#807).
  • Gradient no longer marks upstream caches as HTTP/1.1-only by mistake. HTTP/1.1 is now an explicit option (#801).
  • Workers now start without a server URL (#799).
  • UI fixes cover the dependency graph in light mode, the "dependency failed" state and log view selection after a reload. Progress numbers now match the progress bar, columns line up and evaluation errors scroll. The task page no longer opens on task start. Build counts for projects and displayed errors in task settings work again (#854, #862, #892, #893, #977, #1018, #1051, #1055, #1094).
  • Security: Gradient verifies the host keys of Git servers over SSH, rejects unsafe tarball entries and internal URLs of upstream caches and writes netrc files with private permissions. Credentials no longer appear in URLs in error messages, decrypted keys stay in locked memory and Gradient hardened the systemd units.
  • Silent build timeouts now reset on each log line and evaluation subprocesses start in a clean environment.
  • Gradient now decodes zstd-compressed build logs from upstream caches.

Performance

  • Garbage collection, triggers that delete a cache entry and checks for missing runtime dependencies no longer scan the whole build graph. They also stopped holding long row locks (#1212, #1213, #1214).
  • Writes to the graph database no longer stall for minutes. User-facing writes run before maintenance, batches commit one at a time and lock waits have a cap (#674).
  • Split evaluation no longer waits for a single graph writer (#1009).
  • The scheduler scores jobs from a per-worker store summary and a capped candidate list, instead of presenting every candidate (#642).
  • Schema changes run online with concurrent index construction (#646).
  • Inputs of a Git flake come from a shallow fetch.
  • Workers size the Nix daemon pool from build capacity, send log lines and evaluation batches in bulk and share segments of the evaluation cache.
  • Webhook delivery and CI status reporting run in batches.
  • A glob pattern no longer causes exponential backtracking.
  • A background job recomputes the usage of each cache every 15 minutes.
  • The Web UI lazy-loads routes and dialogs, skips reloads in a hidden tab and refetches only the build pages that changed.

Full Changelog: v2.0.1...v2.1.0

Don't miss a new gradient release

NewReleases is sending notifications on new releases.