Skip to content

Commit

Permalink
[ci](branch-3.0) support run cloud_p* and performance
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen committed Aug 1, 2024
1 parent 7e8415f commit ea13fb6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
24 changes: 12 additions & 12 deletions regression-test/pipeline/cloud_p0/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ fi
# shellcheck source=/dev/null
source "$(bash "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/get-or-set-tmp-env.sh 'get')"
if ${skip_pipeline:=false}; then echo "INFO: skip build pipline" && exit 0; else echo "INFO: no skip"; fi
if [[ "${target_branch}" == "master" ]]; then
if [[ "${target_branch}" == "master" || "${target_branch}" == "branch-3.0" ]]; then
echo "INFO: PR target branch ${target_branch}"
install_java
else
echo "WARNING: PR target branch ${target_branch} is NOT in (master), skip pipeline."
echo "WARNING: PR target branch ${target_branch} is NOT in (master, branch-3.0), skip pipeline."
bash "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/get-or-set-tmp-env.sh 'set' "export skip_pipeline=true"
exit 0
fi
Expand Down Expand Up @@ -107,11 +107,11 @@ install_fdb
clean_fdb "cloud_instance_0"

echo "#### 5. check if binary package ready"
merge_pr_to_master_commit() {
merge_pr_to_target_branch_compiled_commit() {
local pr_num_from_trigger="$1"
local target_branch="$2"
local master_commit="$3"
echo "INFO: merge pull request into ${target_branch} ${master_commit}"
local target_branch_compiled_commit="$3"
echo "INFO: merge pull request into ${target_branch} ${target_branch_compiled_commit}"
if [[ -z "${teamcity_build_checkoutDir}" ]]; then
echo "ERROR: env teamcity_build_checkoutDir not set" && return 1
fi
Expand All @@ -120,10 +120,10 @@ merge_pr_to_master_commit() {
git fetch origin "${target_branch}"
git checkout "${target_branch}"
git reset --hard origin/"${target_branch}"
git checkout "${master_commit}"
git checkout "${target_branch_compiled_commit}"
returnValue=$?
if [[ ${returnValue} -ne 0 ]]; then
echo "ERROR: checkout ${target_branch} ${master_commit} failed. please rebase to the newest version."
echo "ERROR: checkout ${target_branch} ${target_branch_compiled_commit} failed. please rebase to the newest version."
return 1
fi
git rev-parse HEAD
Expand All @@ -132,7 +132,7 @@ merge_pr_to_master_commit() {
echo "git fetch origin refs/pull/${pr_num_from_trigger}/head"
git fetch origin "refs/pull/${pr_num_from_trigger}/head"
git merge --no-edit --allow-unrelated-histories FETCH_HEAD
echo "INFO: merge refs/pull/${pr_num_from_trigger}/head into ${target_branch} ${master_commit}"
echo "INFO: merge refs/pull/${pr_num_from_trigger}/head into ${target_branch} ${target_branch_compiled_commit}"
# CONFLICTS=$(git ls-files -u | wc -l)
if [[ $(git ls-files -u | wc -l) -gt 0 ]]; then
echo "ERROR: merge refs/pull/${pr_num_from_trigger}/head into failed. Aborting"
Expand All @@ -145,11 +145,11 @@ if ! check_oss_file_exist "${pr_num_from_trigger}_${commit_id_from_trigger}.tar.
if download_oss_file "${pr_num_from_trigger}_${commit_id_from_trigger}.tar.gz"; then
rm -rf "${teamcity_build_checkoutDir}"/output
tar -I pigz -xf "${pr_num_from_trigger}_${commit_id_from_trigger}.tar.gz"
master_commit_file="master.commit"
if [[ -e output/${master_commit_file} ]]; then
target_branch_compiled_commit_file="master.commit"
if [[ -e output/${target_branch_compiled_commit_file} ]]; then
# checkout to master commit and merge this pr, to ensure binary and case are same version
master_commit=$(cat output/"${master_commit_file}")
if merge_pr_to_master_commit "${pr_num_from_trigger}" "${target_branch}" "${master_commit}"; then
target_branch_compiled_commit=$(cat output/"${target_branch_compiled_commit_file}")
if merge_pr_to_target_branch_compiled_commit "${pr_num_from_trigger}" "${target_branch}" "${target_branch_compiled_commit}"; then
echo "INFO: merged done"
if [[ "${teamcity_buildType_id:-}" == "Doris_DorisCloudRegression_CloudP1" ]]; then
echo "INFO: 用cloud_p1/conf覆盖cloud_p0/conf"
Expand Down
2 changes: 1 addition & 1 deletion regression-test/pipeline/common/doris-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function install_java() {
[[ -z "$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-8-*')" ]]; then
sudo apt update && sudo apt install openjdk-8-jdk -y >/dev/null
fi
# doris master branch use java-17
# doris master and branch-3.0 use java-17
if ! java -version >/dev/null ||
[[ -z "$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-17-*')" ]]; then
sudo apt update && sudo apt install openjdk-17-jdk -y >/dev/null
Expand Down
4 changes: 2 additions & 2 deletions regression-test/pipeline/performance/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ merge_pr_to_target_branch_latest() {
fi
}

if [[ "${target_branch}" == "master" ]]; then
if [[ "${target_branch}" == "master" || "${target_branch}" == "branch-3.0" ]]; then
REMOTE_CCACHE='/mnt/remote_ccache_master'
docker_image="apache/doris:build-env-ldb-toolchain-0.19-latest"
elif [[ "${target_branch}" == "branch-2.0" ]]; then
Expand Down Expand Up @@ -109,7 +109,7 @@ if sudo docker ps -a --no-trunc | grep "${docker_name}"; then
fi
rm -f custom_env.sh
cp "${teamcity_build_checkoutDir}"/regression-test/pipeline/performance/conf/custom_env.sh .
if [[ "${target_branch}" == "master" ]]; then
if [[ "${target_branch}" == "master" || "${target_branch}" == "branch-3.0" ]]; then
echo "export JAVA_HOME=/usr/lib/jvm/jdk-17.0.2" >>custom_env.sh
fi
rm -rf "${teamcity_build_checkoutDir}"/output
Expand Down
4 changes: 4 additions & 0 deletions regression-test/pipeline/performance/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ exit_flag=0
cp -f "${teamcity_build_checkoutDir}"/regression-test/pipeline/performance/conf/fe_custom.conf "${DORIS_HOME}"/fe/conf/
cp -f "${teamcity_build_checkoutDir}"/regression-test/pipeline/performance/conf/be_custom.conf "${DORIS_HOME}"/be/conf/
target_branch="$(echo "${target_branch}" | sed 's| ||g;s|\.||g;s|-||g')" # remove space、dot、hyphen from branch name
if [[ "${target_branch}" == "branch30" ]]; then
# branch-3.0 also use master data
target_branch="master"
fi
sed -i "s|^meta_dir=/data/doris-meta-\${branch_name}|meta_dir=/data/doris-meta-${target_branch}${meta_changed_suffix:-}|g" "${DORIS_HOME}"/fe/conf/fe_custom.conf
sed -i "s|^storage_root_path=/data/doris-storage-\${branch_name}|storage_root_path=/data/doris-storage-${target_branch}${meta_changed_suffix:-}|g" "${DORIS_HOME}"/be/conf/be_custom.conf

Expand Down
8 changes: 6 additions & 2 deletions regression-test/pipeline/performance/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ source "$(bash "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/g
source "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/doris-utils.sh

if ${skip_pipeline:=false}; then echo "INFO: skip build pipline" && exit 0; else echo "INFO: no skip"; fi
if [[ "${target_branch}" == "master" ]]; then
if [[ "${target_branch}" == "master" || "${target_branch}" == "branch-3.0" ]]; then
echo "INFO: PR target branch ${target_branch}"
install_java
JAVA_HOME="${JAVA_HOME:-$(find /usr/lib/jvm -maxdepth 1 -type d -name 'java-17-*' | sed -n '1p')}"
bash "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/get-or-set-tmp-env.sh 'set' "export JAVA_HOME=\"${JAVA_HOME}\""
elif [[ "${target_branch}" == "branch-2.0" ]]; then
echo "INFO: PR target branch ${target_branch}"
else
echo "WARNING: PR target branch ${target_branch} is NOT in (master, branch-2.0), skip pipeline."
echo "WARNING: PR target branch ${target_branch} is NOT in (master, branch-3.0, branch-2.0), skip pipeline."
bash "${teamcity_build_checkoutDir}"/regression-test/pipeline/common/get-or-set-tmp-env.sh 'set' "export skip_pipeline=true"
exit 0
fi
Expand All @@ -98,6 +98,10 @@ if _get_pr_changed_files "${pr_num_from_trigger}"; then
# if PR changed the doris meta file, the next PR deployment on the same mechine which built this PR will fail.
# make a copy of the meta file for the meta changed PR.
target_branch="$(echo "${target_branch}" | sed 's| ||g;s|\.||g;s|-||g')" # remove space、dot、hyphen from branch name
if [[ "${target_branch}" == "branch30" ]]; then
# branch-3.0 also use master data
target_branch="master"
fi
meta_changed_suffix="_2"
rsync -a --delete "/data/doris-meta-${target_branch}/" "/data/doris-meta-${target_branch}${meta_changed_suffix}"
rsync -a --delete "/data/doris-storage-${target_branch}/" "/data/doris-storage-${target_branch}${meta_changed_suffix}"
Expand Down

0 comments on commit ea13fb6

Please sign in to comment.