[Nix-dev] Hydra
Tomas Hlavaty
tomas.hlavaty at knowledgetools.de
Mon Jul 18 12:53:29 CEST 2016
Hi Fare,
"Dev.Rideau.Fare" <Dev.Rideau.Fare at Dev.Bwater.Com> writes:
> I'm trying to determine how feasible it would be (with how much work)
> to use Hydra for a CI environment at work (replacing buildbot).
we've been using hydra for about a year now. Not sure how does it
compare to buildbot but we had no CI before, so it is a huge improvement
for us in any case.
The biggest effort was to write nix expressions for everything we wanted
to build, mainly because I was new to nixos. Most expressions were
reasonably easy, but some, e.g. oracleXE was a challenge and still have
some issues. It works for our need and we even got an experienced nixos
contributor to help us with plugging mingw based builds and tests into
hydra too.
There is no official hydra release, which can be rather frustrating.
This is hopefully going to change as there seem to be an effort to
change this.
> * I don't see much documentation. Many links are dead or redirect to
> the wrong thing: the old 2008 paper mentions nixos.org/hydra-scp but
> that doesn't exist. The "instructions available" link to a hydra job
> instead of an actual manual, and trying to manually link on "manual"
> goes to 404.
>
https://github.com/peti/hydra-tutorial should help you
> * How do you specify tests with hydra? When tests are stateful
> (especially integration tests), can it distinguish between tests that
> actually failed, and failure to test due to e.g. timeout trying to
> setup a test server? Can it handle retrying such tests?
Normally, software is split into packages, which are often implemented
as derivations in nix (kind of hash-consing). These derivations depend
on each other, and when you let hydra test a package and some dependency
fails, it will tell you. You can also restart failed builds. You can
also write VM tests, where you write a nix expression, which when run,
creates a nixos VM with all your dependencies, runs your code and tells
you if it works or what fails. You can also run the test locally in
qemu and poke around, quite easily.
> * Can Hydra drive Nix workers on Windows? on MacOS?
https://hydra.nixos.org/ has some OSX slaves.
Windows is a problem. As I said above, we test our lisp app using mingw
and wine under nixos. It is challenging but possible this way.
> * How much work would it be to make the above work, if it doesn't work
> yet?
Depends how much and how obscure software do you have. You can checkout
<https://github.com/NixOS/nixpkgs>, poke around and see some packages,
how they are implemented. Obscure proprietary dependencies can be a
problem.
Good luck!
Tomas
More information about the nix-dev
mailing list