diff options
author | Aaron Andersen <aaron@fosslib.net> | 2024-06-23 22:55:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-23 22:55:16 -0400 |
commit | 9a2f3b21e383c3db0c509878f533a2850bbab4eb (patch) | |
tree | d92d05976bea32f9fcc50acad68097fd68eed81e | |
parent | f3e3fe79ae98179b830cdfbbf8fc8a7cdda6e06b (diff) | |
parent | 9e08d3e197f410f1d05ffa3ade33451f6b002fc4 (diff) |
Merge pull request #308271 from Shawn8901/migrate_vmagent
vmagent: build from victoriametrics derivation
-rw-r--r-- | pkgs/by-name/vi/victoriametrics/package.nix | 79 | ||||
-rw-r--r-- | pkgs/by-name/vm/vmagent/package.nix | 12 | ||||
-rw-r--r-- | pkgs/servers/monitoring/vmagent/default.nix | 27 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
4 files changed, 67 insertions, 53 deletions
diff --git a/pkgs/by-name/vi/victoriametrics/package.nix b/pkgs/by-name/vi/victoriametrics/package.nix index 2f6d03ddea88b..622d042e73026 100644 --- a/pkgs/by-name/vi/victoriametrics/package.nix +++ b/pkgs/by-name/vi/victoriametrics/package.nix @@ -1,36 +1,55 @@ -{ lib, buildGoModule, fetchFromGitHub, nixosTests }: +{ + lib, + buildGoModule, + fetchFromGitHub, + nixosTests, + withServer ? true, # the actual metrics server + withVmAgent ? true, # Agent to collect metrics + withVmAlert ? true, # Alert Manager + withVmAuth ? true, # HTTP proxy for authentication + withBackupTools ? true, # vmbackup, vmrestore + withVmctl ? true, # vmctl is used to migrate time series + withVictoriaLogs ? true, # logs server +}: buildGoModule rec { pname = "VictoriaMetrics"; version = "1.101.0"; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "VictoriaMetrics"; + repo = "VictoriaMetrics"; rev = "v${version}"; hash = "sha256-Jjz/CbVCvc9NFbvzYTFthG8cov4pYpc6y1A1Kmd3Mjg="; }; vendorHash = null; - subPackages = [ - "app/victoria-logs" - "app/victoria-metrics" - "app/vlinsert" - "app/vlselect" - "app/vlstorage" - "app/vmagent" - "app/vmalert-tool" - "app/vmalert" - "app/vmauth" - "app/vmctl" - "app/vminsert" - "app/vmselect" - "app/vmstorage" - "app/vmbackup" - "app/vmrestore" - "app/vmui" - ]; + subPackages = + lib.optionals withServer [ + "app/victoria-metrics" + "app/vminsert" + "app/vmselect" + "app/vmstorage" + "app/vmui" + ] + ++ lib.optionals withVmAgent [ "app/vmagent" ] + ++ lib.optionals withVmAlert [ + "app/vmalert" + "app/vmalert-tool" + ] + ++ lib.optionals withVmAuth [ "app/vmauth" ] + ++ lib.optionals withVmctl [ "app/vmctl" ] + ++ lib.optionals withBackupTools [ + "app/vmbackup" + "app/vmrestore" + ] + ++ lib.optionals withVictoriaLogs [ + "app/victoria-logs" + "app/vlinsert" + "app/vlselect" + "app/vlstorage" + ]; postPatch = '' # main module (github.com/VictoriaMetrics/VictoriaMetrics) does not contain package @@ -46,7 +65,11 @@ buildGoModule rec { --replace "time.NewTimer(time.Second * 10)" "time.NewTimer(time.Second * 120)" \ ''; - ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ]; + ldflags = [ + "-s" + "-w" + "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" + ]; preCheck = '' # `lib/querytracer/tracer_test.go` expects `buildinfo.Version` to be unset @@ -55,13 +78,21 @@ buildGoModule rec { __darwinAllowLocalNetworking = true; - passthru.tests = { inherit (nixosTests) victoriametrics; }; + passthru.tests = { + inherit (nixosTests) victoriametrics; + }; meta = with lib; { homepage = "https://victoriametrics.com/"; description = "fast, cost-effective and scalable time series database, long-term remote storage for Prometheus"; license = licenses.asl20; - maintainers = with maintainers; [ yorickvp ivan ]; + maintainers = with maintainers; [ + yorickvp + ivan + nullx76 + leona + shawn8901 + ]; changelog = "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v${version}"; mainProgram = "victoria-metrics"; }; diff --git a/pkgs/by-name/vm/vmagent/package.nix b/pkgs/by-name/vm/vmagent/package.nix new file mode 100644 index 0000000000000..de62ddd2d3863 --- /dev/null +++ b/pkgs/by-name/vm/vmagent/package.nix @@ -0,0 +1,12 @@ +{ lib, victoriametrics }: +lib.addMetaAttrs { mainProgram = "vmagent"; } ( + victoriametrics.override { + withServer = false; + withVictoriaLogs = false; + withVmAlert = false; + withVmAuth = false; + withBackupTools = false; + withVmctl = false; + withVmAgent = true; + } +) diff --git a/pkgs/servers/monitoring/vmagent/default.nix b/pkgs/servers/monitoring/vmagent/default.nix deleted file mode 100644 index 1dd054de46bcf..0000000000000 --- a/pkgs/servers/monitoring/vmagent/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ lib, fetchFromGitHub, buildGoModule }: -buildGoModule rec { - pname = "vmagent"; - version = "1.101.0"; - - src = fetchFromGitHub { - owner = "VictoriaMetrics"; - repo = "VictoriaMetrics"; - rev = "v${version}"; - sha256 = "sha256-Jjz/CbVCvc9NFbvzYTFthG8cov4pYpc6y1A1Kmd3Mjg="; - }; - - ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ]; - - vendorHash = null; - - subPackages = [ "app/vmagent" ]; - - meta = with lib; { - homepage = "https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/app/vmagent"; - description = "VictoriaMetrics metrics scraper"; - mainProgram = "vmagent"; - license = licenses.asl20; - platforms = platforms.linux; - maintainers = with maintainers; [ nullx76 leona ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae15165165ff2..169d36662ccc8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26531,8 +26531,6 @@ with pkgs; virtualenv-clone = with python3Packages; toPythonApplication virtualenv-clone; - vmagent = callPackage ../servers/monitoring/vmagent { }; - vsftpd = callPackage ../servers/ftp/vsftpd { }; wallabag = callPackage ../servers/web-apps/wallabag { }; |