mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
Merge pull request #1040 from ZhifengZhang-CN/master
Flag the upload to group coverage metrics
This commit is contained in:
commit
f081276377
6
.github/workflows/core.yml
vendored
6
.github/workflows/core.yml
vendored
@ -49,7 +49,8 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./ci/scripts/output_new.info
|
||||
name: ${{ matrix.ubuntu }}-unittests
|
||||
name: ubuntu-${{ matrix.ubuntu }}-unittests
|
||||
flags: cpu_version_ubuntu_18_04_unittest
|
||||
yml: ./codecov.yaml
|
||||
|
||||
centos:
|
||||
@ -90,5 +91,6 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./ci/scripts/output_new.info
|
||||
name: ${{ matrix.centos }}-unittests
|
||||
name: centos-${{ matrix.centos }}-unittests
|
||||
flags: cpu_version_centos7_unittest
|
||||
yml: ./codecov.yaml
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
timeout(time: 30, unit: 'MINUTES') {
|
||||
dir ("ci/scripts") {
|
||||
sh "./coverage.sh -o ${env.MILVUS_INSTALL_PREFIX} -u root -p 123456 -t \$POD_IP"
|
||||
// Set some env variables so codecov detection script works correctly
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) {
|
||||
sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest || echo \"Codecov did not collect coverage reports\""
|
||||
}
|
||||
boolean isNightlyTest = currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause').size() != 0 ? true : false
|
||||
String formatFlag = "${BINARY_VERSION}-version-${OS_NAME}-unittest".replaceAll("\\.", "_").replaceAll("-", "_")
|
||||
if (isNightlyTest) {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) {
|
||||
sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest -F nightly -F ${formatFlag} || echo \"Codecov did not collect coverage reports\""
|
||||
}
|
||||
} else {
|
||||
withCredentials([[$class: 'StringBinding', credentialsId: "milvus-ci-codecov-token", variable: 'CODECOV_TOKEN']]) {
|
||||
sh "curl -s https://codecov.io/bash | bash -s - -f output_new.info -n ${BINARY_VERSION}-version-${OS_NAME}-unittest -F ${formatFlag} || echo \"Codecov did not collect coverage reports\""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,32 +40,56 @@ if [[ -z "${ARTIFACTORY_URL}" || "${ARTIFACTORY_URL}" == "" ]];then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_ccache() {
|
||||
|
||||
PACKAGE_FILE="ccache-${OS_NAME}-${BUILD_ENV_DOCKER_IMAGE_ID}.tar.gz"
|
||||
|
||||
function check_ccache() {
|
||||
BRANCH=$1
|
||||
PACKAGE_FILE="ccache-${OS_NAME}-${BUILD_ENV_DOCKER_IMAGE_ID}.tar.gz"
|
||||
echo "fetching ${BRANCH}/${PACKAGE_FILE}"
|
||||
wget -q --spider "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}"
|
||||
return $?
|
||||
}
|
||||
|
||||
function download_file() {
|
||||
BRANCH=$1
|
||||
wget -q "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}" && \
|
||||
mkdir -p ${CCACHE_DIRECTORY} && \
|
||||
tar zxf ${PACKAGE_FILE} -C ${CCACHE_DIRECTORY} && \
|
||||
rm ${PACKAGE_FILE}
|
||||
return $?
|
||||
}
|
||||
|
||||
if [[ -n "${CHANGE_TARGET}" && "${BRANCH_NAME}" =~ "PR-" ]];then
|
||||
check_ccache ${CHANGE_TARGET}
|
||||
if [[ $? == 0 ]];then
|
||||
wget -q "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}" && \
|
||||
mkdir -p ${CCACHE_DIRECTORY} && \
|
||||
tar zxf ${PACKAGE_FILE} -C ${CCACHE_DIRECTORY} && \
|
||||
rm ${PACKAGE_FILE}
|
||||
download_file ${CHANGE_TARGET}
|
||||
if [[ $? == 0 ]];then
|
||||
echo "found cache"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -n "${CHANGE_TARGET}" && "${BRANCH_NAME}" =~ "PR-" ]];then
|
||||
check_ccache ${CHANGE_TARGET}
|
||||
check_ccache ${BRANCH_NAME}
|
||||
if [[ $? == 0 ]];then
|
||||
download_file ${BRANCH_NAME}
|
||||
if [[ $? == 0 ]];then
|
||||
echo "found cache"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
for CURRENT_BRANCH in ${BRANCH_NAMES}
|
||||
do
|
||||
if [[ "${CURRENT_BRANCH}" != "HEAD" ]];then
|
||||
check_ccache ${CURRENT_BRANCH}
|
||||
if [[ $? == 0 ]];then
|
||||
download_file ${CURRENT_BRANCH}
|
||||
if [[ $? == 0 ]];then
|
||||
echo "found cache"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@ -51,6 +51,23 @@ if [[ -z "${ARTIFACTORY_URL}" || "${ARTIFACTORY_URL}" == "" ]];then
|
||||
fi
|
||||
|
||||
PACKAGE_FILE="ccache-${OS_NAME}-${BUILD_ENV_DOCKER_IMAGE_ID}.tar.gz"
|
||||
|
||||
function check_ccache() {
|
||||
BRANCH=$1
|
||||
echo "fetching ${BRANCH}/${PACKAGE_FILE}"
|
||||
wget -q --spider "${ARTIFACTORY_URL}/${BRANCH}/${PACKAGE_FILE}"
|
||||
return $?
|
||||
}
|
||||
|
||||
|
||||
if [[ -n "${CHANGE_TARGET}" && "${BRANCH_NAME}" =~ "PR-" ]]; then
|
||||
REMOTE_PACKAGE_PATH="${ARTIFACTORY_URL}/${BRANCH_NAME}"
|
||||
check_ccache ${CHANGE_TARGET}
|
||||
if [[ $? == 0 ]];then
|
||||
echo "Skip Update ccache package ..." && exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
REMOTE_PACKAGE_PATH="${ARTIFACTORY_URL}/${BRANCH_NAME}"
|
||||
|
||||
ccache --show-stats
|
||||
|
||||
21
codecov.yaml
21
codecov.yaml
@ -1,14 +1,31 @@
|
||||
#Configuration File for CodeCov
|
||||
coverage:
|
||||
notify:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
|
||||
status:
|
||||
project: on
|
||||
project:
|
||||
default:
|
||||
threshold: 0.2 #Allow the coverage to drop by threshold%, and posting a success status.
|
||||
patch: yes
|
||||
changes: no
|
||||
|
||||
comment:
|
||||
layout: "header, diff, changes, tree"
|
||||
layout: "reach, diff, flags, files"
|
||||
behavior: default
|
||||
require_changes: no
|
||||
|
||||
flags:
|
||||
nightly:
|
||||
joined: false
|
||||
|
||||
ignore:
|
||||
- "LICENSES"
|
||||
- ".git"
|
||||
- "*.yml"
|
||||
- "*.md"
|
||||
- "docs/.*"
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
FROM centos:centos7
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
|
||||
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
|
||||
yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
|
||||
@ -18,4 +20,4 @@ COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
WORKDIR /root
|
||||
|
||||
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
|
||||
CMD [ "start" ]
|
||||
CMD [ "start" ]
|
||||
|
||||
@ -2,6 +2,8 @@ FROM ubuntu:16.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates gnupg2 apt-transport-https && \
|
||||
wget -P /tmp https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
apt-key add /tmp/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
|
||||
@ -2,6 +2,8 @@ FROM ubuntu:18.04
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates gnupg2 && \
|
||||
wget -P /tmp https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
apt-key add /tmp/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
|
||||
@ -2,6 +2,8 @@ FROM nvidia/cuda:10.1-devel-centos7
|
||||
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
|
||||
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
|
||||
yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
|
||||
|
||||
@ -2,6 +2,8 @@ FROM nvidia/cuda:10.1-devel-ubuntu16.04
|
||||
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget && \
|
||||
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
|
||||
wget -P /tmp https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
|
||||
@ -2,6 +2,8 @@ FROM nvidia/cuda:10.1-devel-ubuntu18.04
|
||||
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget && \
|
||||
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
|
||||
wget -P /tmp https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
FROM python:3.6.8-jessie
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
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 && \
|
||||
@ -7,7 +9,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget apt-transp
|
||||
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
|
||||
apt-get remove --purge -y && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
WORKDIR /root
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user