forked from opendatahub-io/ai-gateway-payload-processing
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (129 loc) · 4.87 KB
/
Copy pathci-e2e.yaml
File metadata and controls
143 lines (129 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: CI - E2E Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
E2E_SIMULATOR_ENDPOINT: "3.147.232.199"
jobs:
check-changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout source
uses: actions/checkout@v7
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
id: filter
with:
filters: |
src:
- '**/*.go'
- Dockerfile
- Dockerfile.e2e
- Makefile
- go.mod
- go.sum
- go.work
- go.work.sum
- 'test/e2e/**'
- 'deploy/**'
- '.github/workflows/ci-e2e.yaml'
simulator-check:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
reachable: ${{ steps.check.outputs.reachable }}
steps:
- name: Check simulator connectivity
id: check
run: |
if nc -z -w 5 ${{ env.E2E_SIMULATOR_ENDPOINT }} 443 2>/dev/null; then
echo "Simulator is reachable"
echo "reachable=true" >> "$GITHUB_OUTPUT"
else
echo "Simulator is NOT reachable - E2E tests will be skipped"
echo "reachable=false" >> "$GITHUB_OUTPUT"
fi
e2e:
needs: [check-changes, simulator-check]
if: ${{ needs.check-changes.outputs.src == 'true' && needs.simulator-check.outputs.reachable == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
checks: write
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # main
with:
tool-cache: false
- name: Checkout source
uses: actions/checkout@v7
- name: Extract Go version from go.mod
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> "$GITHUB_ENV"
- name: Set up Go with cache
uses: actions/setup-go@v6
with:
go-version: "${{ env.GO_VERSION }}"
cache-dependency-path: ./go.sum
- name: Set up Kind cluster with Istio and BBR
run: make test-e2e-setup
- name: Debug - BBR pod args and status
if: always()
run: |
echo "=== BBR pod args ==="
kubectl get pod -n default -l app=payload-processing -o jsonpath='{.items[0].spec.containers[0].args}' 2>/dev/null | python3 -c "import json,sys; [print(a) for a in json.load(sys.stdin)]" || echo "Failed to get pod args"
echo ""
echo "=== BBR pod status ==="
kubectl get pods -n default -l app=payload-processing -o wide 2>/dev/null || true
echo ""
echo "=== ExternalModel CRD provider field ==="
kubectl get crd externalmodels.maas.opendatahub.io -o jsonpath='{.spec.versions[0].schema.openAPIV3Schema.properties.spec.properties.provider}' 2>/dev/null | python3 -m json.tool || true
- name: Run E2E tests with JUnit report
run: make test-e2e-junit
- name: Debug - BBR logs on failure
if: failure()
run: |
echo "=== BBR pod logs (last 50 lines) ==="
kubectl logs -n default -l app=payload-processing --tail=50 2>/dev/null || true
echo ""
echo "=== Gateway pod logs (last 20 lines) ==="
kubectl logs -n default -l gateway.networking.k8s.io/gateway-name=e2e-gateway --tail=20 2>/dev/null || true
echo ""
echo "=== ExternalModels in test namespace ==="
kubectl get externalmodels -n bbr-e2e -o wide 2>/dev/null || true
echo ""
echo "=== Services in test namespace ==="
kubectl get svc -n bbr-e2e -o wide 2>/dev/null || true
echo ""
echo "=== HTTPRoutes in test namespace ==="
kubectl get httproute -n bbr-e2e -o wide 2>/dev/null || true
echo ""
echo "=== Manual curl test for vertex-openai ==="
kubectl exec -n bbr-e2e curl -- curl -si --max-time 10 \
"http://e2e-gateway-istio.default.svc:80/bbr-e2e/e2e-vertex-openai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Connection: close" \
-d '{"model":"e2e-vertex-openai","messages":[{"role":"user","content":"debug"}]}' 2>/dev/null || true
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@v7
with:
name: e2e-junit-report
path: "**/results_e2e_xunit.xml"
if-no-files-found: warn
- name: Publish E2E test results
if: always()
uses: mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6
with:
report_paths: "**/results_e2e_xunit.xml"
check_name: E2E Test Results
fail_on_failure: true