diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-03-03 22:01:53 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-03-03 22:01:53 +0300 |
commit | c3b8f188d873df2ece23469c720647c267f79ee3 (patch) | |
tree | f28c59cf1a6f37024e3b185749a322d0979f7dca /pkgs/by-name/kr | |
parent | 9a3b0ba3b5548d62dce7fe260db5e7ff389119fa (diff) | |
download | nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar.gz nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar.bz2 nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar.lz nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar.xz nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.tar.zst nixlib-c3b8f188d873df2ece23469c720647c267f79ee3.zip |
krr: init at 1.7.0
Diffstat (limited to 'pkgs/by-name/kr')
-rw-r--r-- | pkgs/by-name/kr/krr/package.nix | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/by-name/kr/krr/package.nix b/pkgs/by-name/kr/krr/package.nix new file mode 100644 index 000000000000..d1819a749943 --- /dev/null +++ b/pkgs/by-name/kr/krr/package.nix @@ -0,0 +1,68 @@ +{ lib +, python3 +, fetchFromGitHub +, testers +, krr +}: + +python3.pkgs.buildPythonPackage rec { + pname = "krr"; + version = "1.7.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "robusta-dev"; + repo = "krr"; + rev = "refs/tags/v${version}"; + hash = "sha256-8K97v/8lsLqr88MSOT3peOy0GZp1so9GaipG/t2uR88="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail 'aiostream = "^0.4.5"' 'aiostream = "*"' \ + --replace-fail 'kubernetes = "^26.1.0"' 'kubernetes = "*"' \ + --replace-fail 'pydantic = "1.10.7"' 'pydantic = "*"' \ + --replace-fail 'typer = { extras = ["all"], version = "^0.7.0" }' 'typer = { extras = ["all"], version = "*" }' + ''; + + propagatedBuildInputs = with python3.pkgs; [ + aiostream + alive-progress + kubernetes + numpy + poetry-core + prometheus-api-client + prometrix + pydantic_1 + slack-sdk + typer + ] ++ typer.optional-dependencies.all; + + nativeCheckInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "robusta_krr" + ]; + + passthru.tests.version = testers.testVersion { + package = krr; + command = "krr version"; + }; + + meta = with lib; { + description = "Prometheus-based Kubernetes resource recommendations"; + longDescription = '' + Robusta KRR (Kubernetes Resource Recommender) is a CLI tool for optimizing + resource allocation in Kubernetes clusters. It gathers Pod usage data from + Prometheus and recommends requests and limits for CPU and memory. This + reduces costs and improves performance. + ''; + homepage = "https://github.com/robusta-dev/krr"; + changelog = "https://github.com/robusta-dev/krr/releases/tag/v${src.rev}"; + license = licenses.mit; + maintainers = with lib.maintainers; [ azahi ]; + mainProgram = "krr"; + }; +} |