2021-11-16 21:30:23 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-01-11 16:49:46 +08:00
|
|
|
# Licensed to the LF AI & Data foundation under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
2021-11-16 21:30:23 +08:00
|
|
|
#
|
2022-01-11 16:49:46 +08:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2021-11-16 21:30:23 +08:00
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2021-11-18 21:37:44 +08:00
|
|
|
# Exit immediately for non zero status
|
2021-11-16 21:30:23 +08:00
|
|
|
set -e
|
2021-12-02 13:03:46 +08:00
|
|
|
# Check unset variables
|
2021-11-16 21:30:23 +08:00
|
|
|
set -u
|
2021-12-01 10:35:44 +08:00
|
|
|
# Print commands
|
2021-11-16 21:30:23 +08:00
|
|
|
set -x
|
|
|
|
function milvus_ci_release_name(){
|
2021-12-30 14:07:31 +08:00
|
|
|
# Rules for helm release name
|
2021-11-16 21:30:23 +08:00
|
|
|
local name="m"
|
2022-04-14 22:29:34 +08:00
|
|
|
if [[ "${MILVUS_SERVER_TYPE:-}" == "distributed-pulsar" ]]; then
|
|
|
|
# Distributed pulsar mode
|
|
|
|
name+="dp"
|
|
|
|
elif [[ "${MILVUS_SERVER_TYPE:-}" == "distributed-kafka" ]]; then
|
|
|
|
# Distributed kafka mode
|
|
|
|
name+="dk"
|
2024-10-09 19:03:19 +08:00
|
|
|
elif [[ "${MILVUS_SERVER_TYPE:-}" == "standalone-kafka-mmap" ]]; then
|
2023-07-07 11:30:26 +08:00
|
|
|
# Standalone kafka mode
|
|
|
|
name+="sk"
|
2022-04-14 22:29:34 +08:00
|
|
|
elif [[ "${MILVUS_SERVER_TYPE:-}" == "distributed" ]]; then
|
2021-12-30 14:07:31 +08:00
|
|
|
# Distributed mode
|
2021-11-16 21:30:23 +08:00
|
|
|
name+="d"
|
2023-05-31 10:59:29 +08:00
|
|
|
elif [[ "${MILVUS_SERVER_TYPE:-}" == "standalone-authentication" ]]; then
|
|
|
|
# Standalone authentication mode
|
|
|
|
name+="a"
|
2024-01-12 14:42:52 +08:00
|
|
|
elif [[ "${MILVUS_SERVER_TYPE:-}" == "standalone-one-pod" ]]; then
|
|
|
|
# Standalone mode with one pod
|
|
|
|
name+="sop"
|
2022-04-14 22:29:34 +08:00
|
|
|
else
|
2023-05-31 10:59:29 +08:00
|
|
|
# Standalone mode
|
2021-11-16 21:30:23 +08:00
|
|
|
name+="s"
|
|
|
|
|
|
|
|
fi
|
2021-12-30 14:07:31 +08:00
|
|
|
# Add pr number into release name
|
2021-11-16 21:30:23 +08:00
|
|
|
if [[ -n ${CHANGE_ID:-} ]]; then
|
|
|
|
name+="-${CHANGE_ID:-}"
|
|
|
|
fi
|
|
|
|
|
2022-01-06 14:27:20 +08:00
|
|
|
|
2021-12-30 14:07:31 +08:00
|
|
|
# Add Jenkins BUILD_ID into Name
|
2021-11-16 21:30:23 +08:00
|
|
|
if [[ -n ${JENKINS_BUILD_ID:-} ]]; then
|
|
|
|
name+="-${JENKINS_BUILD_ID}"
|
|
|
|
fi
|
|
|
|
|
2022-01-06 14:27:20 +08:00
|
|
|
|
|
|
|
if [[ "${CI_MODE:-}" == "nightly" ]]; then
|
|
|
|
# Nightly CI
|
|
|
|
name+="-n"
|
|
|
|
else
|
|
|
|
# Pull Request CI
|
|
|
|
name+="-pr"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
2023-03-24 11:03:58 +08:00
|
|
|
if [[ "${MODE:-}" == "gpu" ]]; then
|
|
|
|
name+="-gpu"
|
|
|
|
fi
|
|
|
|
|
2021-11-16 21:30:23 +08:00
|
|
|
export MILVUS_HELM_RELEASE_NAME=${name}
|
|
|
|
echo ${name}
|
|
|
|
}
|
|
|
|
milvus_ci_release_name
|