This is an automated email from the ASF dual-hosted git repository.

areusch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 903f785d7d [ci] Use smaller ARM nodes for build/test (#11445) (#11457)
903f785d7d is described below

commit 903f785d7dda2b64acca71566ddcbb83f5cd412c
Author: driazati <[email protected]>
AuthorDate: Fri May 27 15:18:28 2022 -0700

    [ci] Use smaller ARM nodes for build/test (#11445) (#11457)
    
    This applies the new instances from 
https://github.com/tlc-pack/ci-terraform/pull/32
    
    Co-authored-by: driazati <[email protected]>
    
    Co-authored-by: driazati <[email protected]>
---
 Jenkinsfile               | 29 +++++++++++++++++++++++------
 jenkins/Prepare.groovy.j2 | 27 ++++++++++++++++++++++-----
 2 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index ad04bf218e..d239d362f9 100755
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -45,7 +45,7 @@
 // 'python3 jenkins/generate.py'
 // Note: This timestamp is here to ensure that updates to the Jenkinsfile are
 // always rebased on main before merging:
-// Generated at 2022-05-24T17:03:03.321649
+// Generated at 2022-05-26T15:43:31.409794
 
 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the 
regex as needed. -->
@@ -136,11 +136,28 @@ def init_git() {
     label: 'Merge to origin/main'
   )
 
-  retry(5) {
-    timeout(time: 2, unit: 'MINUTES') {
-      sh (script: 'git submodule update --init -f', label: 'Update git 
submodules')
-    }
-  }
+  sh(
+    script: '''
+      set -eux
+      n=0
+      max_retries=3
+      backoff_max=30
+      until [ "$n" -ge $max_retries ]
+      do
+          timeout 5m git submodule update --init -f --jobs 0 && break
+          n=$((n+1))
+          if [ "$n" -eq $max_retries ]; then
+              echo "failed to update $n / $max_retries, giving up"
+              exit 1
+          fi
+
+          WAIT=$((RANDOM % "$backoff_max"))
+          echo "failed to update $n / $max_retries, waiting $WAIT to try again"
+          sleep $WAIT
+      done
+    ''',
+    label: 'Update git submodules',
+  )
 }
 
 def should_skip_slow_tests(pr_number) {
diff --git a/jenkins/Prepare.groovy.j2 b/jenkins/Prepare.groovy.j2
index d7bf5e706b..b4db7de63b 100644
--- a/jenkins/Prepare.groovy.j2
+++ b/jenkins/Prepare.groovy.j2
@@ -34,11 +34,28 @@ def init_git() {
     label: 'Merge to origin/main'
   )
 
-  retry(5) {
-    timeout(time: 2, unit: 'MINUTES') {
-      sh (script: 'git submodule update --init -f', label: 'Update git 
submodules')
-    }
-  }
+  sh(
+    script: '''
+      set -eux
+      n=0
+      max_retries=3
+      backoff_max=30
+      until [ "$n" -ge $max_retries ]
+      do
+          timeout 5m git submodule update --init -f --jobs 0 && break
+          n=$((n+1))
+          if [ "$n" -eq $max_retries ]; then
+              echo "failed to update $n / $max_retries, giving up"
+              exit 1
+          fi
+
+          WAIT=$((RANDOM % "$backoff_max"))
+          echo "failed to update $n / $max_retries, waiting $WAIT to try again"
+          sleep $WAIT
+      done
+    ''',
+    label: 'Update git submodules',
+  )
 }
 
 def should_skip_slow_tests(pr_number) {

Reply via email to