mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
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:
parent
79957330d7
commit
31b41d7815
6
ci/jenkins/Jenkinsfile
vendored
6
ci/jenkins/Jenkinsfile
vendored
@ -66,7 +66,7 @@ pipeline {
|
|||||||
stage('Run Build') {
|
stage('Run Build') {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
label "${OS_NAME}-${BINARY_VERSION}-build-${env.BUILD_NUMBER}"
|
label "${OS_NAME}-${BINARY_VERSION}-build-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}"
|
||||||
defaultContainer 'jnlp'
|
defaultContainer 'jnlp'
|
||||||
yamlFile "ci/jenkins/pod/milvus-${BINARY_VERSION}-version-${OS_NAME}-build-env-pod.yaml"
|
yamlFile "ci/jenkins/pod/milvus-${BINARY_VERSION}-version-${OS_NAME}-build-env-pod.yaml"
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ pipeline {
|
|||||||
stage('Publish docker images') {
|
stage('Publish docker images') {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
label "${OS_NAME}-${BINARY_VERSION}-publish-${env.BUILD_NUMBER}"
|
label "${OS_NAME}-${BINARY_VERSION}-publish-${env.PIPELINE_NAME}-${env.BUILD_NUMBER}"
|
||||||
defaultContainer 'jnlp'
|
defaultContainer 'jnlp'
|
||||||
yamlFile 'ci/jenkins/pod/docker-pod.yaml'
|
yamlFile 'ci/jenkins/pod/docker-pod.yaml'
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ pipeline {
|
|||||||
|
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
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'
|
defaultContainer 'jnlp'
|
||||||
yamlFile 'ci/jenkins/pod/testEnvironment.yaml'
|
yamlFile 'ci/jenkins/pod/testEnvironment.yaml'
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: milvus-test-env
|
- 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:
|
command:
|
||||||
- cat
|
- cat
|
||||||
tty: true
|
tty: true
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
try {
|
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) {
|
if (!helmResult) {
|
||||||
sh "helm del --purge ${env.HELM_RELEASE_NAME}"
|
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
|
||||||
}
|
}
|
||||||
} catch (exc) {
|
} 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) {
|
if (!helmResult) {
|
||||||
sh "helm del --purge ${env.HELM_RELEASE_NAME}"
|
sh "helm uninstall -n milvus ${env.HELM_RELEASE_NAME}"
|
||||||
}
|
}
|
||||||
throw exc
|
throw exc
|
||||||
}
|
}
|
||||||
|
@ -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'
|
sh 'helm repo update'
|
||||||
dir ('milvus-helm') {
|
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"]]])
|
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") {
|
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} ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ timeout(time: 90, unit: 'MINUTES') {
|
|||||||
}
|
}
|
||||||
dir ("milvus-helm") {
|
dir ("milvus-helm") {
|
||||||
dir ("milvus") {
|
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") {
|
dir ("tests/milvus_python_test") {
|
||||||
|
@ -14,7 +14,7 @@ timeout(time: 60, unit: 'MINUTES') {
|
|||||||
// }
|
// }
|
||||||
// dir ("milvus-helm") {
|
// dir ("milvus-helm") {
|
||||||
// dir ("milvus") {
|
// 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") {
|
// dir ("tests/milvus_python_test") {
|
||||||
|
16
docker/test_env/Dockerfile
Normal file
16
docker/test_env/Dockerfile
Normal 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" ]
|
9
docker/test_env/docker-entrypoint.sh
Executable file
9
docker/test_env/docker-entrypoint.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = 'start' ]; then
|
||||||
|
tail -f /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
Loading…
Reference in New Issue
Block a user