• Stars
    star
    111
  • Rank 306,065 (Top 7 %)
  • Language
    Nix
  • Created over 8 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

hledger-interest

compute interest for hledger accounts
Haskell
26
star
2

hsemail

Haskell Parsec parsers for the syntax defined in RFC2821 and 2822
Haskell
14
star
3

hsyslog

Haskell FFI bindings to syslog(3) from POSIX.1-2001.
Haskell
11
star
4

funcmp

Function MetaPost is a Haskell frontend to the MetaPost language.
Haskell
8
star
5

csv2ledger

convert accounting data from CSV to Ledger format
Haskell
7
star
6

nix-paths

Knowledge of Nix's installation directories.
Haskell
7
star
7

cabal2spec

Convert Cabal files into rpm spec files
Haskell
7
star
8

postmaster

Postmaster ESMTP server
Haskell
7
star
9

ghc-library-id-bug

Empiric data about GHC's non-deterministic library ID bug
R
6
star
10

titlecase

Capitalize all English words except articles, coordinating conjunctions, and prepositions (unless they begin or end the title).
Haskell
5
star
11

distribution-opensuse

Types, functions, and tools to manipulate the openSUSE distribution.
Haskell
5
star
12

arch-haskell

Distribute a current subset of Hackage via ArchLinux
Haskell
3
star
13

pico-prolog

Toy Prolog Implementation in Haskell
Haskell
3
star
14

streamproc

Haskell library providing a continuation-based stream processor arrow
Haskell
3
star
15

ci

Continuous Integration with Hydra
Nix
3
star
16

petidomo

Simple but Powerful Mailing List Management Software
C
2
star
17

quizmaster

Spaced repetition flash card learning system
Haskell
2
star
18

xautolock

Launch a given program when your X session has been idle for a given time.
C
2
star
19

logging-facade-syslog

A logging back-end to syslog(3) for the logging-facade library
Haskell
2
star
20

hsdns

An asynchronous DNS resolver for Haskell implemented on top of GNU ADNS
Haskell
2
star
21

halipeto

Haskell library for generating static HTML pages from XML templates and a file-based value dictionary
Haskell
2
star
22

word-counting

Writing the fastest possible "wc" clone in Haskell
Haskell
1
star
23

parsec-class

Type class for types that can be constructed from their text representation
Haskell
1
star
24

flexible-defaults

Generate default function implementations for complex type classes.
Haskell
1
star
25

hex2017

Nix-based Haskell development environment for the Haskell eXchange 2017 workshop.
Dockerfile
1
star
26

hopenssl

Haskell FFI bindings to the OpenSSL library
Haskell
1
star