datadog-agent: 6.1.4 -> 6.4.2

This commit is contained in:
Domen Kožar 2018-09-08 22:39:55 +01:00 committed by Domen Kožar
parent e8621a45a2
commit 2c18d48c0e
3 changed files with 887 additions and 120 deletions

View File

@ -1,26 +1,27 @@
{ stdenv, fetchFromGitHub, buildGoPackage, makeWrapper, pythonPackages, pkgconfig }:
{ stdenv, fetchFromGitHub, buildGoPackage, makeWrapper, pythonPackages, pkgconfig, systemd }:
let
# keep this in sync with github.com/DataDog/agent-payload dependency
payloadVersion = "4.7";
payloadVersion = "4.7.1";
in buildGoPackage rec {
name = "datadog-agent-${version}";
version = "6.1.4";
version = "6.4.2";
owner = "DataDog";
repo = "datadog-agent";
src = fetchFromGitHub {
inherit owner repo;
rev = "a8ee76deb11fa334470d9b8f2356214999980894";
sha256 = "06grcwwbfvcw1k1d4nqrasrf76qkpik1gsw60zwafllfd9ffhl1v";
rev = "155fddb3547919bd54530dfdb250e0cb2defae7d";
sha256 = "0l7ic0p2h27x386k1gzzm20af2s06cpalmqz0h0c5zq4wszmw5zy";
};
subPackages = [
"cmd/agent"
"cmd/dogstatsd"
"cmd/py-launcher"
"cmd/cluster-agent"
# Does not compile: go/src/github.com/DataDog/datadog-agent/cmd/cluster-agent/main.go:31:12: undefined: app.ClusterAgentCmd
#"cmd/cluster-agent"
];
goDeps = ./deps.nix;
goPackagePath = "github.com/${owner}/${repo}";
@ -29,9 +30,11 @@ in buildGoPackage rec {
python = pythonPackages.python;
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ systemd ];
PKG_CONFIG_PATH = "${python}/lib/pkgconfig";
buildFlagsArray = let
preBuild = let
ldFlags = stdenv.lib.concatStringsSep " " [
"-X ${goPackagePath}/pkg/version.Commit=${src.rev}"
"-X ${goPackagePath}/pkg/version.AgentVersion=${version}"
@ -39,10 +42,9 @@ in buildGoPackage rec {
"-X ${goPackagePath}/pkg/collector/py.pythonHome=${python}"
"-r ${python}/lib"
];
in [
"-ldflags=${ldFlags}"
];
buildFlags = "-tags cpython";
in ''
buildFlagsArray=( "-tags" "ec2 systemd cpython process log" "-ldflags" "${ldFlags}")
'';
# DataDog use paths relative to the agent binary, so fix these.
postPatch = ''

View File

@ -0,0 +1,8 @@
To update v6 (v5 is deprecated and should be removed):
1. Bump `version`, `rev`, `sha256` and `payloadVersion` in `6.nix`
2. `git clone https://github.com/DataDog/datadog-agent.git && cd datadog-agent`
3. `git checkout <tag>`
4. `nix-env -i -f https://github.com/nixcloud/dep2nix/archive/master.tar.gz`
5. `deps2nix`
6. `cp deps.nix $NIXPKGS/pkgs/tools/networking/dd-agent/deps.nix`

File diff suppressed because it is too large Load Diff