From 6ae517c370e2479d1abbfa8c3e20de9fb2ea5ec0 Mon Sep 17 00:00:00 2001 From: Birol Bilgin Date: Wed, 31 May 2023 14:46:06 +0200 Subject: [PATCH] gh/workflow: change multicluster provisioning to none blocking mode Multicluster test set up two clusters in blocking mode in sequentially. Every cluster provisioning takes 4 to 5 min. This commit changes provisioning to none blocking mode and adds a step to wait for provisioning to finish. This change would cut the run time by 4 to 5 min. Signed-off-by: Birol Bilgin --- .github/workflows/multicluster.yaml | 30 ++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/multicluster.yaml b/.github/workflows/multicluster.yaml index 9c3b2e7962..479bfdf5b3 100644 --- a/.github/workflows/multicluster.yaml +++ b/.github/workflows/multicluster.yaml @@ -119,16 +119,8 @@ jobs: --disk-type pd-standard \ --disk-size 10GB \ --node-taints node.cilium.io/agent-not-ready=true:NoExecute \ - --preemptible - - - name: Get cluster 2 credentials - run: | - gcloud container clusters get-credentials ${{ env.clusterName2 }} --zone ${{ env.zone }} - - - name: Create gcloud-free kubeconfig for cluster 2 - run: | - .github/get-kubeconfig.sh - mv kubeconfig kubeconfig-cluster2 + --preemptible \ + --async - name: Create GKE cluster 1 run: | @@ -145,7 +137,23 @@ jobs: --disk-type pd-standard \ --disk-size 10GB \ --node-taints node.cilium.io/agent-not-ready=true:NoExecute \ - --preemptible + --preemptible \ + --async + + - name: Wait for clusters to be provisioned + run: | + while [ "$(gcloud container operations list --filter="status=RUNNING AND targetLink~${{ env.clusterNameBase }}" --format="value(name)")" ];do + echo "cluster has an ongoing operation, waiting for all operations to finish"; sleep 10 + done + + - name: Get cluster 2 credentials + run: | + gcloud container clusters get-credentials ${{ env.clusterName2 }} --zone ${{ env.zone }} + + - name: Create gcloud-free kubeconfig for cluster 2 + run: | + .github/get-kubeconfig.sh + mv kubeconfig kubeconfig-cluster2 - name: Get cluster 1 credentials run: |