milvus/tests/milvus_benchmark/ci/main_jenkinsfile
zw e5b193a0d4 update server_version && update cases
Signed-off-by: zw <zw@milvus.io>
2020-05-11 10:00:18 +08:00

153 lines
5.6 KiB
Plaintext

pipeline {
agent none
options {
timestamps()
}
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: '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"
TEST_URL = "git@192.168.1.105:Test/milvus_benchmark.git"
TEST_BRANCH = "master"
TEST_LIB_URL = "http://192.168.1.105:6060/Test/milvus_metrics.git"
}
stages {
stage("Setup env") {
agent {
kubernetes {
label "test-benchmark-${env.JOB_NAME}-${env.BUILD_NUMBER}"
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-test-env
image: registry.zilliz.com/milvus/milvus-test-env:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
- name: raw-data-path
mountPath: /poc
readOnly: true
- name: db-data-path
mountPath: /test
readOnly: false
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
- name: raw-data-path
flexVolume:
driver: "fstab/cifs"
fsType: "cifs"
secretRef:
name: "cifs-test-secret"
options:
networkPath: "//192.168.1.126/poc"
mountOptions: "vers=1.0"
- name: db-data-path
flexVolume:
driver: "fstab/cifs"
fsType: "cifs"
secretRef:
name: "cifs-test-secret"
options:
networkPath: "//192.168.1.126/test"
mountOptions: "vers=1.0"
"""
}
}
stages {
stage("Publish Daily Docker images") {
steps {
container('milvus-test-env') {
script {
boolean isNightlyTest = isTimeTriggeredBuild()
if (isNightlyTest) {
build job: 'milvus-publish-daily-docker', wait: false
} else {
echo "Skip publish daily docker images ..."
}
}
}
}
}
stage("Deploy Test") {
steps {
gitlabCommitStatus(name: 'Deploy Test') {
container('milvus-test-env') {
script {
print "In Deploy Test Stage"
load "${env.WORKSPACE}/ci/jenkinsfile/deploy_test.groovy"
}
}
}
}
}
stage ("Cleanup Env") {
steps {
gitlabCommitStatus(name: 'Cleanup Env') {
container('milvus-test-env') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup.groovy"
}
}
}
}
}
}
post {
always {
container('milvus-test-env') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup.groovy"
}
}
}
success {
script {
echo "Milvus benchmark test success !"
}
}
aborted {
script {
echo "Milvus benchmark test aborted !"
}
}
failure {
script {
echo "Milvus benchmark test failed !"
}
}
}
}
}
}
boolean isTimeTriggeredBuild() {
if (currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0) {
return true
}
return false
}