Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,824
    • Issues 43,824
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,413
    • Merge requests 1,413
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #17854
Closed
Open
Created Apr 24, 2017 by Jake Waksbaum@jbaum98

Nix Hydra Pipeline

Description

Right now the Shared Runners feature let's users run build processes on shared servers and save the build artifacts. The nix package manager provides a syntax to specify dependencies and build processes in a pure way which enables the creation of build farms using Hydra.

If there was a runner that was a Hydra build farm, users could build their projects using Nix. Nix has advantages over the Docker approach for both users and the server maintainers.

Users would see much faster build times. This is because dependencies are cached, so a change in the codebase wouldn't require redownloading and building all the dependencies of the project. Furthermore, dependencies are cached globally across all builds, so even if this is the first time a build is running for a project, any dependencies that have ever been built on the server would be immediately available.

In addition, using nix provides repeatable builds so that the users can replicate the build happening on the server on their own machines.

This would also increase the efficiency of the Shared Runner so that more users could be served by fewer servers. The work of downloading and building dependencies would all be shared so that much less server-time is wasted building the same programs again and again.

Proposal

Create a Hydra build farm as a Shared Runner.

Links / references

Hydra: https://nixos.org/hydra/

Nix package manager: https://nixos.org/nix/

Documentation blurb

Docker is a coarse-grained way of providing repeatable builds. The nix package manager is a more fine-grained way of accomplishing this that would allow for faster builds through sharing dependencies. Currently, to use nix in a Pipeline you need to a) install nix inside a Docker container b) download/build all your dependencies and c) build your project. By providing a Hydra build farm as a Shared Runners, we could simplify the process of setting up a nix based pipeline and make builds that use nix much more efficient, largely removing steps a) and b).

Users could simply have a flag in .gitlab-ci.yml indicating that the Pipeline should execute default.nix or some other nixfile.

Edited Jul 14, 2020 by Jason Yavorska
Assignee
Assign to
Time tracking