All Projects → peti → Hydra Tutorial

peti / Hydra Tutorial

Sample configuration files for setting up your own Hydra continuous integration server.

Labels

Projects that are alternatives of or similar to Hydra Tutorial

Elm2nix
Convert Elm project into Nix expressions
Stars: ✭ 65 (-31.58%)
Mutual labels:  nix
Nixos Configs
My NixOS configs
Stars: ✭ 86 (-9.47%)
Mutual labels:  nix
Nix Processmgmt
Experimental Nix-based process management framework
Stars: ✭ 92 (-3.16%)
Mutual labels:  nix
Home Manager Template
A quick-start template for using home-manager in a more reproducible way.
Stars: ✭ 73 (-23.16%)
Mutual labels:  nix
Dhall Nix
This repository has moved to https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-nix
Stars: ✭ 82 (-13.68%)
Mutual labels:  nix
Vuizvui
Nix(OS) expressions used by the OpenLab and its members
Stars: ✭ 87 (-8.42%)
Mutual labels:  nix
Dotfiles
well-tailored NixOS & nix-darwin dotfiles
Stars: ✭ 63 (-33.68%)
Mutual labels:  nix
Stack2nix
Generate nix expressions for Haskell projects
Stars: ✭ 93 (-2.11%)
Mutual labels:  nix
Cachix Action
Build software only once and put it in a global cache
Stars: ✭ 85 (-10.53%)
Mutual labels:  nix
Upcast
Abandonware
Stars: ✭ 91 (-4.21%)
Mutual labels:  nix
Terranix
terranix is a terraform.json generator with a nix-like feeling
Stars: ✭ 77 (-18.95%)
Mutual labels:  nix
B
Collection of configuration stuff.
Stars: ✭ 80 (-15.79%)
Mutual labels:  nix
Rules nixpkgs
Rules for importing Nixpkgs packages into Bazel.
Stars: ✭ 88 (-7.37%)
Mutual labels:  nix
Cardano Graphql
GraphQL API for Cardano
Stars: ✭ 66 (-30.53%)
Mutual labels:  nix
Pre Commit Hooks.nix
Seamless integration of https://pre-commit.com git hooks with Nix.
Stars: ✭ 92 (-3.16%)
Mutual labels:  nix
Rien
Predictable Haskell development environments with Cabal and Nix.
Stars: ✭ 65 (-31.58%)
Mutual labels:  nix
Homies
linux package management
Stars: ✭ 86 (-9.47%)
Mutual labels:  nix
System
My system configuration
Stars: ✭ 94 (-1.05%)
Mutual labels:  nix
Ghc.nix
Nix (shell) expression for working on GHC
Stars: ✭ 94 (-1.05%)
Mutual labels:  nix
Bauer
An Emacs+Nix IDE
Stars: ✭ 89 (-6.32%)
Mutual labels:  nix

How to set up your own Hydra Server

For those who enjoy watching technical screencasts, there's also a video about this subject available at https://www.youtube.com/watch?v=RXV0Y5Bn-QQ.

This repository contains a complex'ish example configuration for the Nix-based continuous build system Hydra that new users can use to get started. The file hydra-common.nix defines basic properties of a VBox-based virtual machine running NixOS 16.03, which hydra-master.nix extends to configure a running Hydra server. hydra-slave.nix, on the other hand, configures a simple build slave for the main server to delegate build jobs to. Finally, hydra-network.nix ties those modules together into a network definition for Nixops.

To run these examples quickly with nixops on your local machine, you'll need

  • hardware virtualization support,
  • 8+ GB of memory,
  • NixOS and Nixops installed.

Also, your configuration.nix file should include:

  virtualisation.virtualbox.host.enable = true;

If those pre-conditions are met, follow these steps:

  1. Generate an SSH key used by the Hydra master server to authenticate itself to the build slaves:

    $ ssh-keygen -C "[email protected]" -N "" -f id_buildfarm
    
  2. Set up your shell environment to use the nixos-16.03 release for all further commands:

    $ NIX_PATH="nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-16.03.tar.gz"
    $ export NIX_PATH
    
  3. Start the server:

    $ nixops create -d hydra hydra-network.nix
    $ nixops deploy -d hydra
    
  4. Ensure that the main server knows the binary cache for nixos-16.03:

    nixops ssh hydra -- nix-channel --update
    

If all these steps completed without errors, then nixops info -d hydra will tell you the IP address of the new machine(s). For example, let's say that the hydra machine got assigned the address 192.168.56.101. Then go to http://192.168.56.101:8080/ to access the web front-end and sign in with the username "alice" and password "foobar".

Now you are ready to create projects and jobsets the repository contains the following examples that you can use:

The last jobset performs several Haskell builds that may be quite expensive, so it's probably wise not to run that on virtual hardware but only on a real sever.

Miscellaneous topics

  • How to disable binary substitutions for higher evaluation performance.

  • How to run emergency garbage collections:

    $ systemctl start hydra-update-gc-roots.service
    $ systemctl start nix-gc.service
    
  • "Shares" are interpreted as follows: each jobset has a "fraction", which is its number of shares divided by the total number of shares. The queue runner records how much time a jobset has used over the last day as a fraction of the total time and then jobsets are ordered by their allocated fraction divided by the fraction of time used i.e. jobsets that have used less of their allotment are prioritized.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].