-
Notifications
You must be signed in to change notification settings - Fork 52
134 lines (119 loc) · 4.07 KB
/
tests.yml
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
name: Tests
run-name: Run tests by @${{ github.actor }}
on:
push:
branches:
- main
pull_request:
jobs:
unit-and-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run unit tests
run: make test-unit
- name: Run integration tests
run: make test-integration
e2e-gpu:
runs-on: ubuntu-latest
strategy:
matrix:
testcase:
- "engine-vllm-adapters"
# Timeout to address Github actions stuck scenarios.
timeout-minutes: 60
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
# This is required to push the image to the container registry.
permissions:
contents: read
packages: write
env:
TEST_KUBECONFIG: ${{ secrets.TEST_KUBECONFIG }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set kubeconfig to point to GPU cluster
run: |
base64 -d <<< $TEST_KUBECONFIG > /tmp/kubeconfig
echo "KUBECONFIG=/tmp/kubeconfig" >> $GITHUB_ENV
- name: Create and change namespace
run: |
NAMESPACE=kubeai-${{ github.run_id }}
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
echo "NAMESPACE=$namespace" >> $GITHUB_ENV
- name: Run the e2e testcase
run: make test-e2e-${{ matrix.testcase }}
env:
USE_GPU_CLUSTER: "true"
SKAFFOLD_DEFAULT_REPO: "ghcr.io/substratusai"
- name: Delete namespace
if: always()
run: |
kubectl delete namespace $NAMESPACE
e2e-general:
runs-on: ubuntu-latest
# NOTE: Uncomment if we start getting limited on number of concurrent jobs
# (due to rapid pushes, etc).
#needs: unit-and-integration # No use in running e2e tests if integration tests fail.
strategy:
matrix:
testcase:
- "quickstart"
- "openai-python-client"
- "autoscaler-restart"
- "cache-shared-filesystem"
- "engine-vllm-pvc"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Install helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Start kind cluster
run: kind create cluster
- name: Run the e2e testcase
run: make test-e2e-${{ matrix.testcase }}
e2e-engines:
runs-on: ubuntu-latest
# NOTE: Uncomment if we start getting limited on number of concurrent jobs
# (due to rapid pushes, etc).
#needs: unit-and-integration # No use in running e2e tests if integration tests fail.
strategy:
matrix:
engine: ["FasterWhisper"] # "VLLM", "Infinity", "OLlama"
# Run each test case with and without caching.
cacheProfile: ["", "e2e-test-kind-pv"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Install helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
- name: Start kind cluster
run: kind create cluster
- name: Run the e2e testcase
run: make test-e2e-engine ENGINE=${{ matrix.engine }} CACHE_PROFILE=${{ matrix.cacheProfile }}