Use Helm version 3 on Jenkins CI (#798)

* add test enviroment images

* update test enviroment images Dockerfile

* Use Helm version 3 on Jenkins CI

* Use Helm version 3 on Jenkins CI

* Use Helm version 3 on Jenkins CI

* Use Helm version 3 on Jenkins CI
This commit is contained in:
quicksilver 2019-12-20 15:55:02 +08:00 committed by Jin Hai
parent 79957330d7
commit 31b41d7815
8 changed files with 38 additions and 12 deletions

View File

@ -66,7 +66,7 @@ pipeline {
stage('Run Build') {
agent {
kubernetes {
label "${OS_NAME}-${BINARY_VERSION}-build-${env.BUILD_NUMBER}"
label "${OS_NAME}-${BINARY_VERSION}-build-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}"
defaultContainer 'jnlp'
yamlFile "ci/jenkins/pod/milvus-${BINARY_VERSION}-version-${OS_NAME}-build-env-pod.yaml"
}
@ -112,7 +112,7 @@ pipeline {
stage('Publish docker images') {
agent {
kubernetes {
label "${OS_NAME}-${BINARY_VERSION}-publish-${env.BUILD_NUMBER}"
label "${OS_NAME}-${BINARY_VERSION}-publish-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}"
defaultContainer 'jnlp'
yamlFile 'ci/jenkins/pod/docker-pod.yaml'
}
@ -140,7 +140,7 @@ pipeline {
agent {
kubernetes {
label "${OS_NAME}-${BINARY_VERSION}-dev-test-${env.BUILD_NUMBER}"
label "${OS_NAME}-${BINARY_VERSION}-dev-test-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}"
defaultContainer 'jnlp'
yamlFile 'ci/jenkins/pod/testEnvironment.yaml'
}

View File

@ -7,7 +7,7 @@ metadata:
spec:
containers:
- name: milvus-test-env
image: registry.zilliz.com/milvus/milvus-test-env:v0.1
image: registry.zilliz.com/milvus/milvus-test-env:v0.2
command:
- cat
tty: true

View File

@ -1,12 +1,12 @@
try {
def helmResult = sh script: "helm status ${env.HELM_RELEASE_NAME}", returnStatus: true
def helmResult = sh script: "helm status -n milvus ${env.HELM_RELEASE_NAME}", returnStatus: true
if (!helmResult) {
sh "helm del --purge ${env.HELM_RELEASE_NAME}"
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
}
} catch (exc) {
def helmResult = sh script: "helm status ${env.HELM_RELEASE_NAME}", returnStatus: true
def helmResult = sh script: "helm status -n milvus ${env.HELM_RELEASE_NAME}", returnStatus: true
if (!helmResult) {
sh "helm del --purge ${env.HELM_RELEASE_NAME}"
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
}
throw exc
}

View File

@ -1,9 +1,10 @@
sh 'helm init --client-only --skip-refresh --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
sh 'helm version'
sh 'helm repo add stable https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts'
sh 'helm repo update'
dir ('milvus-helm') {
checkout([$class: 'GitSCM', branches: [[name: "0.6.0"]], userRemoteConfigs: [[url: "https://github.com/milvus-io/milvus-helm.git", name: 'origin', refspec: "+refs/heads/0.6.0:refs/remotes/origin/0.6.0"]]])
dir ("milvus") {
sh "helm install --wait --timeout 300 --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP --name ${env.HELM_RELEASE_NAME} -f ci/db_backend/sqlite_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ."
sh "helm install --wait --timeout 300s --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP -f ci/db_backend/sqlite_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ${env.HELM_RELEASE_NAME} ."
}
}

View File

@ -13,7 +13,7 @@ timeout(time: 90, unit: 'MINUTES') {
}
dir ("milvus-helm") {
dir ("milvus") {
sh "helm install --wait --timeout 300 --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP --name ${env.HELM_RELEASE_NAME} -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ."
sh "helm install --wait --timeout 300s --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ${env.HELM_RELEASE_NAME} ."
}
}
dir ("tests/milvus_python_test") {

View File

@ -14,7 +14,7 @@ timeout(time: 60, unit: 'MINUTES') {
// }
// dir ("milvus-helm") {
// dir ("milvus") {
// sh "helm install --wait --timeout 300 --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP --name ${env.HELM_RELEASE_NAME} -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ."
// sh "helm install --wait --timeout 300s --set engine.image.tag=${DOCKER_VERSION} --set expose.type=clusterIP -f ci/db_backend/mysql_${BINARY_VERSION}_values.yaml -f ci/filebeat/values.yaml --namespace milvus ${env.HELM_RELEASE_NAME} ."
// }
// }
// dir ("tests/milvus_python_test") {

View File

@ -0,0 +1,16 @@
FROM python:3.6.8-jessie
RUN apt-get update && apt-get install -y --no-install-recommends wget apt-transport-https && \
wget -qO- "https://get.helm.sh/helm-v3.0.2-linux-amd64.tar.gz" | tar --strip-components=1 -xz -C /usr/local/bin linux-amd64/helm && \
wget -P /tmp https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg && \
apt-key add /tmp/apt-key.gpg && \
sh -c 'echo deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main > /etc/apt/sources.list.d/kubernetes.list' && \
apt-get update && apt-get install -y --no-install-recommends \
build-essential kubectl && \
apt-get remove --purge -y
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
WORKDIR /root
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
CMD [ "start" ]

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
if [ "$1" = 'start' ]; then
tail -f /dev/null
fi
exec "$@"