-
Notifications
You must be signed in to change notification settings - Fork 110
195 lines (176 loc) · 9.33 KB
/
nightly_ci.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Nightly CI
on:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
- cron: '0 18 * * *'
jobs:
nightly-master:
name: Run Nightly CI(master)
runs-on: ubuntu-latest
timeout-minutes: 90
env:
IMAGE_REPO: "milvusdb/milvus"
TAG_PREFIX: "master-"
RELEASE_NAME: "go-test"
IMAGE_TAG: "master-latest"
QA_NAMESPACE: "qa"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Get the latest of Milvus dev image tag
shell: bash
id: extracter
working-directory: ci/scripts
run: |
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq --arg TAG_PREFIX "$TAG_PREFIX" -r '."results"[] | select(.images[].architecture == "amd64" and (.name | contains("gpu") | not) and (.name | startswith($TAG_PREFIX))) | .name' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"
- name: Create cluster
uses: helm/kind-action@v1.3.0
- name: Deploy milvus operator
shell: bash
run: |
kubectl get sc
helm install milvus-operator -n milvus-operator --create-namespace https://github.com/milvus-io/milvus-operator/releases/download/v0.6.9/milvus-operator-0.6.9.tgz
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=milvus-operator -n milvus-operator
kubectl get pods -n milvus-operator
- name: Install Milvus
shell: bash
working-directory: "ci/milvus-operator"
run: |
echo "IMAGE_REPO=$IMAGE_REPO, IMAGE_TAG=$IMAGE_TAG, RELEASE_NAME=$RELEASE_NAME"
kubectl create namespace ${QA_NAMESPACE}
envsubst < milvus-nightly.yaml | cat - | kubectl apply -f - -n ${QA_NAMESPACE}
kubectl -n ${QA_NAMESPACE} wait --for=condition=MilvusReady milvus/${RELEASE_NAME} --timeout 20m
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl describe milvus ${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl get pod -o wide -n ${QA_NAMESPACE} | grep -E "NAME|${RELEASE_NAME}"
kubectl get svc -n ${QA_NAMESPACE}
kubectl port-forward service/${RELEASE_NAME}-milvus 19530 -n ${QA_NAMESPACE} >/dev/null 2>&1 & sleep 10s
- name: Run Ci Test
shell: bash
working-directory: test/
run: |
nc -vz 127.0.0.1 19530
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.8.2/gotestsum_1.8.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
gotestsum --format testname --hide-summary=output ./testcases/... --tags L0,L1,L2,L3 --addr=127.0.0.1:19530 -timeout=60m
nightly-v2_3_x:
name: Run Nightly CI(v2.3.x)
runs-on: ubuntu-latest
timeout-minutes: 90
env:
IMAGE_REPO: "milvusdb/milvus"
TAG_PREFIX: "2.3-"
RELEASE_NAME: "go-test"
IMAGE_TAG: "2.3-latest"
QA_NAMESPACE: "qa"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "v2.3.x"
fetch-depth: '0'
- name: Get the latest of Milvus dev image tag
shell: bash
id: extracter
working-directory: ci/scripts
run: |
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq --arg TAG_PREFIX "$TAG_PREFIX" -r '."results"[] | select(.images[].architecture == "amd64" and (.name | contains("gpu") | not) and (.name | startswith($TAG_PREFIX))) | .name' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"
- name: Create cluster
uses: helm/kind-action@v1.3.0
- name: Deploy milvus operator
shell: bash
run: |
kubectl get sc
helm install milvus-operator -n milvus-operator --create-namespace https://github.com/milvus-io/milvus-operator/releases/download/v0.6.9/milvus-operator-0.6.9.tgz
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=milvus-operator -n milvus-operator
kubectl get pods -n milvus-operator
- name: Install Milvus
shell: bash
working-directory: "ci/milvus-operator"
run: |
echo "IMAGE_REPO=$IMAGE_REPO, IMAGE_TAG=$IMAGE_TAG, RELEASE_NAME=$RELEASE_NAME"
kubectl create namespace ${QA_NAMESPACE}
envsubst < milvus-nightly.yaml | cat - | kubectl apply -f - -n ${QA_NAMESPACE}
kubectl -n ${QA_NAMESPACE} wait --for=condition=MilvusReady milvus/${RELEASE_NAME} --timeout 20m
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl describe milvus ${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl get pod -o wide -n ${QA_NAMESPACE} | grep -E "NAME|${RELEASE_NAME}"
kubectl get svc -n ${QA_NAMESPACE}
kubectl port-forward service/${RELEASE_NAME}-milvus 19530 -n ${QA_NAMESPACE} >/dev/null 2>&1 & sleep 10s
- name: Run Ci Test
shell: bash
working-directory: test/
run: |
nc -vz 127.0.0.1 19530
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.8.2/gotestsum_1.8.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
gotestsum --format testname --hide-summary=output ./testcases/... --tags L0,L1,L2,L3 --addr=127.0.0.1:19530 -timeout=60m
nightly-v2_4_x:
name: Run Nightly CI(v2.4.x)
runs-on: ubuntu-latest
timeout-minutes: 90
env:
IMAGE_REPO: "milvusdb/milvus"
TAG_PREFIX: "2.4-"
RELEASE_NAME: "go-test"
IMAGE_TAG: "2.4-latest"
QA_NAMESPACE: "qa"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "master"
fetch-depth: '0'
- name: Get the latest of Milvus dev image tag
shell: bash
id: extracter
working-directory: ci/scripts
run: |
url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
echo "IMAGE_TAG=$(curl -s $url | jq --arg TAG_PREFIX "$TAG_PREFIX" -r '."results"[] | select(.images[].architecture == "amd64" and (.name | contains("gpu") | not) and (.name | startswith($TAG_PREFIX))) | .name' | head -n 1)" >> $GITHUB_ENV
# echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
# echo "::set-output name=tag::$(./docker_image_find_tag.sh -n ${IMAGE_REPO}/milvus-dev -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)"
- name: Create cluster
uses: helm/kind-action@v1.3.0
- name: Deploy milvus operator
shell: bash
run: |
kubectl get sc
helm install milvus-operator -n milvus-operator --create-namespace https://github.com/milvus-io/milvus-operator/releases/download/v0.6.9/milvus-operator-0.6.9.tgz
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=milvus-operator -n milvus-operator
kubectl get pods -n milvus-operator
- name: Install Milvus
shell: bash
working-directory: "ci/milvus-operator"
run: |
echo "IMAGE_REPO=$IMAGE_REPO, IMAGE_TAG=$IMAGE_TAG, RELEASE_NAME=$RELEASE_NAME"
kubectl create namespace ${QA_NAMESPACE}
envsubst < milvus-nightly.yaml | cat - | kubectl apply -f - -n ${QA_NAMESPACE}
kubectl -n ${QA_NAMESPACE} wait --for=condition=MilvusReady milvus/${RELEASE_NAME} --timeout 20m
kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl describe milvus ${RELEASE_NAME} -n ${QA_NAMESPACE}
kubectl get pod -o wide -n ${QA_NAMESPACE} | grep -E "NAME|${RELEASE_NAME}"
kubectl get svc -n ${QA_NAMESPACE}
kubectl port-forward service/${RELEASE_NAME}-milvus 19530 -n ${QA_NAMESPACE} >/dev/null 2>&1 & sleep 10s
- name: Run Ci Test
shell: bash
working-directory: test/
run: |
nc -vz 127.0.0.1 19530
curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.8.2/gotestsum_1.8.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
gotestsum --format testname --hide-summary=output ./testcases/... --tags L0,L1,L2,L3 --addr=127.0.0.1:19530 -timeout=60m