From 65e71d6f054eda00381ff864514a1663dcbca412 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Tue, 20 Jan 2026 10:59:43 +0800 Subject: [PATCH] fix: fix nightly ci (#7588) * fix: fix nightly ci Signed-off-by: WenyXu * wait for ready Signed-off-by: WenyXu * Update .github/scripts/deploy-greptimedb.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * apply suggesions Signed-off-by: WenyXu --------- Signed-off-by: WenyXu Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/actions/sqlness-test/action.yml | 2 +- .github/scripts/deploy-greptimedb.sh | 34 +++++++++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/actions/sqlness-test/action.yml b/.github/actions/sqlness-test/action.yml index 9764f03a84..004f2b40b1 100644 --- a/.github/actions/sqlness-test/action.yml +++ b/.github/actions/sqlness-test/action.yml @@ -60,7 +60,7 @@ runs: - name: Export kind logs if: failure() shell: bash - run: kind export logs -n greptimedb-operator-e2e /tmp/kind + run: kind export logs /tmp/kind - name: Upload logs if: failure() uses: actions/upload-artifact@v4 diff --git a/.github/scripts/deploy-greptimedb.sh b/.github/scripts/deploy-greptimedb.sh index e915a9b708..92ca440dbd 100755 --- a/.github/scripts/deploy-greptimedb.sh +++ b/.github/scripts/deploy-greptimedb.sh @@ -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" \