提交 6cf2f35b 编写于 作者: Q quicksilver

update test framework image version to v0.2


Former-commit-id: 636d8c5e46852693ae597cc93fad8f60305f0841
上级 b0a9684a
try { try {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true
if (result) {
if (currentBuild.result == 'ABORTED') { sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}"
throw new hudson.AbortException("Dev Test Aborted !")
} else if (currentBuild.result == 'FAILURE') {
error("Dev Test Failure !")
} }
} catch (exc) { } catch (exc) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}", returnStatus: true
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed' if (result) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}"
}
throw exc throw exc
} }
try { try {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster" def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster", returnStatus: true
if (result) {
if (currentBuild.result == 'ABORTED') { sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster"
throw new hudson.AbortException("Cluster Dev Test Aborted !")
} else if (currentBuild.result == 'FAILURE') {
error("Dev Test Failure !")
} }
} catch (exc) { } catch (exc) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster" def result = sh script: "helm status ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster", returnStatus: true
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed' if (result) {
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster"
}
throw exc throw exc
} }
...@@ -7,15 +7,14 @@ try { ...@@ -7,15 +7,14 @@ try {
dir ("milvus/milvus-cluster") { dir ("milvus/milvus-cluster") {
sh "helm install --set roServers.image.tag=${DOCKER_VERSION} --set woServers.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP -f ci/values.yaml --name ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster --namespace milvus-cluster --version 0.3.1 . " sh "helm install --set roServers.image.tag=${DOCKER_VERSION} --set woServers.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP -f ci/values.yaml --name ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster --namespace milvus-cluster --version 0.3.1 . "
} }
timeout(time: 2, unit: 'MINUTES') { }
waitUntil { timeout(time: 2, unit: 'MINUTES') {
def result = sh script: "nc -z -w 2 ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster-milvus-cluster-proxy.milvus-cluster.svc.cluster.local 19530", returnStatus: true waitUntil {
return !result def result = sh script: "nc -z -w 3 ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster-milvus-cluster-proxy.milvus-cluster.svc.cluster.local 19530", returnStatus: true
} return !result
} }
} }
} catch (exc) { } catch (exc) {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo 'Helm running failed!' echo 'Helm running failed!'
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster"
throw exc throw exc
......
container('milvus-testframework') { timeout(time: 10, unit: 'MINUTES') {
timeout(time: 10, unit: 'MINUTES') { try {
gitlabCommitStatus(name: 'Dev Test') { dir ("${PROJECT_NAME}_test") {
try { checkout([$class: 'GitSCM', branches: [[name: "${SEMVER}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "git@192.168.1.105:Test/milvus_test.git", name: 'origin', refspec: "+refs/heads/${SEMVER}:refs/remotes/origin/${SEMVER}"]]])
dir ("${PROJECT_NAME}_test") { sh 'python3 -m pip install -r requirements.txt'
checkout([$class: 'GitSCM', branches: [[name: "${SEMVER}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "git@192.168.1.105:Test/milvus_test.git", name: 'origin', refspec: "+refs/heads/${SEMVER}:refs/remotes/origin/${SEMVER}"]]]) sh "pytest . --alluredir=cluster_test_out --ip ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster-milvus-cluster-proxy.milvus-cluster.svc.cluster.local"
sh 'python3 -m pip install -r requirements.txt'
sh "pytest . --alluredir=cluster_test_out --ip ${env.JOB_NAME}-${env.BUILD_NUMBER}-cluster-milvus-cluster-proxy.milvus-cluster.svc.cluster.local"
}
} catch (exc) {
updateGitlabCommitStatus name: 'Dev Test', state: 'failed'
currentBuild.result = 'FAILURE'
echo 'Milvus Test Failed !'
}
} }
} catch (exc) {
echo 'Milvus Test Failed !'
throw exc
} }
} }
...@@ -10,12 +10,11 @@ try { ...@@ -10,12 +10,11 @@ try {
} }
timeout(time: 2, unit: 'MINUTES') { timeout(time: 2, unit: 'MINUTES') {
waitUntil { waitUntil {
def result = sh script: "nc -z -w 2 ${env.JOB_NAME}-${env.BUILD_NUMBER}-milvus-gpu-engine.kube-opt.svc.cluster.local 19530", returnStatus: true def result = sh script: "nc -z -w 3 ${env.JOB_NAME}-${env.BUILD_NUMBER}-milvus-gpu-engine.kube-opt.svc.cluster.local 19530", returnStatus: true
return !result return !result
} }
} }
} catch (exc) { } catch (exc) {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo 'Helm running failed!' echo 'Helm running failed!'
sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}" sh "helm del --purge ${env.JOB_NAME}-${env.BUILD_NUMBER}"
throw exc throw exc
......
container('milvus-testframework') { timeout(time: 10, unit: 'MINUTES') {
timeout(time: 10, unit: 'MINUTES') { try {
gitlabCommitStatus(name: 'Dev Test') { dir ("${PROJECT_NAME}_test") {
try { checkout([$class: 'GitSCM', branches: [[name: "${SEMVER}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "git@192.168.1.105:Test/milvus_test.git", name: 'origin', refspec: "+refs/heads/${SEMVER}:refs/remotes/origin/${SEMVER}"]]])
dir ("${PROJECT_NAME}_test") { sh 'python3 -m pip install -r requirements.txt'
checkout([$class: 'GitSCM', branches: [[name: "${SEMVER}"]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: "${params.GIT_USER}", url: "git@192.168.1.105:Test/milvus_test.git", name: 'origin', refspec: "+refs/heads/${SEMVER}:refs/remotes/origin/${SEMVER}"]]]) sh "pytest . --alluredir=test_out --ip ${env.JOB_NAME}-${env.BUILD_NUMBER}-milvus-gpu-engine.kube-opt.svc.cluster.local"
sh 'python3 -m pip install -r requirements.txt'
sh "pytest . --alluredir=test_out --ip ${env.JOB_NAME}-${env.BUILD_NUMBER}-milvus-gpu-engine.kube-opt.svc.cluster.local"
}
} catch (exc) {
updateGitlabCommitStatus name: 'Dev Test', state: 'failed'
currentBuild.result = 'FAILURE'
echo 'Milvus Test Failed !'
}
} }
} catch (exc) {
echo 'Milvus Test Failed !'
throw exc
} }
} }
container('milvus-testframework') { timeout(time: 5, unit: 'MINUTES') {
timeout(time: 5, unit: 'MINUTES') { dir ("${PROJECT_NAME}_test") {
dir ("${PROJECT_NAME}_test") { if (fileExists('cluster_test_out')) {
gitlabCommitStatus(name: 'Upload Dev Test Out') { def fileTransfer = load "${env.WORKSPACE}/ci/function/file_transfer.groovy"
if (fileExists('cluster_test_out')) { fileTransfer.FileTransfer("cluster_test_out/", "${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}", 'nas storage')
try { if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
def fileTransfer = load "${env.WORKSPACE}/ci/function/file_transfer.groovy" echo "Milvus Dev Test Out Viewer \"ftp://192.168.1.126/data/${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}\""
fileTransfer.FileTransfer("cluster_test_out/", "${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}", 'nas storage')
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
echo "Milvus Dev Test Out Viewer \"ftp://192.168.1.126/data/${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}\""
}
} catch (hudson.AbortException ae) {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'canceled'
currentBuild.result = 'ABORTED'
} catch (exc) {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'failed'
currentBuild.result = 'FAILURE'
}
} else {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'failed'
echo "Milvus Dev Test Out directory don't exists!"
}
} }
} else {
error("Milvus Dev Test Out directory don't exists!")
} }
} }
} }
container('milvus-testframework') { timeout(time: 5, unit: 'MINUTES') {
timeout(time: 5, unit: 'MINUTES') { dir ("${PROJECT_NAME}_test") {
dir ("${PROJECT_NAME}_test") { if (fileExists('test_out')) {
gitlabCommitStatus(name: 'Upload Dev Test Out') { def fileTransfer = load "${env.WORKSPACE}/ci/function/file_transfer.groovy"
if (fileExists('test_out')) { fileTransfer.FileTransfer("test_out/", "${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}", 'nas storage')
try { if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
def fileTransfer = load "${env.WORKSPACE}/ci/function/file_transfer.groovy" echo "Milvus Dev Test Out Viewer \"ftp://192.168.1.126/data/${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}\""
fileTransfer.FileTransfer("test_out/", "${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}", 'nas storage')
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
echo "Milvus Dev Test Out Viewer \"ftp://192.168.1.126/data/${PROJECT_NAME}/test/${JOB_NAME}-${BUILD_ID}\""
}
} catch (hudson.AbortException ae) {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'canceled'
currentBuild.result = 'ABORTED'
} catch (exc) {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'failed'
currentBuild.result = 'FAILURE'
}
} else {
updateGitlabCommitStatus name: 'Upload Dev Test Out', state: 'failed'
echo "Milvus Dev Test Out directory don't exists!"
}
} }
} else {
error("Milvus Dev Test Out directory don't exists!")
} }
} }
} }
...@@ -131,59 +131,53 @@ spec: ...@@ -131,59 +131,53 @@ spec:
stage("Deploy to Development") { stage("Deploy to Development") {
parallel { parallel {
stage("Single") { stage("Single Node") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy"
...@@ -192,140 +186,133 @@ spec: ...@@ -192,140 +186,133 @@ spec:
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Single Node CI/CD success !"
}
}
aborted {
script {
echo "Milvus Single Node CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Single Node CI/CD failure !"
}
}
} }
} }
stage("Cluster") { stage("Cluster") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_cluster_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_cluster_test_out.groovy"
} }
} }
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Cluster CI/CD success !"
}
}
aborted {
script {
echo "Milvus Cluster CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Cluster CI/CD failure !"
}
}
} }
} }
} }
......
...@@ -131,59 +131,53 @@ spec: ...@@ -131,59 +131,53 @@ spec:
stage("Deploy to Development") { stage("Deploy to Development") {
parallel { parallel {
stage("Single") { stage("Single Node") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy"
...@@ -192,140 +186,133 @@ spec: ...@@ -192,140 +186,133 @@ spec:
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Single Node CI/CD success !"
}
}
aborted {
script {
echo "Milvus Single Node CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Single Node CI/CD failure !"
}
}
} }
} }
stage("Cluster") { stage("Cluster") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_cluster_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_cluster_test_out.groovy"
} }
} }
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Cluster CI/CD success !"
}
}
aborted {
script {
echo "Milvus Cluster CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Cluster CI/CD failure !"
}
}
} }
} }
} }
...@@ -337,16 +324,18 @@ spec: ...@@ -337,16 +324,18 @@ spec:
post { post {
always { always {
script { script {
if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { if (env.gitlabAfter != null) {
// Send an email only if the build status has changed from green/unstable to red if (!currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
emailext subject: '$DEFAULT_SUBJECT', // Send an email only if the build status has changed from green/unstable to red
body: '$DEFAULT_CONTENT', emailext subject: '$DEFAULT_SUBJECT',
recipientProviders: [ body: '$DEFAULT_CONTENT',
[$class: 'DevelopersRecipientProvider'], recipientProviders: [
[$class: 'RequesterRecipientProvider'] [$class: 'DevelopersRecipientProvider'],
], [$class: 'RequesterRecipientProvider']
replyTo: '$DEFAULT_REPLYTO', ],
to: '$DEFAULT_RECIPIENTS' replyTo: '$DEFAULT_REPLYTO',
to: '$DEFAULT_RECIPIENTS'
}
} }
} }
} }
......
...@@ -131,59 +131,53 @@ spec: ...@@ -131,59 +131,53 @@ spec:
stage("Deploy to Development") { stage("Deploy to Development") {
parallel { parallel {
stage("Single") { stage("Single Node") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_test_out.groovy"
...@@ -192,140 +186,133 @@ spec: ...@@ -192,140 +186,133 @@ spec:
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Single Node CI/CD success !"
}
}
aborted {
script {
echo "Milvus Single Node CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Single Node CI/CD failure !"
}
}
} }
} }
stage("Cluster") { stage("Cluster") {
agent {
kubernetes {
label 'dev test'
defaultContainer 'jnlp'
yaml """
apiVersion: v1
kind: Pod
metadata:
labels:
app: milvus
componet: test
spec:
containers:
- name: milvus-testframework
image: registry.zilliz.com/milvus/milvus-test:v0.2
command:
- cat
tty: true
volumeMounts:
- name: kubeconf
mountPath: /root/.kube/
readOnly: true
volumes:
- name: kubeconf
secret:
secretName: test-cluster-config
"""
}
}
stages { stages {
stage("Deploy to Dev") { stage("Deploy to Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy to Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
stages {
stage('Deploy') {
steps {
gitlabCommitStatus(name: 'Deloy to Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_deploy2dev.groovy"
}
} }
} }
} }
} }
post {
aborted {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'canceled'
echo "Milvus Deloy to Dev aborted !"
}
}
failure {
script {
updateGitlabCommitStatus name: 'Deloy to Dev', state: 'failed'
echo "Milvus Deloy to Dev failure !"
}
}
}
} }
stage("Dev Test") { stage("Dev Test") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Deloy Test') {
label 'test' container('milvus-testframework') {
defaultContainer 'jnlp'
containerTemplate {
name 'milvus-testframework'
image 'registry.zilliz.com/milvus/milvus-test:v0.1'
ttyEnabled true
command 'cat'
}
}
}
stages {
stage('Test') {
steps {
script { script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/cluster_dev_test.groovy"
load "${env.WORKSPACE}/ci/jenkinsfile/upload_cluster_dev_test_out.groovy" load "${env.WORKSPACE}/ci/jenkinsfile/upload_dev_cluster_test_out.groovy"
} }
} }
} }
} }
} }
stage ("Cleanup Dev") { stage ("Cleanup Dev") {
agent { steps {
kubernetes { gitlabCommitStatus(name: 'Cleanup Dev') {
label 'jenkins-slave' container('milvus-testframework') {
defaultContainer 'jnlp' script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
stages {
stage('Cleanup') {
steps {
gitlabCommitStatus(name: 'Cleanup Dev') {
script {
load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
}
} }
} }
} }
} }
post { }
aborted { }
script { post {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'canceled' always {
echo "Milvus Cleanup Dev aborted !" container('milvus-testframework') {
} script {
} load "${env.WORKSPACE}/ci/jenkinsfile/cluster_cleanup_dev.groovy"
failure {
script {
updateGitlabCommitStatus name: 'Cleanup Dev', state: 'failed'
echo "Milvus Cleanup Dev failure !"
}
} }
} }
} }
success {
script {
echo "Milvus Cluster CI/CD success !"
}
}
aborted {
script {
echo "Milvus Cluster CI/CD aborted !"
}
}
failure {
script {
echo "Milvus Cluster CI/CD failure !"
}
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册