Skip to content

Commit

Permalink
[skip ci] update benchmark scripts on 0.10.4 (#4213)
Browse files Browse the repository at this point in the history
* [skip ci] update ci/jenkinsfile to 0.10.4

Signed-off-by: zw <[email protected]>

* [skip ci] update version in test case

Signed-off-by: zw <[email protected]>

* [skip ci] update benchmark scripts

Signed-off-by: zw <[email protected]>

* [skip ci] add comments in scripts

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

* [skip ci] fix style in benchmark

Signed-off-by: zw <[email protected]>

Co-authored-by: zw <[email protected]>
  • Loading branch information
del-zhenwu and zw authored Dec 1, 2020
1 parent bf5fdc3 commit de0669f
Show file tree
Hide file tree
Showing 44 changed files with 1,976 additions and 658 deletions.
8 changes: 4 additions & 4 deletions tests/milvus_benchmark/ci/jenkinsfile/cleanup.groovy
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
try {
def result = sh script: "helm status benchmark-test-${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true
def result = sh script: "helm status -n milvus ${env.HELM_RELEASE_NAME}", returnStatus: true
if (!result) {
sh "helm del --purge benchmark-test-${env.JOB_NAME}-${env.BUILD_NUMBER}"
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
}
} catch (exc) {
def result = sh script: "helm status benchmark-test-${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true
def result = sh script: "helm status -n milvus ${env.HELM_RELEASE_NAME}", returnStatus: true
if (!result) {
sh "helm del --purge benchmark-test-${env.JOB_NAME}-${env.BUILD_NUMBER}"
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
}
throw exc
}
Expand Down
13 changes: 13 additions & 0 deletions tests/milvus_benchmark/ci/jenkinsfile/cleanupShards.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
try {
def result = sh script: "helm status -n milvus ${env.HELM_SHARDS_RELEASE_NAME}", returnStatus: true
if (!result) {
sh "helm uninstall -n milvus ${env.HELM_SHARDS_RELEASE_NAME}"
}
} catch (exc) {
def result = sh script: "helm status -n milvus ${env.HELM_SHARDS_RELEASE_NAME}", returnStatus: true
if (!result) {
sh "helm uninstall -n milvus ${env.HELM_SHARDS_RELEASE_NAME}"
}
throw exc
}

21 changes: 21 additions & 0 deletions tests/milvus_benchmark/ci/jenkinsfile/deploy_shards_test.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
timeout(time: 12, unit: 'HOURS') {
try {
dir ("milvus-helm") {
// sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
// sh 'helm repo update'
checkout([$class: 'GitSCM', branches: [[name: "${HELM_BRANCH}"]], userRemoteConfigs: [[url: "${HELM_URL}", name: 'origin', refspec: "+refs/heads/${HELM_BRANCH}:refs/remotes/origin/${HELM_BRANCH}"]]])
}
dir ("milvus_benchmark") {
print "Git clone url: ${TEST_URL}:${TEST_BRANCH}"
checkout([$class: 'GitSCM', branches: [[name: "${TEST_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "${TEST_URL}", name: 'origin', refspec: "+refs/heads/${TEST_BRANCH}:refs/remotes/origin/${TEST_BRANCH}"]]])
print "Install requirements"
// sh "python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com"
sh "python3 -m pip install -r requirements.txt"
sh "python3 -m pip install git+${TEST_LIB_URL}"
sh "python3 main.py --image-version=${params.IMAGE_VERSION} --schedule-conf=scheduler/${params.SHARDS_CONFIG_FILE} --deploy-mode=${params.DEPLOY_MODE}"
}
} catch (exc) {
echo 'Deploy SHARDS Test Failed !'
throw exc
}
}
36 changes: 17 additions & 19 deletions tests/milvus_benchmark/ci/jenkinsfile/deploy_test.groovy
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
timeout(time: 4000, unit: 'MINUTES') {
try {
dir ("milvus-helm") {
// sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
// sh 'helm repo update'
checkout([$class: 'GitSCM', branches: [[name: "${HELM_BRANCH}"]], userRemoteConfigs: [[url: "${HELM_URL}", name: 'origin', refspec: "+refs/heads/${HELM_BRANCH}:refs/remotes/origin/${HELM_BRANCH}"]]])
}
dir ("milvus_benchmark") {
print "Git clone url: ${TEST_URL}:${TEST_BRANCH}"
checkout([$class: 'GitSCM', branches: [[name: "${TEST_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "${TEST_URL}", name: 'origin', refspec: "+refs/heads/${TEST_BRANCH}:refs/remotes/origin/${TEST_BRANCH}"]]])
print "Install requirements"
// sh "python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com"
sh "python3 -m pip install -r requirements.txt"
sh "python3 -m pip install git+${TEST_LIB_URL}"
sh "python3 main.py --image-version=${params.IMAGE_VERSION} --schedule-conf=scheduler/${params.CONFIG_FILE}"
}
} catch (exc) {
echo 'Deploy Test Failed !'
throw exc
try {
dir ("milvus-helm") {
// sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
// sh 'helm repo update'
checkout([$class: 'GitSCM', branches: [[name: "${HELM_BRANCH}"]], userRemoteConfigs: [[url: "${HELM_URL}", name: 'origin', refspec: "+refs/heads/${HELM_BRANCH}:refs/remotes/origin/${HELM_BRANCH}"]]])
}
dir ("milvus_benchmark") {
print "Git clone url: ${TEST_URL}:${TEST_BRANCH}"
checkout([$class: 'GitSCM', branches: [[name: "${TEST_BRANCH}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "${TEST_URL}", name: 'origin', refspec: "+refs/heads/${TEST_BRANCH}:refs/remotes/origin/${TEST_BRANCH}"]]])
print "Install requirements"
// sh "python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com"
sh "python3 -m pip install -r requirements.txt"
sh "python3 -m pip install git+${TEST_LIB_URL}"
sh "python3 main.py --image-version=${params.IMAGE_VERSION} --schedule-conf=scheduler/${params.CONFIG_FILE} --deploy-mode=${params.DEPLOY_MODE}"
}
} catch (exc) {
echo 'Deploy Test Failed !'
throw exc
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
timeout(time: 15, unit: 'MINUTES') {
timeout(time: 30, unit: 'MINUTES') {
def imageName = "milvus/engine:${DOCKER_VERSION}"
def remoteImageName = "milvusdb/daily-build:${REMOTE_DOCKER_VERSION}"
def localDockerRegistryImage = "${params.LOCAL_DOKCER_REGISTRY_URL}/${imageName}"
Expand Down
42 changes: 22 additions & 20 deletions tests/milvus_benchmark/ci/main_jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ pipeline {
}

parameters{
string defaultValue: 'master', description: 'server image version', name: 'IMAGE_VERSION', trim: true
string defaultValue: '080_data.json', description: 'test suite config yaml', name: 'CONFIG_FILE', trim: true
string defaultValue: '0.10.4', description: 'server image version', name: 'IMAGE_VERSION', trim: true
choice choices: ['single', 'shards'], description: 'server deploy mode', name: 'DEPLOY_MODE'
string defaultValue: '010_data.json', description: 'test suite config yaml', name: 'CONFIG_FILE', trim: true
string defaultValue: 'shards.json', description: 'shards test suite config yaml', name: 'SHARDS_CONFIG_FILE', trim: true
string defaultValue: '09509e53-9125-4f5d-9ce8-42855987ad67', description: 'git credentials', name: 'GIT_USER', trim: true
}

environment {
HELM_URL = "https://github.com/milvus-io/milvus-helm.git"
HELM_BRANCH = "master"
HELM_BRANCH = "0.10.3"
TEST_URL = "[email protected]:Test/milvus_benchmark.git"
TEST_BRANCH = "master"
TEST_BRANCH = "0.10.4"
TEST_LIB_URL = "http://192.168.1.105:6060/Test/milvus_metrics.git"
HELM_RELEASE_NAME = "milvus-benchmark-test-${env.BUILD_NUMBER}"
HELM_SHARDS_RELEASE_NAME = "milvus-shards-benchmark-test-${env.BUILD_NUMBER}"
}

stages {
Expand All @@ -35,7 +39,7 @@ pipeline {
spec:
containers:
- name: milvus-test-env
image: registry.zilliz.com/milvus/milvus-test-env:v0.2
image: registry.zilliz.com/milvus/milvus-test-env:v0.3
command:
- cat
tty: true
Expand Down Expand Up @@ -82,7 +86,8 @@ pipeline {
script {
boolean isNightlyTest = isTimeTriggeredBuild()
if (isNightlyTest) {
build job: 'milvus-publish-daily-docker', wait: false
// build job: 'milvus-publish-daily-docker', parameters: [[$class: 'StringParameterValue', name: 'BRANCH', value: "${params.IMAGE_VERSION}"]], wait: false
build job: 'milvus-publish-daily-docker', parameters: [string(name: 'LOCAL_DOKCER_REGISTRY_URL', value: 'registry.zilliz.com'), string(name: 'REMOTE_DOKCER_REGISTRY_URL', value: 'registry-1.docker.io'), string(name: 'REMOTE_DOCKER_CREDENTIALS_ID', value: 'milvus-docker-access-token'), string(name: 'BRANCH', value: String.valueOf(IMAGE_VERSION))], wait: false
} else {
echo "Skip publish daily docker images ..."
}
Expand All @@ -93,11 +98,13 @@ pipeline {

stage("Deploy Test") {
steps {
gitlabCommitStatus(name: 'Deploy Test') {
container('milvus-test-env') {
script {
print "In Deploy Test Stage"
container('milvus-test-env') {
script {
print "In Deploy Test Stage"
if ("${params.DEPLOY_MODE}" == "single") {
load "${env.WORKSPACE}/ci/jenkinsfile/deploy_test.groovy"
} else {
load "${env.WORKSPACE}/ci/jenkinsfile/deploy_shards_test.groovy"
}
}
}
Expand All @@ -106,24 +113,19 @@ pipeline {

stage ("Cleanup Env") {
steps {
gitlabCommitStatus(name: 'Cleanup Env') {
container('milvus-test-env') {
script {
container('milvus-test-env') {
script {
if ("${params.DEPLOY_MODE}" == "single") {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup.groovy"
} else {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanupShards.groovy"
}
}
}
}
}
}
post {
always {
container('milvus-test-env') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup.groovy"
}
}
}
success {
script {
echo "Milvus benchmark test success !"
Expand Down
7 changes: 4 additions & 3 deletions tests/milvus_benchmark/ci/publish_jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pipeline {
string defaultValue: 'registry.zilliz.com', description: 'Local Docker registry URL', name: 'LOCAL_DOKCER_REGISTRY_URL', trim: true
string defaultValue: 'registry-1.docker.io', description: 'Remote Docker registry URL', name: 'REMOTE_DOKCER_REGISTRY_URL', trim: true
string defaultValue: 'milvus-docker-access-token', description: 'Remote Docker credentials id', name: 'REMOTE_DOCKER_CREDENTIALS_ID', trim: true
string(defaultValue: "master", description: 'Milvus server version', name: 'BRANCH')
}

environment {
Expand Down Expand Up @@ -41,9 +42,9 @@ pipeline {
stages {
stage("Publish Docker Images") {
environment {
DOCKER_VERSION = "master-${BINARY_VERSION}-${OS_NAME}-release"
REMOTE_DOCKER_VERSION = "${OS_NAME}-${BINARY_VERSION}-${DAILY_BUILD_VERSION}"
REMOTE_DOCKER_LATEST_VERSION = "${OS_NAME}-${BINARY_VERSION}-latest"
DOCKER_VERSION = "${params.BRANCH}-${BINARY_VERSION}-${OS_NAME}-release"
REMOTE_DOCKER_VERSION = "${params.BRANCH}-${OS_NAME}-${BINARY_VERSION}-${DAILY_BUILD_VERSION}"
REMOTE_DOCKER_LATEST_VERSION = "${params.BRANCH}-${OS_NAME}-${BINARY_VERSION}-latest"
}

agent {
Expand Down
Loading

0 comments on commit de0669f

Please sign in to comment.