2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hatchling,
|
|
|
|
hatch-vcs,
|
|
|
|
aiohttp,
|
|
|
|
attrs,
|
|
|
|
cattrs,
|
|
|
|
circus,
|
|
|
|
click,
|
|
|
|
click-option-group,
|
|
|
|
cloudpickle,
|
|
|
|
deepmerge,
|
|
|
|
fs,
|
|
|
|
httpx,
|
|
|
|
inflection,
|
|
|
|
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,
|
|
|
|
nvidia-ml-py,
|
|
|
|
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,
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.2.5";
|
2023-08-04 22:07:22 +00:00
|
|
|
aws = [ fs-s3fs ];
|
|
|
|
grpc = [
|
|
|
|
grpcio
|
|
|
|
grpcio-health-checking
|
|
|
|
opentelemetry-instrumentation-grpc
|
|
|
|
protobuf
|
|
|
|
];
|
|
|
|
io-file = [ filetype ];
|
|
|
|
io-image = io-file ++ [ pillow ];
|
|
|
|
io-json = [ pydantic ];
|
2024-06-05 15:53:02 +00:00
|
|
|
io-pandas = [
|
|
|
|
pandas
|
|
|
|
pyarrow
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
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;
|
2024-06-05 15:53:02 +00:00
|
|
|
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;
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
buildPythonPackage {
|
|
|
|
pname = "bentoml";
|
|
|
|
inherit version;
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bentoml";
|
|
|
|
repo = "BentoML";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-GBKxyjCs02mxYiMK4GhgFUATRCUSVf8mFbWjuPVD7SU=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/bentoml/BentoML/pull/4227 should fix this test
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/unit/_internal/utils/test_analytics.py \
|
|
|
|
--replace "requests" "httpx"
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "opentelemetry-semantic-conventions" ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
|
|
|
hatch-vcs
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
attrs
|
|
|
|
cattrs
|
|
|
|
circus
|
|
|
|
click
|
|
|
|
click-option-group
|
|
|
|
cloudpickle
|
|
|
|
deepmerge
|
|
|
|
fs
|
2023-11-16 04:20:00 +00:00
|
|
|
httpx
|
2023-10-09 19:29:22 +00:00
|
|
|
inflection
|
2023-08-04 22:07:22 +00:00
|
|
|
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
|
2023-11-16 04:20:00 +00:00
|
|
|
nvidia-ml-py
|
2023-08-04 22:07:22 +00:00
|
|
|
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;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
happysalada
|
|
|
|
natsukium
|
|
|
|
];
|
2024-01-13 08:15:51 +00:00
|
|
|
# https://github.com/bentoml/BentoML/issues/3885
|
|
|
|
broken = versionAtLeast pydantic.version "2";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|