-
Notifications
You must be signed in to change notification settings - Fork 29
99 lines (83 loc) · 3 KB
/
test-kubernetes.yaml
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
name: kubernetes-test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
permissions: read-all
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# need containerd image store for testing local images
- uses: crazy-max/ghaction-setup-docker@d9be6cade441568ba10037bce5221b8f564981f1 # v3.0.0
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
- name: build aikit
run: |
docker buildx build . -t aikit:test \
--load --progress plain \
--cache-from=type=gha,scope=aikit \
--cache-to=type=gha,scope=aikit,mode=max
- name: build test model
run: |
docker buildx build . -t testmodel:test \
-f test/aikitfile-llama.yaml \
--load --progress plain \
--cache-from=type=gha,scope=testmodel \
--cache-to=type=gha,scope=testmodel,mode=max
- name: list images
run: docker images
- name: install e2e dependencies
run: make test-e2e-dependencies
- name: create kind cluster
run: kind create cluster --wait 5m
- name: load test model image into kind cluster
run: kind load docker-image testmodel:test
- name: deploy test model
run: |
kubectl create deployment test-model-deployment --image=testmodel:test --replicas 1
kubectl rollout status deployment test-model-deployment
kubectl expose deployment test-model-deployment --port=8080 --target-port=8080 --name=test-model-service
kubectl port-forward service/test-model-service 8080:8080 &
- name: run test
run: |
curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "llama-2-7b-chat", "messages": [{"role": "user", "content": "explain kubernetes in a sentence"}]}'
- name: save logs
if: always()
run: |
echo "KIND_LOGS_PATH=$(kind export logs)" >> $GITHUB_ENV
- name: publish logs
if: always()
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: kind-logs
path: ${KIND_LOGS_PATH}