-
Notifications
You must be signed in to change notification settings - Fork 109
159 lines (147 loc) · 8.34 KB
/
helm-integration-test-console.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Helm Integration Test Reusable (console)
on:
workflow_call:
inputs:
target:
required: true
type: string
jobs:
helm-integration-test-console:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
overprovision-lvm: "true"
remove-dotnet: "true"
build-mount-path: "/var/lib/docker/"
- name: Setup Minikube
run: |
sudo service docker restart
minikube start --cpus 3 --memory 8192
- name: Checkout repo and load .env
uses: actions/checkout@v4
with:
repository: instill-ai/instill-core
- name: Load .env file
uses: cardinalby/export-env-action@v2
with:
envFile: .env
- name: Launch Helm Instill Core (${{ inputs.target }})
run: |
if [ "${{ inputs.target }}" == "latest" ]; then
helm install core charts/core --namespace instill-ai --create-namespace \
--set edition=k8s-ce:test \
--set artifactBackend.image.tag=latest \
--set apiGateway.image.tag=latest \
--set mgmtBackend.image.tag=latest \
--set pipelineBackend.image.tag=latest \
--set modelBackend.image.tag=latest \
--set console.image.tag=latest \
--set rayService.image.tag=latest \
--set rayService.headGroupSpec.resources.limits.cpu=0 \
--set rayService.headGroupSpec.resources.limits.memory=2Gi \
--set rayService.headGroupSpec.resources.requests.cpu=0 \
--set rayService.headGroupSpec.resources.requests.memory=2Gi \
--set rayService.workerGroupSpecs[0].replicas=1 \
--set rayService.workerGroupSpecs[0].minReplicas=1 \
--set rayService.workerGroupSpecs[0].maxReplicas=1 \
--set rayService.workerGroupSpecs[0].groupName=test-group \
--set rayService.workerGroupSpecs[0].gpuWorkerGroup.enabled=false \
--set rayService.workerGroupSpecs[0].resources.limits.cpu=1 \
--set rayService.workerGroupSpecs[0].resources.limits.memory=2Gi \
--set rayService.workerGroupSpecs[0].resources.requests.cpu=1 \
--set rayService.workerGroupSpecs[0].resources.requests.memory=2Gi \
--set milvus.broker.resources.requests.cpu=0.25 \
--set milvus.autorecovery.resources.requests.cpu=0.25 \
--set milvus.proxy.resources.requests.cpu=0.25 \
--set tags.observability=false \
--set tags.prometheusStack=false
else
helm install core charts/core --namespace instill-ai --create-namespace \
--set edition=k8s-ce:test \
--set artifactBackend.image.tag=${ARTIFACT_BACKEND_VERSION} \
--set apiGateway.image.tag=${API_GATEWAY_VERSION} \
--set mgmtBackend.image.tag=${MGMT_BACKEND_VERSION} \
--set mgmtBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \
--set pipelineBackend.image.tag=${PIPELINE_BACKEND_VERSION} \
--set pipelineBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \
--set modelBackend.instillCoreHost=http://${INSTILL_CORE_HOST}:${API_GATEWAY_PORT} \
--set modelBackend.image.tag=${MODEL_BACKEND_VERSION} \
--set console.image.tag=${CONSOLE_VERSION} \
--set rayService.image.tag=${RAY_SERVER_VERSION} \
--set rayService.headGroupSpec.resources.limits.cpu=0 \
--set rayService.headGroupSpec.resources.limits.memory=2Gi \
--set rayService.headGroupSpec.resources.requests.cpu=0 \
--set rayService.headGroupSpec.resources.requests.memory=2Gi \
--set rayService.workerGroupSpecs[0].replicas=1 \
--set rayService.workerGroupSpecs[0].minReplicas=1 \
--set rayService.workerGroupSpecs[0].maxReplicas=1 \
--set rayService.workerGroupSpecs[0].groupName=test-group \
--set rayService.workerGroupSpecs[0].gpuWorkerGroup.enabled=false \
--set rayService.workerGroupSpecs[0].resources.limits.cpu=1 \
--set rayService.workerGroupSpecs[0].resources.limits.memory=2Gi \
--set rayService.workerGroupSpecs[0].resources.requests.cpu=1 \
--set rayService.workerGroupSpecs[0].resources.requests.memory=2Gi \
--set milvus.broker.resources.requests.cpu=0.25 \
--set milvus.autorecovery.resources.requests.cpu=0.25 \
--set milvus.proxy.resources.requests.cpu=0.25 \
--set tags.observability=false \
--set tags.prometheusStack=false
fi
- name: Wait for all pods up
run: |
while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do
echo "$(kubectl get pods --namespace instill-ai)"
sleep 10
done
while [[ $(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=model-backend,app.kubernetes.io/instance=core" -o 'jsonpath={..status.phase}') != *"Running"* ]]; do
echo "$(kubectl get pods --namespace instill-ai)"
sleep 10
done
echo "$(kubectl get pods --namespace instill-ai)"
- name: Port-forward of core api-gateway and console
run: |
API_GATEWAY_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=api-gateway,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name')
kubectl --namespace instill-ai port-forward ${API_GATEWAY_POD_NAME} ${API_GATEWAY_PORT}:${API_GATEWAY_PORT} > /dev/null 2>&1 &
CONSOLE_POD_NAME=$(kubectl get pods --namespace instill-ai -l "app.kubernetes.io/component=console,app.kubernetes.io/instance=core" -o json | jq -r '.items[0].metadata.name')
kubectl --namespace instill-ai port-forward ${CONSOLE_POD_NAME} ${CONSOLE_PORT}:${CONSOLE_PORT} > /dev/null 2>&1 &
while ! nc -vz localhost ${API_GATEWAY_PORT} > /dev/null 2>&1; do sleep 5; done
while ! nc -vz localhost ${CONSOLE_PORT} > /dev/null 2>&1; do sleep 5; done
- name: Run console integration test (${{ inputs.target }})
run: |
if [ "${{ inputs.target }}" == "latest" ]; then
git clone https://github.com/instill-ai/console.git
cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:latest .
else
git clone -b v$CONSOLE_VERSION https://github.com/instill-ai/console.git
cd console && docker build --build-arg TEST_USER='root' -f Dockerfile.playwright -t console-playwright:${{ env.CONSOLE_VERSION }} .
fi
docker run -t \
-e NEXT_PUBLIC_GENERAL_API_VERSION=v1beta \
-e NEXT_PUBLIC_MODEL_API_VERSION=v1alpha \
-e NEXT_PUBLIC_CONSOLE_EDITION=k8s-ce:test \
-e NEXT_PUBLIC_CONSOLE_BASE_URL=http://localhost:${CONSOLE_PORT} \
-e NEXT_PUBLIC_API_GATEWAY_URL=http://localhost:${API_GATEWAY_PORT} \
-e NEXT_SERVER_API_GATEWAY_URL=http://localhost:${API_GATEWAY_PORT} \
-e NEXT_PUBLIC_SELF_SIGNED_CERTIFICATION=false \
-e NEXT_PUBLIC_INSTILL_AI_USER_COOKIE_NAME=instill-ai-user \
--network host \
--entrypoint ./entrypoint-playwright.sh \
--name core-console-integration-test-${{ inputs.target }} \
console-playwright:${{ inputs.target == 'latest' && 'latest' || env.CONSOLE_VERSION }}
- name: Copy the test-result to host
if: always()
run: docker cp core-console-integration-test-${{ inputs.target }}:/app/apps/console/test-results ./test-results
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: helm-integration-test-${{ inputs.target }}-linux-test-results
path: test-results
retention-days: 1
- name: Stop and remove console playwright
run: |
docker stop core-console-integration-test-${{ inputs.target }}
docker rm core-console-integration-test-${{ inputs.target }}