Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Dec 5, 2024
1 parent d193614 commit 7645d7a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ jobs:
#needs: unit-and-integration # No use in running e2e tests if integration tests fail.
strategy:
matrix:
testcase: ["quickstart", "openai-python-client", "autoscaler-restart", "cache-shared-filesystem"]
testcase:
- "quickstart"
- "openai-python-client"
- "autoscaler-restart"
- "cache-shared-filesystem"
- "engine-vllm-pvc"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ test-e2e-autoscaler-restart: skaffold
test-e2e-cache-shared-filesystem: skaffold
./test/e2e/run.sh cache-shared-filesystem --profile e2e-test-default

.PHONY: test-e2e-engine-vllm-pvc
test-e2e-engine-vllm-pvc: skaffold
./test/e2e/run.sh engine-vllm-pvc --profile e2e-test-default

.PHONY: test-e2e-engine
test-e2e-engine: skaffold
CACHE_PROFILE=$(CACHE_PROFILE) ./test/e2e/run.sh engine-$(ENGINE) --profile e2e-test-default
Expand Down
11 changes: 11 additions & 0 deletions test/e2e/engine-vllm-pvc/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: model-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
volumeName: kind-hostpath
30 changes: 30 additions & 0 deletions test/e2e/engine-vllm-pvc/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

source $REPO_DIR/test/e2e/common.sh

models_release="kubeai-models"

pip install -U "huggingface_hub[cli]"

PV_HOST_PATH=/tmp/data

huggingface-cli download facebook/opt-125m --local-dir ${PV_HOST_PATH} \
--exclude "tf_model.h5" --exclude "flax_model.msgpack"

kubectl apply -f - <<EOF
EOF

helm install $models_release $REPO_DIR/charts/models -f - <<EOF
catalog:
opt-125m-cpu:
enabled: true
url: pvc://model-pvc
minReplicas: 1
EOF

sleep 5

curl http://localhost:8000/openai/v1/completions \
--max-time 900 \
-H "Content-Type: application/json" \
-d '{"model": "opt-125m-cpu", "prompt": "Who was the first president of the United States?", "max_tokens": 40}'

0 comments on commit 7645d7a

Please sign in to comment.