about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bentoml
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2023-07-27 16:13:29 +0900
committerYt <happysalada@tuta.io>2023-07-27 08:20:42 +0000
commita2c1f741b8d9e528726f827267a3eff20e2419fe (patch)
treef20a161ebf856c4db7714b083a3438f32edb56de /pkgs/development/python-modules/bentoml
parentc19e300b6cf46946df537abc22b953f5ef057574 (diff)
python310Packages.bentoml: init at 1.1.0
Diffstat (limited to 'pkgs/development/python-modules/bentoml')
-rw-r--r--pkgs/development/python-modules/bentoml/default.nix198
1 files changed, 198 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bentoml/default.nix b/pkgs/development/python-modules/bentoml/default.nix
new file mode 100644
index 0000000000000..a48222d9c2437
--- /dev/null
+++ b/pkgs/development/python-modules/bentoml/default.nix
@@ -0,0 +1,198 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, hatchling
+, hatch-vcs
+, aiohttp
+, attrs
+, cattrs
+, circus
+, click
+, click-option-group
+, cloudpickle
+, deepmerge
+, fs
+, jinja2
+, numpy
+, opentelemetry-api
+, opentelemetry-instrumentation
+, opentelemetry-instrumentation-aiohttp-client
+, opentelemetry-instrumentation-asgi
+, opentelemetry-sdk
+, opentelemetry-semantic-conventions
+, opentelemetry-util-http
+, packaging
+, pathspec
+, pip-requirements-parser
+, pip-tools
+, prometheus-client
+, psutil
+, pynvml
+, python-dateutil
+, python-json-logger
+, python-multipart
+, pyyaml
+, requests
+, rich
+, schema
+, simple-di
+, starlette
+, uvicorn
+, watchfiles
+, fs-s3fs
+, grpcio
+, grpcio-health-checking
+, opentelemetry-instrumentation-grpc
+, protobuf
+, grpcio-channelz
+, grpcio-reflection
+, filetype
+, pillow
+, pydantic
+, pandas
+, pyarrow
+, opentelemetry-exporter-otlp-proto-http
+# https://pypi.org/project/opentelemetry-exporter-jaeger-proto-grpc/
+# , opentelemetry-exporter-jaeger # support for this exporter ends in july 2023
+, opentelemetry-exporter-otlp
+# , opentelemetry-exporter-zipkin
+, tritonclient
+# native check inputs
+, pytestCheckHook
+, scikit-learn
+, lxml
+, orjson
+, pytest-asyncio
+, fastapi
+}:
+
+let
+  version = "1.1.0";
+  aws = [ fs-s3fs ];
+  grpc = [
+    grpcio
+    grpcio-health-checking
+    opentelemetry-instrumentation-grpc
+    protobuf
+  ];
+  io-file = [ filetype ];
+  io-image = io-file ++ [ pillow ];
+  io-json = [ pydantic ];
+  io-pandas = [ pandas pyarrow ];
+  grpc-reflection = grpc ++ [ grpcio-reflection ];
+  grpc-channelz = grpc ++ [ grpcio-channelz ];
+  monitor-otlp = [ opentelemetry-exporter-otlp-proto-http ];
+  # tracing-jaeger = [ opentelemetry-exporter-jaeger ];
+  tracing-otlp = [ opentelemetry-exporter-otlp ];
+  # tracing-zipkin = [ opentelemetry-exporter-zipkin ];
+  io = io-json ++ io-image ++ io-pandas ++ io-file;
+  tracing = tracing-otlp; # ++ tracing-zipkin ++ tracing-jaeger
+  optional-dependencies = {
+    all = aws ++ io ++ grpc ++ grpc-reflection ++ grpc-channelz ++ tracing ++ monitor-otlp;
+    inherit aws grpc io-file io-image io-json io-pandas io grpc-reflection
+      grpc-channelz monitor-otlp tracing-otlp tracing;
+    triton = [ tritonclient ] ++ tritonclient.optional-dependencies.http ++ tritonclient.optional-dependencies.grpc;
+  };
+in
+buildPythonPackage {
+  pname = "bentoml";
+  inherit version;
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "bentoml";
+    repo = "BentoML";
+    rev = "v${version}";
+    hash = "sha256-ZhgBw/zBazfVNPvcfAlHEGvc9hzVm7aKLXmwwvMmF0A=";
+  };
+
+  pythonRelaxDeps = [
+    "opentelemetry-semantic-conventions"
+  ];
+
+  nativeBuildInputs = [
+    hatchling
+    hatch-vcs
+  ];
+
+  propagatedBuildInputs = [
+    aiohttp
+    attrs
+    cattrs
+    circus
+    click
+    click-option-group
+    cloudpickle
+    deepmerge
+    fs
+    jinja2
+    numpy
+    opentelemetry-api
+    opentelemetry-instrumentation
+    opentelemetry-instrumentation-aiohttp-client
+    opentelemetry-instrumentation-asgi
+    opentelemetry-sdk
+    opentelemetry-semantic-conventions
+    opentelemetry-util-http
+    packaging
+    pathspec
+    pip-requirements-parser
+    pip-tools
+    prometheus-client
+    psutil
+    pynvml
+    python-dateutil
+    python-json-logger
+    python-multipart
+    pyyaml
+    requests
+    rich
+    schema
+    simple-di
+    starlette
+    uvicorn
+    watchfiles
+  ];
+
+  passthru.optional-dependencies = optional-dependencies;
+
+  pythonImportsCheck = [ "bentoml" ];
+
+  preCheck = ''
+    # required for CI testing
+    # https://github.com/bentoml/BentoML/pull/4056/commits/66302b502a3f4df4e8e6643d2afefefca974073e
+    export GITHUB_ACTIONS=1
+  '';
+
+  disabledTestPaths = [
+    "tests/e2e"
+    "tests/integration"
+  ];
+
+  disabledTests = [
+    # flaky test
+    "test_store"
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+    pandas
+    pydantic
+    scikit-learn
+    lxml
+    orjson
+    pytest-asyncio
+    pillow
+    fastapi
+    starlette
+  ] ++ optional-dependencies.grpc;
+
+
+  meta = with lib; {
+    description = "Build Production-Grade AI Applications";
+    homepage = "https://github.com/bentoml/BentoML";
+    changelog = "https://github.com/bentoml/BentoML/releases/tag/v${version}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ happysalada natsukium ];
+  };
+}