-
Notifications
You must be signed in to change notification settings - Fork 266
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 framework to setup integration test #616
Merged
+247
−129
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a2d2db5
Add framework to setup integration test
varungup90 2538c1c
add simple base model inference test
varungup90 ffe47f9
nit spelling fix and add TestBaseModelInferenceFailures
varungup90 deaafcc
add make e2e test as a part of installation tests
varungup90 0659a3d
Undo running e2e as a part of CI
varungup90 e3f58d2
add middleware router for e2e test to append /v1 to the /chat/complet…
varungup90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
- role: worker | ||
- role: worker | ||
- role: worker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
To run e2e test, below are the options | ||
|
||
- Use KIND_E2E=true if kind cluster setup is required. | ||
- Use INSTAL_AIBRIX=true if installing aibrix components is required. | ||
|
||
KIND_E2E=true INSTAL_AIBRIX=true make test-e2e |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2024 The Aibrix Team. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
set -x | ||
set -o errexit | ||
set -o nounset | ||
|
||
# Set to empty if unbound/empty | ||
KIND_E2E=${KIND_E2E:-} | ||
SKIP_KUBECTL_INSTALL=${SKIP_KUBECTL_INSTALL:-true} | ||
SKIP_KIND_INSTALL=${SKIP_KIND_INSTALL:-true} | ||
SKIP_INSTALL=${SKIP_INSTALL:-} | ||
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/ | ||
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 | ||
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 | ||
fi | ||
fi | ||
|
||
kind get kubeconfig > /tmp/admin.conf | ||
export KUBECONFIG=/tmp/admin.conf | ||
|
||
# build images | ||
if [ -n "$INSTALL_AIBRIX" ]; then | ||
make docker-build-all | ||
kind load docker-image aibrix/controller-manager:nightly | ||
kind load docker-image aibrix/gateway-plugins:nightly | ||
kind load docker-image aibrix/metadata-service:nightly | ||
kind load docker-image aibrix/runtime:nightly | ||
|
||
# build and deploy mock-app | ||
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 & | ||
|
||
function cleanup { | ||
echo "Cleaning up..." | ||
# clean up env at end | ||
kubectl delete --ignore-not-found=true -k config/default | ||
kubectl delete --ignore-not-found=true -k config/dependency | ||
cd development/app | ||
kubectl delete -k config/mock | ||
cd ../.. | ||
} | ||
|
||
trap cleanup EXIT | ||
fi | ||
|
||
collect_logs() { | ||
echo "Collecting pods and logs" | ||
kubectl get pods -n aibrix-system | ||
|
||
for pod in $(kubectl get pods -n aibrix-system -o name); do | ||
echo "Logs for ${pod}" | ||
kubectl logs -n aibrix-system ${pod} | ||
done | ||
} | ||
|
||
trap "collect_logs" ERR | ||
|
||
go test ./test/e2e/ -v -timeout 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the endpoint for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on using openai-go official openai go library uses /chat/completion and v1/chat/completion is used by batch api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is kind of confusing. golang sdk hit different endpoints?
/chat/completion
this is openai not compatibleis there a detail problem on the golang sdk usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, this is api doc I found: https://github.com/openai/openai-go/blob/5b469242915f7e718c8bf94438080fec06fd6aa9/api.md?plain=1#L71
https://github.com/openai/openai-go/blob/5b469242915f7e718c8bf94438080fec06fd6aa9/chatcompletion.go#L119
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems they assume
v1
as part of theUrlBase
. final url is still v1/chat/completions? openai/openai-go#105If it does need
/chat/completions
, let document this part in the file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a middleware router to append /v1.