From 3c35cba93afbe18b136d4f2dd96c0321d795397f Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Fri, 7 Jul 2023 11:30:26 +0800 Subject: [PATCH] [cherry-pick][ci] Add standalone kafka e2e pipeline (#25122) Signed-off-by: zhuwenxing --- ci/jenkins/PR.groovy | 23 ++++++++++++++++++++--- tests/scripts/get_release_name.sh | 3 +++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ci/jenkins/PR.groovy b/ci/jenkins/PR.groovy index 03818e2b40..f7f44314b6 100644 --- a/ci/jenkins/PR.groovy +++ b/ci/jenkins/PR.groovy @@ -79,7 +79,7 @@ pipeline { axes { axis { name 'MILVUS_SERVER_TYPE' - values 'standalone', 'distributed' + values 'standalone', 'distributed', 'standalone-kafka' } axis { name 'MILVUS_CLIENT' @@ -96,7 +96,7 @@ pipeline { script { sh 'printenv' def clusterEnabled = "false" - if ("${MILVUS_SERVER_TYPE}" == 'distributed') { + if ("${MILVUS_SERVER_TYPE}".contains('distributed')) { clusterEnabled = "true" } sh 'git config --global --add safe.directory /home/jenkins/agent/workspace' @@ -113,6 +113,23 @@ pipeline { } } } + // modify values file to enable kafka + if ("${MILVUS_SERVER_TYPE}".contains("kafka")) { + sh ''' + apt-get update + apt-get install wget -y + wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O /usr/bin/yq + chmod +x /usr/bin/yq + ''' + sh """ + + yq -i '.pulsar.enabled=false' values/ci/pr.yaml + yq -i '.kafka.enabled=true' values/ci/pr.yaml + yq -i '.kafka.metrics.kafka.enabled=true' values/ci/pr.yaml + yq -i '.kafka.metrics.jmx.enabled=true' values/ci/pr.yaml + yq -i '.kafka.metrics.serviceMonitor.enabled=true' values/ci/pr.yaml + """ + } withCredentials([usernamePassword(credentialsId: "${env.CI_DOCKER_CREDENTIAL_ID}", usernameVariable: 'CI_REGISTRY_USERNAME', passwordVariable: 'CI_REGISTRY_PASSWORD')]){ sh """ MILVUS_CLUSTER_ENABLED=${clusterEnabled} \ @@ -167,7 +184,7 @@ pipeline { script { def release_name=sh(returnStdout: true, script: './get_release_name.sh') def clusterEnabled = 'false' - if ("${MILVUS_SERVER_TYPE}" == "distributed") { + if ("${MILVUS_SERVER_TYPE}".contains("distributed")) { clusterEnabled = "true" } if ("${MILVUS_CLIENT}" == "pymilvus") { diff --git a/tests/scripts/get_release_name.sh b/tests/scripts/get_release_name.sh index b9bc2213a3..e6477eaadb 100755 --- a/tests/scripts/get_release_name.sh +++ b/tests/scripts/get_release_name.sh @@ -31,6 +31,9 @@ function milvus_ci_release_name(){ elif [[ "${MILVUS_SERVER_TYPE:-}" == "distributed-kafka" ]]; then # Distributed kafka mode name+="dk" + elif [[ "${MILVUS_SERVER_TYPE:-}" == "standalone-kafka" ]]; then + # Standalone kafka mode + name+="sk" elif [[ "${MILVUS_SERVER_TYPE:-}" == "distributed" ]]; then # Distributed mode name+="d"