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

Add integration test to CI workflow #620

Merged
merged 21 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/installation-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Installation Tests

on:
workflow_dispatch: # Allows manual trigger
push:
branches: [ "main" ]
paths:
Expand Down Expand Up @@ -79,7 +80,7 @@ jobs:
- name: Set up testing environment
run: |
# Set up the cluster with kind or other Kubernetes environment needed
kind create cluster --name installation-test
kind create cluster --name installation-test --config=./hack/kind_config.yaml
kubectl cluster-info --context kind-installation-test

- name: Load image into Kind
Expand All @@ -95,7 +96,7 @@ jobs:
kind load docker-image aibrix/${image}:${{ github.sha }} --name installation-test
kind load docker-image aibrix/${image}:nightly --name installation-test
done

- name: Deploy controller with the built image
run: |
kubectl create -k config/dependency
Expand All @@ -112,12 +113,21 @@ jobs:
docker build -t aibrix/vllm-mock:nightly -f Dockerfile .
kind load docker-image aibrix/vllm-mock:nightly --name installation-test
kubectl create -k config/mock

- name: Check pod status
run: |
sleep 60s
kubectl get pods --all-namespaces
kubectl wait pod --all --for=condition=ready --all-namespaces --timeout=300s


kubectl port-forward svc/llama2-7b 8000:8000 &
kubectl -n envoy-gateway-system port-forward service/envoy-aibrix-system-aibrix-eg-903790dc 8888:80 &

- name: Run e2e tests
run: |
kind get kubeconfig --name installation-test > /tmp/admin.conf
export KUBECONFIG=/tmp/admin.conf
make test-e2e

- name: Clean up
run: kind delete cluster --name installation-test
2 changes: 0 additions & 2 deletions hack/kind_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
1 change: 0 additions & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func TestBaseModelInferenceFailures(t *testing.T) {
}),
Model: openai.F(modelName),
})
assert.Contains(t, err.Error(), "500 Internal Server Error")
if err == nil {
t.Error("500 Internal Server Error expected for invalid api-key")
}
Expand Down
23 changes: 10 additions & 13 deletions test/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,25 @@ KIND_E2E=${KIND_E2E:-}
SKIP_KUBECTL_INSTALL=${SKIP_KUBECTL_INSTALL:-true}
SKIP_KIND_INSTALL=${SKIP_KIND_INSTALL:-true}
SKIP_INSTALL=${SKIP_INSTALL:-}
SET_KUBECONFIG=${SET_KUBECONFIG:-true}
SET_KUBECONFIG=${SET_KUBECONFIG:-}
INSTALL_AIBRIX=${INSTALL_AIBRIX:-}
KIND_SUDO=${KIND_SUDO:-}

# setup kind cluster
if [ -n "$KIND_E2E" ]; then
K8S_VERSION=${KUBERNETES_VERSION:-v1.32.0}
if [ -z "${SKIP_KUBECTL_INSTALL}" ]; then
curl -Lo kubectl https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
curl -Lo kubectl https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/
fi
if [ -z "${SKIP_KIND_INSTALL}" ]; then
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.26.0/kind-linux-amd64
chmod +x kind-linux-amd64
mv kind-linux-amd64 kind
export PATH=$PATH:$PWD
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.26.0/kind-linux-amd64
chmod +x kind-linux-amd64
mv kind-linux-amd64 kind
export PATH=$PATH:$PWD
fi

# If we did not set SKIP_INSTALL
if [ -z "$SKIP_INSTALL" ]; then
${KIND_SUDO} kind create cluster --image kindest/node:${K8S_VERSION} --config=./hack/kind_config.yaml
kind create cluster --image kindest/node:${K8S_VERSION} --config=./hack/kind_config.yaml
fi
fi

Expand All @@ -60,17 +59,15 @@ if [ -n "$INSTALL_AIBRIX" ]; then
kind load docker-image aibrix/metadata-service:nightly
kind load docker-image aibrix/runtime:nightly

# build and deploy mock-app
kubectl create -k config/dependency
kubectl create -k config/default

cd development/app
docker build -t aibrix/vllm-mock:nightly -f Dockerfile .
kind load docker-image aibrix/vllm-mock:nightly
kubectl create -k config/mock
cd ../..

# install crds and deploy aibrix components
kubectl create -k config/dependency
kubectl create -k config/default

kubectl port-forward svc/llama2-7b 8000:8000 &
kubectl -n envoy-gateway-system port-forward service/envoy-aibrix-system-aibrix-eg-903790dc 8888:80 &

Expand Down