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

enable gmc e2e for manifests changes and some minor fix #87

Merged
merged 6 commits into from
Jun 11, 2024
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
11 changes: 6 additions & 5 deletions .github/workflows/go-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Golang E2e Tests
name: GMC E2e Tests

on:
pull_request:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
paths:
- microservices-connector/**
- manifests/**
workflow_dispatch:

# If there is a new commit, the previous jobs will be canceled
Expand Down Expand Up @@ -43,10 +44,10 @@ jobs:
make docker.build
make docker.push

- name: Install modules
- name: Install GMC
run: |
echo "should_cleanup=true" >> $GITHUB_ENV
.github/workflows/scripts/e2e/go_test.sh install_gmc
.github/workflows/scripts/e2e/gmc_test.sh install_gmc
exit_status=$$?$$
if [ $$exit_status -ne 0 ]; then
echo "Failed to install modules"
Expand All @@ -60,12 +61,12 @@ jobs:
if $skip_validate; then
echo "Skip validate"
else
.github/workflows/scripts/e2e/go_test.sh validate_gmc
.github/workflows/scripts/e2e/gmc_test.sh validate_gmc
fi

- name: Cleanup modules
if: always()
run: |
if $should_cleanup; then
.github/workflows/scripts/e2e/go_test.sh cleanup_gmc
.github/workflows/scripts/e2e/gmc_test.sh cleanup_gmc
fi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function install_gmc() {

# Wait until the gmc controller pod is ready
wait_until_pod_ready "gmc-controller" $SYSTEM_NAMESPACE "gmc-controller"
kubectl get pods -n $SYSTEM_NAMESPACE
}

function validate_gmc() {
Expand All @@ -42,20 +43,16 @@ function cleanup_gmc() {

function validate_chatqna() {

kubectl get pods -n $SYSTEM_NAMESPACE
# todo select gaudi or xeon
kubectl create ns $APP_NAMESPACE
sed -i "s|namespace: chatqa|namespace: $APP_NAMESPACE|g" $(pwd)/config/samples/chatQnA_xeon.yaml
kubectl apply -f $(pwd)/config/samples/chatQnA_xeon.yaml



output=$(kubectl get pods)
echo $output

# Wait until the router service is ready
echo "Waiting for the chatqa router service to be ready..."
wait_until_pod_ready "chatqna router" $APP_NAMESPACE "router-service"
output=$(kubectl get pods -n $APP_NAMESPACE)
echo $output

# Wait until the tgi pod is ready
TGI_POD_NAME=$(kubectl get pods --namespace=$APP_NAMESPACE | grep ^tgi-service | awk '{print $1}')
Expand All @@ -70,6 +67,7 @@ function validate_chatqna() {
wait_until_pod_ready "client-test" $APP_NAMESPACE "client-test"
# giving time to populating data
sleep 120

kubectl get pods -n $APP_NAMESPACE
# send request to chatqnA
export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
Expand Down Expand Up @@ -123,10 +121,9 @@ function init_gmc() {
find . -name '*.yaml' -type f -exec sed -i "s#default.svc#$APP_NAMESPACE.svc#g" {} \;
}


function wait_until_pod_ready() {
echo "Waiting for the $1 to be ready..."
max_retries=3000
max_retries=30
retry_count=0
while ! is_pod_ready $2 $3; do
if [ $retry_count -ge $max_retries ]; then
Expand All @@ -136,14 +133,7 @@ function wait_until_pod_ready() {
echo "$1 is not ready yet. Retrying in 10 seconds..."
sleep 10
output=$(kubectl get pods -n $2)
# Check if the command was successful
if [ $? -eq 0 ]; then
echo "Successfully retrieved $1 information:"
echo "$output"
else
echo "Failed to retrieve $1 information"
exit 1
fi
echo $output
retry_count=$((retry_count + 1))
done
}
Expand All @@ -161,8 +151,6 @@ function is_pod_ready() {
fi
}



if [ $# -eq 0 ]; then
echo "Usage: $0 <function_name>"
exit 1
Expand Down
Binary file modified microservices-connector/personas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading