2020-11-30 05:18:44 +08:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
@Library('mpl') _
|
|
|
|
|
2021-03-11 14:14:29 +08:00
|
|
|
String cron_timezone = "TZ=Asia/Shanghai"
|
2021-03-30 11:43:55 +08:00
|
|
|
String cron_string = BRANCH_NAME == "r0.3-test" ? "50 20,22,0,2,4,6,11,16 * * * " : ""
|
2021-03-11 14:14:29 +08:00
|
|
|
|
2020-11-30 05:18:44 +08:00
|
|
|
pipeline {
|
|
|
|
agent none
|
2021-03-11 14:14:29 +08:00
|
|
|
triggers {
|
|
|
|
cron """${cron_timezone}
|
|
|
|
${cron_string}"""
|
|
|
|
}
|
2020-11-30 05:18:44 +08:00
|
|
|
options {
|
|
|
|
timestamps()
|
2021-03-30 16:30:28 +08:00
|
|
|
// parallelsAlwaysFailFast()
|
2020-11-30 05:18:44 +08:00
|
|
|
}
|
|
|
|
environment {
|
2021-03-11 12:01:05 +08:00
|
|
|
PROJECT_NAME = "milvus"
|
2020-11-30 05:18:44 +08:00
|
|
|
SEMVER = "${BRANCH_NAME.contains('/') ? BRANCH_NAME.substring(BRANCH_NAME.lastIndexOf('/') + 1) : BRANCH_NAME}"
|
|
|
|
BUILD_TYPE = "Release"
|
|
|
|
LOWER_BUILD_TYPE = BUILD_TYPE.toLowerCase()
|
|
|
|
PACKAGE_VERSION = "${SEMVER}-${LOWER_BUILD_TYPE}"
|
|
|
|
PACKAGE_NAME = "${PROJECT_NAME}-${PACKAGE_VERSION}.tar.gz"
|
|
|
|
JFROG_CREDENTIALS_ID = "1a527823-d2b7-44fd-834b-9844350baf14"
|
|
|
|
JFROG_ARTFACTORY_URL = "http://192.168.1.201/artifactory/milvus"
|
|
|
|
PACKAGE_ARTFACTORY_URL = "${JFROG_ARTFACTORY_URL}/${PROJECT_NAME}/package/${PACKAGE_NAME}"
|
|
|
|
DOCKER_CREDENTIALS_ID = "ba070c98-c8cc-4f7c-b657-897715f359fc"
|
|
|
|
DOKCER_REGISTRY_URL = "registry.zilliz.com"
|
2021-04-26 13:59:28 +08:00
|
|
|
SOURCE_REPO = "${DOKCER_REGISTRY_URL}/milvus"
|
|
|
|
TARGET_REPO = "${DOKCER_REGISTRY_URL}/milvus"
|
2020-12-03 19:00:11 +08:00
|
|
|
SOURCE_TAG = "${CHANGE_TARGET ? CHANGE_TARGET : SEMVER}-${LOWER_BUILD_TYPE}"
|
|
|
|
TARGET_TAG = "${SEMVER}-${LOWER_BUILD_TYPE}"
|
|
|
|
DOCKER_BUILDKIT = 1
|
2020-11-30 05:18:44 +08:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage ('Build and UnitTest') {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
2020-11-30 19:08:32 +08:00
|
|
|
label "${env.PROJECT_NAME}-${SEMVER}-${env.BUILD_NUMBER}-build"
|
2020-11-30 05:18:44 +08:00
|
|
|
defaultContainer 'build-env'
|
|
|
|
customWorkspace '/home/jenkins/agent/workspace'
|
|
|
|
yamlFile "build/ci/jenkins/pod/build-env.yaml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
PULSAR_ADDRESS = "pulsar://127.0.0.1:6650"
|
|
|
|
ETCD_ADDRESS = "127.0.0.1:2379"
|
2021-04-26 13:59:28 +08:00
|
|
|
CCACHE_ARTFACTORY_URL = "${JFROG_ARTFACTORY_URL}/milvus/ccache"
|
|
|
|
THIRDPARTY_ARTFACTORY_URL = "${JFROG_ARTFACTORY_URL}/milvus/thirdparty"
|
2020-12-08 19:53:22 +08:00
|
|
|
CUSTOM_THIRDPARTY_PATH = "${WORKSPACE}/3rdparty_download"
|
2021-04-26 13:59:28 +08:00
|
|
|
GO_CACHE_ARTFACTORY_URL = "${JFROG_ARTFACTORY_URL}/milvus/go-cache"
|
|
|
|
GO_MOD_ARTFACTORY_URL = "${JFROG_ARTFACTORY_URL}/milvus/go-mod"
|
2020-11-30 05:18:44 +08:00
|
|
|
}
|
|
|
|
steps {
|
|
|
|
container('build-env') {
|
|
|
|
MPLModule('Build')
|
|
|
|
MPLModule('Package')
|
|
|
|
// MPLModule('UnitTest')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage ('Publish Docker Images') {
|
|
|
|
agent {
|
|
|
|
kubernetes {
|
2020-11-30 19:08:32 +08:00
|
|
|
label "${env.PROJECT_NAME}-${SEMVER}-${env.BUILD_NUMBER}-publish"
|
2020-11-30 05:18:44 +08:00
|
|
|
defaultContainer 'publish-images'
|
|
|
|
yamlFile "build/ci/jenkins/pod/docker-pod.yaml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
container('publish-images') {
|
|
|
|
MPLModule('Publish')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-03 19:00:11 +08:00
|
|
|
|
|
|
|
stage ('Dev Test') {
|
2021-02-27 18:32:23 +08:00
|
|
|
matrix {
|
|
|
|
axes {
|
|
|
|
axis {
|
2021-03-11 12:01:05 +08:00
|
|
|
name 'REGRESSION_SERVICE_TYPE'
|
|
|
|
values 'standalone', 'distributed'
|
2021-02-27 18:32:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
2021-04-26 18:35:57 +08:00
|
|
|
HELM_BRANCH = "2.0"
|
2021-03-11 12:01:05 +08:00
|
|
|
HELM_RELEASE_NAMESPACE = "dev"
|
|
|
|
HELM_RELEASE_NAME = "${PROJECT_NAME}-${SEMVER}-${env.BUILD_NUMBER}-${REGRESSION_SERVICE_TYPE}".replaceAll("\\.", "-").replaceAll("_", "-").toLowerCase()
|
2021-03-27 18:59:29 +08:00
|
|
|
DEV_TEST_ARTIFACTS_PATH = "artifacts"
|
2021-02-27 18:32:23 +08:00
|
|
|
}
|
|
|
|
agent {
|
2021-03-11 12:01:05 +08:00
|
|
|
kubernetes {
|
|
|
|
label "${env.PROJECT_NAME}-${SEMVER}-${env.BUILD_NUMBER}-${REGRESSION_SERVICE_TYPE}-devtest"
|
|
|
|
defaultContainer 'test-env'
|
|
|
|
yamlFile "build/ci/jenkins/pod/test-env.yaml"
|
|
|
|
}
|
2021-02-27 18:32:23 +08:00
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
MPLModule('Python Regression')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
cleanup {
|
2021-03-11 12:01:05 +08:00
|
|
|
MPLModule('Cleanup Python Regression')
|
2021-02-27 18:32:23 +08:00
|
|
|
}
|
2020-12-03 19:00:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-30 05:18:44 +08:00
|
|
|
}
|
|
|
|
}
|