Skip to content

Commit

Permalink
Merge branch 'upstream-master' into sync/upstream-11-20-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
hdefazio committed Nov 20, 2024
2 parents 1382a8e + ea2318c commit 2d4f028
Show file tree
Hide file tree
Showing 57 changed files with 4,317 additions and 3,426 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/scheduled-image-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
file: python/storage-initializer.Dockerfile,
},
{ name: router, file: router.Dockerfile },
{ name: kserve-localmodel-controller, file: localmodel.Dockerfile },
]

steps:
Expand Down Expand Up @@ -70,6 +71,8 @@ jobs:
{ name: xgbserver, file: python/xgb.Dockerfile },
{ name: pmmlserver, file: python/pmml.Dockerfile },
{ name: paddleserver, file: python/paddle.Dockerfile },
{ name: lgbserver, file: python/lgb.Dockerfile },
{ name: huggingfaceserver, file: python/huggingface_server.Dockerfile },
]

steps:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Releases](https://img.shields.io/github/release-pre/opendatahub-io/kserve.svg?sort=semver)](https://github.com/opendatahub-io/kserve/releases)
[![LICENSE](https://img.shields.io/github/license/opendatahub-io/kserve.svg)](https://github.com/opendatahub-io/kserve/blob/master/LICENSE)
[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://github.com/kserve/community/blob/main/README.md#questions-and-issues)
[![Gurubase](https://img.shields.io/badge/Gurubase-Ask%20KServe%20Guru-006BFF)](https://gurubase.io/g/kserve)

KServe provides a Kubernetes [Custom Resource Definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) for serving predictive and generative machine learning (ML) models. It aims to solve production model serving use cases by providing high abstraction interfaces for Tensorflow, XGBoost, ScikitLearn, PyTorch, Huggingface Transformer/LLM models using standardized data plane protocols.

Expand Down
8 changes: 4 additions & 4 deletions docs/samples/explanation/alibi/alibiexplainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ After poetry has installed dependencies you should see:
You can check for successful installation by running the following command

```
usage: __main__.py [-h] [--http_port HTTP_PORT] [--grpc_port GRPC_PORT]
[--predict_url PREDICT_URL] [--method {ExplainerMethod.anchor_tabular}]
__main__.py: error: the following arguments are required: --predict_url
$ python alibiexplainer/__main__.py {AnchorTabular|AnchorText|AnchorImages}
...
2024-10-17 15:48:59.751 51916 kserve INFO [explainer.py:__init__():54] Predict URL set to None
```

## Samples
Expand All @@ -44,7 +44,7 @@ The following indicates a successful install.
To run static type checks:

```bash
mypy --ignore-missing-imports sklearnserver
mypy --ignore-missing-imports alibiexplainer
```
An empty result will indicate success.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

def main():
args, extra = parse_args(sys.argv[1:])
# Pretrained Alibi explainer

# Pretrained Alibi explainer
alibi_model = None
if args.storage_uri is not None:
alibi_model = os.path.join(
Expand Down
5,448 changes: 2,375 additions & 3,073 deletions docs/samples/explanation/alibi/alibiexplainer/poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/samples/explanation/alibi/alibiexplainer/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12"
python = ">=3.9,<=3.12"
kserve = { path = "../../../../../python/kserve", extras = ["storage"], develop = true }
alibi = { version = "^0.9.4", extras = ["shap", "tensorflow"] } # From 0.9.5 alibi uses BSL license
tensorflow = ">=2.12.0,<2.14" # the range that supports python 3.8 -- 3.11
dill = "^0.3.6"
tensorflow = ">=2.14" # version that starts to support python 3.9
dill = "^0.3.8"
nest-asyncio = "~1.4.0"
llvmlite = ">0.38.1" # needed since poetry chooses lower version of llvmlite which is not supported by python 3.9 above
tensorflow-io-gcs-filesystem = "0.34.0"
tensorflow-io-gcs-filesystem = "0.37.1"

[tool.poetry.group.test]
optional = true
Expand Down
25 changes: 3 additions & 22 deletions pkg/agent/storage/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,33 +131,14 @@ func (g *GCSObjectDownloader) DownloadFile(client stiface.Client, attrs *gstorag
log.Error(closeErr, "failed to close reader")
}
}(reader)
data, err := io.ReadAll(reader)
if err != nil {
return fmt.Errorf("failed to read object(%s) in bucket(%s): %w",
if _, err := io.Copy(file, reader); err != nil {
return fmt.Errorf(
"failed to copy object(%s) from bucket(%s) to file: %w",
attrs.Name,
attrs.Bucket,
err,
)
}
return g.WriteToFile(data, attrs, file)
}

func (g *GCSObjectDownloader) WriteToFile(data []byte, attrs *gstorage.ObjectAttrs, file *os.File) error {
_, err := file.Write(data)
if err != nil {
return fmt.Errorf("failed to write data to file(%s): from object(%s) in bucket(%s): %w",
file.Name(),
attrs.Name,
attrs.Bucket,
err,
)
}
defer func(file *os.File) {
closeErr := file.Close()
if closeErr != nil {
log.Error(closeErr, "failed to close file")
}
}(file)
log.Info("Wrote " + attrs.Prefix + " to file " + file.Name())
return nil
}
Loading

0 comments on commit 2d4f028

Please sign in to comment.