forked from chroma-core/chroma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PERF]: use tilt test ci (chroma-core#1727)
## Description of changes *Summarize the changes made by this PR.* - Improvements & Bug fixes - Replace minikube by tilt to match local setup - Refactor workflow --------- Co-authored-by: nicolas <[email protected]>
- Loading branch information
Showing
6 changed files
with
91 additions
and
76 deletions.
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 |
---|---|---|
@@ -1,65 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
function cleanup { | ||
# Restore the previous kube context | ||
kubectl config use-context $PREV_CHROMA_KUBE_CONTEXT | ||
# Kill the tunnel process | ||
kill $TUNNEL_PID | ||
minikube delete -p chroma-test | ||
} | ||
|
||
trap cleanup EXIT | ||
|
||
# Save the current kube context into a variable | ||
export PREV_CHROMA_KUBE_CONTEXT=$(kubectl config current-context) | ||
|
||
# Create a new minikube cluster for the test | ||
minikube start -p chroma-test | ||
|
||
# Add the ingress addon to the cluster | ||
minikube addons enable ingress -p chroma-test | ||
minikube addons enable ingress-dns -p chroma-test | ||
|
||
# Setup docker to build inside the minikube cluster and build the image | ||
eval $(minikube -p chroma-test docker-env) | ||
docker build -t server:latest -f Dockerfile . | ||
docker build -t migration -f go/coordinator/Dockerfile.migration . | ||
docker build -t chroma-coordinator:latest -f go/coordinator/Dockerfile . | ||
docker build -t worker -f rust/worker/Dockerfile . --build-arg CHROMA_KUBERNETES_INTEGRATION=1 | ||
|
||
# Apply the kubernetes manifests | ||
kubectl apply -f k8s/deployment | ||
kubectl apply -f k8s/crd | ||
kubectl apply -f k8s/cr | ||
kubectl apply -f k8s/test | ||
|
||
# Wait for the pods in the chroma namespace to be ready | ||
kubectl wait --for=condition=complete --timeout=100s job/migration -n chroma | ||
kubectl delete job migration -n chroma | ||
kubectl wait --namespace chroma --for=condition=Ready pods --all --timeout=400s | ||
|
||
# Run mini kube tunnel in the background to expose the service | ||
minikube tunnel -c true -p chroma-test & | ||
TUNNEL_PID=$! | ||
|
||
# Wait for the tunnel to be ready. There isn't an easy way to check if the tunnel is ready. So we just wait for 10 seconds | ||
sleep 10 | ||
|
||
# TODO make url configuration consistent. | ||
export CHROMA_CLUSTER_TEST_ONLY=1 | ||
export CHROMA_SERVER_HOST=$(kubectl get svc server -n chroma -o=jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
export PULSAR_BROKER_URL=$(kubectl get svc pulsar-lb -n chroma -o=jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
export CHROMA_COORDINATOR_HOST=$(kubectl get svc coordinator-lb -n chroma -o=jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
export CHROMA_SERVER_HOST=localhost:8000 | ||
export PULSAR_BROKER_URL=localhost | ||
export CHROMA_COORDINATOR_HOST=localhost | ||
export CHROMA_SERVER_GRPC_PORT="50051" | ||
|
||
|
||
|
||
echo "Chroma Server is running at port $CHROMA_SERVER_HOST" | ||
echo "Pulsar Broker is running at port $PULSAR_BROKER_URL" | ||
echo "Chroma Coordinator is running at port $CHROMA_COORDINATOR_HOST" | ||
|
||
echo testing: python -m pytest "$@" | ||
python -m pytest "$@" | ||
kubectl -n chroma port-forward svc/coordinator 50051:50051 & | ||
kubectl -n chroma port-forward svc/pulsar 6650:6650 & | ||
kubectl -n chroma port-forward svc/pulsar 8080:8080 & | ||
kubectl -n chroma port-forward svc/server 8000:8000 & | ||
|
||
export CHROMA_KUBERNETES_INTEGRATION=1 | ||
cd go/coordinator | ||
go test -timeout 30s -run ^TestNodeWatcher$ github.com/chroma/chroma-coordinator/internal/memberlist_manager | ||
"$@" |
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