Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add torchserve custom server with pv storage #1182

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Torchserve with external storage

For running torchserve with external storage, the model archive files and config.properties should be copied to the storage.
jagadeeshi2i marked this conversation as resolved.
Show resolved Hide resolved

The storage mount to ```/mnt/models``` directory.

## Folder structure

```
├──config.properties
├── model-store
│   ├── mnist.mar
| ├── densenet161.mar
```

The entrypoint should be modified, to start torchserve with config.properties in ```/mnt/models``` path.

## Create the InferenceService

In the `torchserve-custom-pv.yaml` file edit the container image with your Docker image and add your pv storage.

Apply the CRD

```
kubectl apply -f torchserve-custom.yaml
jagadeeshi2i marked this conversation as resolved.
Show resolved Hide resolved
```

Expected Output

```
$ inferenceservice.serving.kubeflow.org/torchserve-custom created
jagadeeshi2i marked this conversation as resolved.
Show resolved Hide resolved
```
14 changes: 14 additions & 0 deletions docs/samples/custom/torchserve/torchserve-custom-pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: "serving.kubeflow.org/v1beta1"
kind: "InferenceService"
metadata:
name: "torchserve-custom-pv"
spec:
predictor:
containers:
- image: {username}/torchserve:latest
name: kfserving-container
ports:
- containerPort: 8080
jagadeeshi2i marked this conversation as resolved.
Show resolved Hide resolved
env:
- name: STORAGE_URI
value: "pvc://model-pv-claim" # The storage mounts to /mnt/models