Skip to content

Commit

Permalink
Merge branch 'master' into release_0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lxning committed Jul 29, 2021
2 parents cad4b35 + cdca64c commit 3afb15f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
20 changes: 14 additions & 6 deletions kubernetes/kfserving/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,29 @@ Currently, KFServing supports the Inference API for all the existing models but

### Docker Image Building

For CPU Image
* To create a CPU based image

```
docker build -t pytorch/torchserve-kfs:latest .
./build_image.sh
```

For GPU Image
* To create a CPU based image with custom tag

```
docker build --build-arg BASE_IMAGE=pytorch/torchserve:latest-gpu -t pytorch/torchserve-kfs:latest-gpu .
./build_image.sh -t <repository>/<image>:<tag>
```

Push image to repository
* To create a GPU based image

```
docker push pytorch/torchserve-kfs:latest
./build_image.sh -g
```

* To create a GPU based image with custom tag

```
./build_image.sh -g -t <repository>/<image>:<tag>
```

Individual Readmes for KFServing :

Expand Down
29 changes: 29 additions & 0 deletions kubernetes/kfserving/build_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

DOCKER_TAG="pytorch/torchserve-kfs:latest"
BASE_IMAGE="pytorch/torchserve:latest"

for arg in "$@"
do
case $arg in
-h|--help)
echo "options:"
echo "-h, --help show brief help"
echo "-g, --gpu specify for gpu build"
echo "-t, --tag specify tag name for docker image"
exit 0
;;
-g|--gpu)
DOCKER_TAG="pytorch/torchserve-kfs:latest-gpu"
BASE_IMAGE="pytorch/torchserve:latest-gpu"
shift
;;
-t|--tag)
DOCKER_TAG="$2"
shift
shift
;;
esac
done

DOCKER_BUILDKIT=1 docker build --file Dockerfile --build-arg BASE_IMAGE=$BASE_IMAGE -t "$DOCKER_TAG" .

0 comments on commit 3afb15f

Please sign in to comment.