mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-03-22 18:10:37 +00:00
fix: fix nightly ci (#7588)
* fix: fix nightly ci Signed-off-by: WenyXu <wenymedia@gmail.com> * wait for ready Signed-off-by: WenyXu <wenymedia@gmail.com> * Update .github/scripts/deploy-greptimedb.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * apply suggesions Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
34
.github/scripts/deploy-greptimedb.sh
vendored
34
.github/scripts/deploy-greptimedb.sh
vendored
@@ -7,8 +7,6 @@ KUBERNETES_VERSION="${KUBERNETES_VERSION:-v1.32.0}"
|
||||
ENABLE_STANDALONE_MODE="${ENABLE_STANDALONE_MODE:-true}"
|
||||
DEFAULT_INSTALL_NAMESPACE=${DEFAULT_INSTALL_NAMESPACE:-default}
|
||||
GREPTIMEDB_IMAGE_TAG=${GREPTIMEDB_IMAGE_TAG:-latest}
|
||||
GREPTIMEDB_OPERATOR_IMAGE_TAG=${GREPTIMEDB_OPERATOR_IMAGE_TAG:-v0.5.1}
|
||||
GREPTIMEDB_INITIALIZER_IMAGE_TAG="${GREPTIMEDB_OPERATOR_IMAGE_TAG}"
|
||||
GREPTIME_CHART="https://greptimeteam.github.io/helm-charts/"
|
||||
ETCD_CHART="oci://registry-1.docker.io/bitnamicharts/etcd"
|
||||
ETCD_CHART_VERSION="${ETCD_CHART_VERSION:-12.0.8}"
|
||||
@@ -60,11 +58,9 @@ function deploy_greptimedb_operator() {
|
||||
# Use the latest chart and image.
|
||||
helm upgrade --install greptimedb-operator greptime/greptimedb-operator \
|
||||
--create-namespace \
|
||||
--set image.tag="$GREPTIMEDB_OPERATOR_IMAGE_TAG" \
|
||||
-n "$DEFAULT_INSTALL_NAMESPACE"
|
||||
|
||||
# Wait for greptimedb-operator to be ready.
|
||||
kubectl rollout status deployment/greptimedb-operator -n "$DEFAULT_INSTALL_NAMESPACE"
|
||||
-n "$DEFAULT_INSTALL_NAMESPACE" \
|
||||
--wait \
|
||||
--wait-for-jobs
|
||||
}
|
||||
|
||||
# Deploy greptimedb cluster by using local storage.
|
||||
@@ -80,7 +76,6 @@ function deploy_greptimedb_cluster() {
|
||||
helm upgrade --install "$cluster_name" greptime/greptimedb-cluster \
|
||||
--create-namespace \
|
||||
--set image.tag="$GREPTIMEDB_IMAGE_TAG" \
|
||||
--set initializer.tag="$GREPTIMEDB_INITIALIZER_IMAGE_TAG" \
|
||||
--set "meta.backendStorage.etcd.endpoints[0]=etcd.$install_namespace.svc.cluster.local:2379" \
|
||||
--set meta.backendStorage.etcd.storeKeyPrefix="$cluster_name" \
|
||||
-n "$install_namespace"
|
||||
@@ -97,12 +92,30 @@ function deploy_greptimedb_cluster() {
|
||||
fi
|
||||
done
|
||||
|
||||
# Expose greptimedb cluster to local access.
|
||||
# Expose greptimedb cluster to local access and check if port-forward is available.
|
||||
kubectl -n "$install_namespace" port-forward svc/"$cluster_name"-frontend \
|
||||
14000:4000 \
|
||||
14001:4001 \
|
||||
14002:4002 \
|
||||
14003:4003 > /tmp/connections.out &
|
||||
14003:4003 > /tmp/connections.out 2>&1 &
|
||||
PORT_FORWARD_PID=$!
|
||||
|
||||
# Wait for the port forward to be ready (checks up to 30 seconds)
|
||||
for i in {1..30}; do
|
||||
if nc -z localhost 14000 && nc -z localhost 14001 && nc -z localhost 14002 && nc -z localhost 14003; then
|
||||
echo "Port forward is available."
|
||||
break
|
||||
fi
|
||||
if ! kill -0 $PORT_FORWARD_PID 2>/dev/null; then
|
||||
echo "Port forward process exited unexpectedly."
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
if [ "$i" -eq 30 ]; then
|
||||
echo "Port forward did not become available in time."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Deploy greptimedb cluster by using S3.
|
||||
@@ -118,7 +131,6 @@ function deploy_greptimedb_cluster_with_s3_storage() {
|
||||
helm upgrade --install "$cluster_name" greptime/greptimedb-cluster -n "$install_namespace" \
|
||||
--create-namespace \
|
||||
--set image.tag="$GREPTIMEDB_IMAGE_TAG" \
|
||||
--set initializer.tag="$GREPTIMEDB_INITIALIZER_IMAGE_TAG" \
|
||||
--set "meta.backendStorage.etcd.endpoints[0]=etcd.$install_namespace.svc.cluster.local:2379" \
|
||||
--set meta.backendStorage.etcd.storeKeyPrefix="$cluster_name" \
|
||||
--set objectStorage.s3.bucket="$AWS_CI_TEST_BUCKET" \
|
||||
|
||||
Reference in New Issue
Block a user