Skip to content

Commit

Permalink
Add storage container docs (#294)
Browse files Browse the repository at this point in the history
* Add storage container docs

Signed-off-by: greenmoon55 <[email protected]>

* Update storage container doc

Signed-off-by: greenmoon55 <[email protected]>

* Move doc to Model Storage section

Signed-off-by: greenmoon55 <[email protected]>

* Update docs/modelserving/storage/storagecontainers.md

Signed-off-by: Dan Sun <[email protected]>

* Add warning section

Signed-off-by: Dan Sun <[email protected]>

* Update storagecontainers.md

Signed-off-by: Dan Sun <[email protected]>

---------

Signed-off-by: greenmoon55 <[email protected]>
Signed-off-by: Dan Sun <[email protected]>
Co-authored-by: Dan Sun <[email protected]>
  • Loading branch information
greenmoon55 and yuzisun authored Oct 14, 2023
1 parent abdc5bd commit 74693a7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
64 changes: 64 additions & 0 deletions docs/modelserving/storage/storagecontainers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Storage Containers

KServe downloads models using a storage initializer (initContainer). For example, this is [the default storage initializer implementation](https://github.com/kserve/kserve/blob/79f2a48d0c9c72b034127170e38d6b29b927f03a/python/kserve/kserve/storage/storage.py). KServe introduced **ClusterStorageContainer** CRD in 0.11 which allows users to specify a custom container spec for a list of supported URI formats.

A _ClusterStorageContainer_ defines the container spec for one or more storage URI formats. Here is an example of a ClusterStorageContainer that corresponds to the default storage initializer. Note that this is incluced in the [helm chart](https://github.com/kserve/kserve/blob/79f2a48d0c9c72b034127170e38d6b29b927f03a/charts/kserve-resources/templates/clusterstoragecontainer.yaml).

```yaml
apiVersion: "serving.kserve.io/v1alpha1"
kind: ClusterStorageContainer
metadata:
name: default
spec:
container:
name: storage-initializer
image: kserve/storage-initializer:latest
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1Gi
cpu: "1"
supportedUriFormats:
- prefix: gs://
- prefix: s3://
- prefix: hdfs://
- prefix: webhdfs://
- regex: "https://(.+?).blob.core.windows.net/(.+)"
- regex: "https://(.+?).file.core.windows.net/(.+)"
- regex: "https?://(.+)/(.+)"
```
In a _ClusterStorageContainer_ spec, you can specify container resource requests and limits, and a list of supported URI formats that this image supports. KServe can match the URI either with `prefix` or `regex` .

!!! warning

If a storage URI is supported by two or more _ClusterStorageContainer_ CRs, there is no guarantee which one will be used. **Please make sure that the URI format is only supported by one ClusterStorageContainer CR**.


If you would like to use a custom protocol `model-registry://`, for example, you can create a custom image and add a new ClusterStorageContainer CR like this:

```yaml
apiVersion: "serving.kserve.io/v1alpha1"
kind: ClusterStorageContainer
metadata:
name: abc
spec:
container:
name: storage-initializer
image: abc/custom-storage-initializer:latest
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 1Gi
cpu: "1"
supportedUriFormats:
- prefix: model-registry://
```

## Spec Attributes

Spec attributes are in [API Reference](/website/reference/api/#serving.kserve.io/v1alpha1.ClusterStorageContainer) doc.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ nav:
- Concept: modelserving/inference_graph/README.md
- Image classification inference graph: modelserving/inference_graph/image_pipeline/README.md
- Model Storage:
- Storage Containers: modelserving/storage/storagecontainers.md
- Azure: modelserving/storage/azure/azure.md
- PVC: modelserving/storage/pvc/pvc.md
- S3: modelserving/storage/s3/s3.md
Expand Down

0 comments on commit 74693a7

Please sign in to comment.