Skip to content

Commit ae780e0

Browse files
authored
Chanege cluster for e2e to 4am (milvus-io#26253)
Signed-off-by: Bennu-Li <[email protected]>
1 parent 4c4b290 commit ae780e0

File tree

7 files changed

+361
-18
lines changed

7 files changed

+361
-18
lines changed

ci/jenkins/PR.groovy

+10-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ pipeline {
1717
}
1818
agent {
1919
kubernetes {
20-
inheritFrom 'milvus-e2e'
20+
cloud '4am'
21+
inheritFrom 'milvus-e2e-4am'
2122
defaultContainer 'main'
2223
yamlFile 'ci/jenkins/pod/rte-build.yaml'
2324
customWorkspace '/home/jenkins/agent/workspace'
@@ -42,7 +43,9 @@ pipeline {
4243
steps {
4344
container('main') {
4445
dir ('build'){
45-
sh './set_docker_mirror.sh'
46+
sh """
47+
MIRROR_URL="https://docker-nexus-ci.zilliz.cc" ./set_docker_mirror.sh
48+
"""
4649
}
4750
dir ('tests/scripts') {
4851
script {
@@ -96,7 +99,7 @@ pipeline {
9699
script {
97100
sh 'printenv'
98101
def clusterEnabled = "false"
99-
def valuesFile = "pr.yaml"
102+
def valuesFile = "pr-4am.yaml"
100103
if ("${MILVUS_SERVER_TYPE}".contains('distributed')) {
101104
clusterEnabled = "true"
102105
}
@@ -125,7 +128,7 @@ pipeline {
125128
chmod +x /usr/bin/yq
126129
'''
127130
sh """
128-
cp values/ci/pr.yaml values/ci/pr_kafka.yaml
131+
cp values/ci/pr-4am.yaml values/ci/pr_kafka.yaml
129132
yq -i '.pulsar.enabled=false' values/ci/pr_kafka.yaml
130133
yq -i '.kafka.enabled=true' values/ci/pr_kafka.yaml
131134
yq -i '.kafka.metrics.kafka.enabled=true' values/ci/pr_kafka.yaml
@@ -136,7 +139,7 @@ pipeline {
136139
withCredentials([usernamePassword(credentialsId: "${env.CI_DOCKER_CREDENTIAL_ID}", usernameVariable: 'CI_REGISTRY_USERNAME', passwordVariable: 'CI_REGISTRY_PASSWORD')]){
137140
sh """
138141
MILVUS_CLUSTER_ENABLED=${clusterEnabled} \
139-
MILVUS_HELM_REPO="http://nexus-nexus-repository-manager.nexus:8081/repository/milvus-proxy" \
142+
MILVUS_HELM_REPO="https://nexus-ci.zilliz.cc/repository/milvus-proxy" \
140143
TAG=${imageTag}\
141144
./e2e-k8s.sh \
142145
--skip-export-logs \
@@ -171,6 +174,7 @@ pipeline {
171174
}
172175
agent {
173176
kubernetes {
177+
cloud '4am'
174178
inheritFrom 'default'
175179
defaultContainer 'main'
176180
yamlFile 'ci/jenkins/pod/e2e.yaml'
@@ -196,7 +200,7 @@ pipeline {
196200
MILVUS_HELM_NAMESPACE="milvus-ci" \
197201
MILVUS_CLUSTER_ENABLED="${clusterEnabled}" \
198202
TEST_TIMEOUT="${e2e_timeout_seconds}" \
199-
./ci_e2e.sh "-n 6 -x --tags L0 L1 --timeout ${case_timeout_seconds}"
203+
./ci_e2e_4am.sh "-n 6 -x --tags L0 L1 --timeout ${case_timeout_seconds}"
200204
"""
201205

202206
} else {

ci/jenkins/pod/e2e.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ spec:
2323
volumes:
2424
- name: ci-logs
2525
nfs:
26-
path: /ci-logs
27-
server: 172.16.70.239
26+
path: /volume1/ci-logs
27+
# path: /volume1/4am-logs
28+
server: 172.16.70.249

ci/jenkins/pod/rte-build.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ spec:
6464
name: cgroup
6565
- name: ci-logs
6666
nfs:
67-
path: /ci-logs
68-
server: 172.16.70.239
67+
path: /volume1/ci-logs
68+
# path: /volume1/4am-logs
69+
server: 172.16.70.249

tests/scripts/ci-util-4am.sh

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
# Licensed to the LF AI & Data foundation under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
# Exit immediately for non zero status
20+
set -e
21+
# Check unset variables
22+
set -u
23+
# Print commands
24+
set -x
25+
26+
SOURCE="${BASH_SOURCE[0]}"
27+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
28+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
29+
SOURCE="$(readlink "$SOURCE")"
30+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
31+
done
32+
ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
33+
34+
35+
# Install pytest requirements
36+
function install_pytest_requirements(){
37+
echo "Install pytest requirements"
38+
cd ${ROOT}/tests/python_client
39+
40+
# MIRROR_HOST="${MIRROR_HOST:-nexus-nexus-repository-manager.nexus}"
41+
42+
43+
export PIP_TRUSTED_HOST="nexus-ci.zilliz.cc"
44+
export PIP_INDEX_URL="https://nexus-ci.zilliz.cc/repository/pypi-all/simple"
45+
export PIP_INDEX="https://nexus-ci.zilliz.cc/repository/pypi-all/pypi"
46+
export PIP_FIND_LINKS="https://nexus-ci.zilliz.cc/repository/pypi-all/pypi"
47+
python3 -m pip install --no-cache-dir -r requirements.txt --timeout 30 --retries 6
48+
}
49+
50+
# Login in ci docker registry
51+
function docker_login_ci_registry(){
52+
53+
if [[ -z "${CI_REGISTRY_USERNAME:-}" || -z "${CI_REGISTRY_PASSWORD:-}" ]]; then
54+
echo "Please setup docker credential for ci registry-${HUB}"
55+
else
56+
echo "docker login ci registry"
57+
docker login -u ${CI_REGISTRY_USERNAME} -p ${CI_REGISTRY_PASSWORD} ${HUB}
58+
fi
59+
}
60+

tests/scripts/ci_e2e_4am.sh

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/bash
2+
3+
# Licensed to the LF AI & Data foundation under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
SOURCE="${BASH_SOURCE[0]}"
20+
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
21+
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
22+
SOURCE="$(readlink "$SOURCE")"
23+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
24+
done
25+
ROOT="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
26+
27+
# Exit immediately for non zero status
28+
set -e
29+
# Check unset variables
30+
set -u
31+
# Print commands
32+
set -x
33+
34+
35+
36+
MILVUS_HELM_RELEASE_NAME="${MILVUS_HELM_RELEASE_NAME:-milvus-testing}"
37+
MILVUS_CLUSTER_ENABLED="${MILVUS_CLUSTER_ENABLED:-false}"
38+
MILVUS_HELM_NAMESPACE="${MILVUS_HELM_NAMESPACE:-default}"
39+
PARALLEL_NUM="${PARALLEL_NUM:-6}"
40+
# Use service name instead of IP to test
41+
MILVUS_SERVICE_NAME=$(echo "${MILVUS_HELM_RELEASE_NAME}-milvus.${MILVUS_HELM_NAMESPACE}" | tr -d '\n')
42+
MILVUS_SERVICE_PORT="19530"
43+
# Minio service name
44+
MINIO_SERVICE_NAME=$(echo "${MILVUS_HELM_RELEASE_NAME}-minio.${MILVUS_HELM_NAMESPACE}" | tr -d '\n')
45+
46+
47+
# Shellcheck source=ci-util.sh
48+
source "${ROOT}/tests/scripts/ci-util-4am.sh"
49+
50+
51+
cd ${ROOT}/tests/python_client
52+
53+
# Print python3 version, python version 3.6.8 is more stable for test
54+
python3 -V
55+
56+
# Pytest will try to get ${CI_LOG_PATH} from environment variables first,then use default path
57+
export CI_LOG_PATH=/tmp/ci_logs/test
58+
59+
if [ ! -d "${CI_LOG_PATH}" ]; then
60+
# Create dir for ci log path when it does not exist
61+
mkdir -p ${CI_LOG_PATH}
62+
fi
63+
64+
echo "prepare e2e test"
65+
install_pytest_requirements
66+
67+
68+
# Pytest is not able to have both --timeout & --workers, so do not add --timeout or --workers in the shell script
69+
if [[ -n "${TEST_TIMEOUT:-}" ]]; then
70+
71+
timeout "${TEST_TIMEOUT}" pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
72+
--html=${CI_LOG_PATH}/report.html --self-contained-html ${@:-}
73+
else
74+
pytest --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} \
75+
--html=${CI_LOG_PATH}/report.html --self-contained-html ${@:-}
76+
fi
77+
78+
# Run bulk insert test
79+
if [[ -n "${TEST_TIMEOUT:-}" ]]; then
80+
81+
timeout "${TEST_TIMEOUT}" pytest testcases/test_bulk_insert.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \
82+
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
83+
else
84+
pytest testcases/test_bulk_insert.py --host ${MILVUS_SERVICE_NAME} --port ${MILVUS_SERVICE_PORT} --minio_host ${MINIO_SERVICE_NAME} \
85+
--html=${CI_LOG_PATH}/report_bulk_insert.html --self-contained-html
86+
fi

tests/scripts/ci_logs.sh

+13-8
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,19 @@ if [[ ! -d ${RELEASE_LOG_DIR} ]] ;then
8787
fi
8888
# Try to found logs file from mount disk /volume1/ci-logs
8989
log_files=$(find ${LOG_DIR} -type f -name "*${RELEASE_NAME}*" )
90-
for log_file in ${log_files}
91-
do
92-
file_name=$(basename ${log_file})
93-
mv ${log_file} ${RELEASE_LOG_DIR}/`echo ${file_name} | sed 's/jenkins.var.log.containers.//g' `
94-
done
95-
96-
tar -zcvf ${ARTIFACTS_NAME:-artifacts}.tar.gz ${RELEASE_LOG_DIR}/*
97-
rm -rf ${RELEASE_LOG_DIR}
90+
91+
if [ -z "${log_files:-}" ]; then
92+
echo "No log files find"
93+
else
94+
for log_file in ${log_files}
95+
do
96+
file_name=$(basename ${log_file})
97+
mv ${log_file} ${RELEASE_LOG_DIR}/`echo ${file_name} | sed 's/jenkins.var.log.containers.//g' `
98+
done
99+
100+
tar -zcvf ${ARTIFACTS_NAME:-artifacts}.tar.gz ${RELEASE_LOG_DIR}/*
101+
rm -rf ${RELEASE_LOG_DIR}
102+
fi
98103

99104
remain_log_files=$(find ${LOG_DIR} -type f -name "*${RELEASE_NAME}*")
100105

0 commit comments

Comments
 (0)