diff --git a/doc/release-notes/rl-2511.section.md b/doc/release-notes/rl-2511.section.md index 55f1caa48de1..3e906b17836b 100644 --- a/doc/release-notes/rl-2511.section.md +++ b/doc/release-notes/rl-2511.section.md @@ -20,6 +20,8 @@ - `space-orbit` package has been removed due to lack of upstream maintenance. Debian upstream stopped tracking it in 2011. - `command-not-found` package is now disabled by default; it works only for nix-channels based systems, and requires setup for it to work. +- `victoriametrics` no longer contains VictoriaLogs components. These have been separated into the new package `victorialogs`. + - `gnome-keyring` no longer ships with an SSH agent anymore because it has been deprecated upstream. You should use `gcr_4` instead, which provides the same features. More information on why this was done can be found on [the relevant GCR upstream PR](https://gitlab.gnome.org/GNOME/gcr/-/merge_requests/67). - `lima` package now only includes the guest agent for the host's architecture by default. If your guest VM's architecture differs from your Lima host's, you'll need to enable the `lima-additional-guestagents` package by setting `withAdditionalGuestAgents = true` when overriding lima with this input. diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 29a5391b41ff..33da2dbb3990 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -80,6 +80,8 @@ - `vmalert` now supports multiple instances with the option `services.vmalert.instances."".enable` +- [`services.victorialogs.package`](#opt-services.victorialogs.package) now defaults to `victorialogs`, as `victoriametrics` no longer contains the VictoriaLogs binaries. + - The `wstunnel` module was converted to RFC42-style settings, you will need to update your NixOS config if you make use of this module. ## Other Notable Changes {#sec-release-25.11-notable-changes} diff --git a/nixos/modules/services/databases/victorialogs.nix b/nixos/modules/services/databases/victorialogs.nix index 9d1324b2821e..8a246ad666e3 100644 --- a/nixos/modules/services/databases/victorialogs.nix +++ b/nixos/modules/services/databases/victorialogs.nix @@ -28,7 +28,7 @@ in { options.services.victorialogs = { enable = mkEnableOption "VictoriaLogs is an open source user-friendly database for logs from VictoriaMetrics"; - package = mkPackageOption pkgs "victoriametrics" { }; + package = mkPackageOption pkgs "victorialogs" { }; listenAddress = mkOption { default = ":9428"; type = types.str; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 2ef61d4f5784..f2071a9f68e8 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1478,6 +1478,7 @@ in vector = import ./vector { inherit runTest; }; velocity = runTest ./velocity.nix; vengi-tools = runTest ./vengi-tools.nix; + victorialogs = runTest ./victorialogs.nix; victoriametrics = handleTest ./victoriametrics { }; vikunja = runTest ./vikunja.nix; virtualbox = handleTestOn [ "x86_64-linux" ] ./virtualbox.nix { }; diff --git a/nixos/tests/victorialogs.nix b/nixos/tests/victorialogs.nix new file mode 100644 index 000000000000..9545b61c402f --- /dev/null +++ b/nixos/tests/victorialogs.nix @@ -0,0 +1,26 @@ +{ lib, ... }: +{ + name = "victorialogs"; + meta.maintainers = with lib.maintainers; [ marie ]; + + nodes.machine = + { pkgs, ... }: + { + services.victorialogs.enable = true; + + services.journald.upload = { + enable = true; + settings = { + Upload.URL = "http://localhost:9428/insert/journald"; + }; + }; + environment.systemPackages = [ pkgs.curl ]; + }; + + testScript = '' + machine.wait_for_unit("victorialogs.service") + + machine.succeed("echo 'meow' | systemd-cat -p info") + machine.wait_until_succeeds("curl --fail http://localhost:9428/select/logsql/query -d 'query=\"meow\"' | grep meow") + ''; +} diff --git a/pkgs/by-name/vi/victorialogs/package.nix b/pkgs/by-name/vi/victorialogs/package.nix new file mode 100644 index 000000000000..a84434bc9520 --- /dev/null +++ b/pkgs/by-name/vi/victorialogs/package.nix @@ -0,0 +1,77 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, + nixosTests, +}: + +buildGoModule (finalAttrs: { + pname = "VictoriaLogs"; + version = "1.24.0"; + + src = fetchFromGitHub { + owner = "VictoriaMetrics"; + repo = "VictoriaMetrics"; + tag = "v${finalAttrs.version}-victorialogs"; + hash = "sha256-E52hvxazzbz9FcPFZFcRHs2vVg6fJJQ8HsieQovQSi4="; + }; + + vendorHash = null; + + subPackages = [ + "app/victoria-logs" + "app/vlinsert" + "app/vlselect" + "app/vlstorage" + "app/vlogsgenerator" + "app/vlogscli" + ]; + + postPatch = '' + # main module (github.com/VictoriaMetrics/VictoriaMetrics) does not contain package + # github.com/VictoriaMetrics/VictoriaMetrics/app/vmui/packages/vmui/web + # + # This appears to be some kind of test server for development purposes only. + # rm -f app/vmui/packages/vmui/web/{go.mod,main.go} + + # Increase timeouts in tests to prevent failure on heavily loaded builders + substituteInPlace lib/storage/storage_test.go \ + --replace-fail "time.After(10 " "time.After(120 " \ + --replace-fail "time.NewTimer(30 " "time.NewTimer(120 " \ + --replace-fail "time.NewTimer(time.Second * 10)" "time.NewTimer(time.Second * 120)" \ + ''; + + ldflags = [ + "-s" + "-w" + "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${finalAttrs.version}" + ]; + + preCheck = '' + # `lib/querytracer/tracer_test.go` expects `buildinfo.Version` to be unset + export ldflags=''${ldflags//=${finalAttrs.version}/=} + ''; + + __darwinAllowLocalNetworking = true; + + passthru = { + tests = { + inherit (nixosTests) + victorialogs + ; + }; + updateScript = nix-update-script { + extraArgs = [ "--version-regex=(.*)-victorialogs" ]; + }; + }; + + meta = { + homepage = "https://docs.victoriametrics.com/victorialogs/"; + description = "User friendly log database from VictoriaMetrics"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ marie ]; + changelog = "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/${finalAttrs.src.tag}"; + mainProgram = "victoria-logs"; + }; +}) diff --git a/pkgs/by-name/vi/victoriametrics/package.nix b/pkgs/by-name/vi/victoriametrics/package.nix index 5d9cd54783a6..b4a72734f194 100644 --- a/pkgs/by-name/vi/victoriametrics/package.nix +++ b/pkgs/by-name/vi/victoriametrics/package.nix @@ -9,7 +9,6 @@ withVmAuth ? true, # HTTP proxy for authentication withBackupTools ? true, # vmbackup, vmrestore withVmctl ? true, # vmctl is used to migrate time series - withVictoriaLogs ? true, # logs server }: buildGoModule (finalAttrs: { @@ -43,12 +42,6 @@ buildGoModule (finalAttrs: { ++ lib.optionals withBackupTools [ "app/vmbackup" "app/vmrestore" - ] - ++ lib.optionals withVictoriaLogs [ - "app/victoria-logs" - "app/vlinsert" - "app/vlselect" - "app/vlstorage" ]; postPatch = '' diff --git a/pkgs/by-name/vm/vmagent/package.nix b/pkgs/by-name/vm/vmagent/package.nix index 650ad38f0a40..b1c8f33bcb50 100644 --- a/pkgs/by-name/vm/vmagent/package.nix +++ b/pkgs/by-name/vm/vmagent/package.nix @@ -6,7 +6,6 @@ lib.addMetaAttrs { mainProgram = "vmagent"; } ( victoriametrics.override { withServer = false; - withVictoriaLogs = false; withVmAlert = false; withVmAuth = false; withBackupTools = false;