summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/chronos/default.nix
blob: e2452b2b44114d734cb26867c5de274861a08d75 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv, lib, makeWrapper, fetchgit, curl, jdk, maven, nodejs, mesos }:

stdenv.mkDerivation rec {
  pname = "chronos";
  version = "286b2ccb8e4695f8e413406ceca85b60d3a87e22";

  src = fetchgit {
    url = "https://github.com/airbnb/chronos";
    rev = version;
    sha256 = "0hrln3ad2g2cq2xqmy5mq32cdxxb9vb6v6jp6kcq03f8km6v3g9c";
  };

  buildInputs = [ makeWrapper curl jdk maven nodejs mesos ];

  mavenRepo = import ./chronos-deps.nix { inherit stdenv curl; };

  buildPhase = ''
    ln -s $mavenRepo .m2
    mvn package -Dmaven.repo.local=$(pwd)/.m2
  '';

  installPhase = ''
    mkdir -p $out/{bin,libexec/chronos}
    cp target/chronos*.jar $out/libexec/chronos/${pname}-${version}.jar

    makeWrapper ${jdk.jre}/bin/java $out/bin/chronos \
      --add-flags "-Xmx384m -Xms384m -cp $out/libexec/chronos/${pname}-${version}.jar com.airbnb.scheduler.Main" \
      --prefix "MESOS_NATIVE_LIBRARY" : "$MESOS_NATIVE_LIBRARY"
  '';

  meta = with lib; {
    homepage    = "http://airbnb.github.io/chronos";
    license     = licenses.asl20;
    description = "Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules";
    maintainers = with maintainers; [ offline ];
    platforms   = platforms.unix;
    broken = true; # doesn't build http://hydra.nixos.org/build/25768319
  };
}