You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ar...@apache.org on 2022/05/12 23:21:49 UTC

[tvm] branch areusch/freeze-dependencies updated (73bfb9992e -> 0a32daac86)

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

areusch pushed a change to branch areusch/freeze-dependencies
in repository https://gitbox.apache.org/repos/asf/tvm.git


    omit 73bfb9992e build arch images in Jenkins
     new 788e5b4b53 build arch images in Jenkins
     new 0a32daac86 Fix unbound variable error

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (73bfb9992e)
            \
             N -- N -- N   refs/heads/areusch/freeze-dependencies (0a32daac86)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docker/build-base-images.sh | 2 +-
 jenkins/Jenkinsfile.j2      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


[tvm] 02/02: Fix unbound variable error

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0a32daac86efa00e770318e301f80c78205148ea
Author: Andrew Reusch <ar...@gmail.com>
AuthorDate: Thu May 12 16:21:36 2022 -0700

    Fix unbound variable error
---
 docker/build-base-images.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docker/build-base-images.sh b/docker/build-base-images.sh
index 8cfb1dd480..84366c4880 100755
--- a/docker/build-base-images.sh
+++ b/docker/build-base-images.sh
@@ -3,7 +3,7 @@
 # Build base images (one per Python architecture) used in building the remaining TVM docker images.
 set -eux
 
-IMAGES=( )
+declare -a IMAGES
 while [ "${1+x}" == "x" ]; do
     IMAGES=( "${IMAGES[@]}" "$(dirname $0)/Dockerfile.base_$1" )
     shift


[tvm] 01/02: build arch images in Jenkins

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 788e5b4b53b5167fd4935f4a0824739683517036
Author: Andrew Reusch <ar...@gmail.com>
AuthorDate: Thu May 12 15:52:18 2022 -0700

    build arch images in Jenkins
---
 Jenkinsfile            | 155 +++++++++++++++++++++++++++++++++----------------
 jenkins/Jenkinsfile.j2 |  86 +++++++++------------------
 jenkins/generate.py    |  15 ++++-
 3 files changed, 144 insertions(+), 112 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 5978bb69ba..6ffd9fe0aa 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-11T16:27:38.745360
+// Generated at 2022-05-12T16:16:50.543658
 
 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 // NOTE: these lines are scanned by docker/dev_common.sh. Please update the regex as needed. -->
@@ -323,12 +323,27 @@ stage('Lint') {
 // a method (so the code can't all be inlined)
 lint()
 
-def build_image(image_name) {
+def build_base_image(arch_name) {
+  hash = sh(
+    returnStdout: true,
+    script: 'git log -1 --format=\'%h\''
+  ).trim()
+  sh(
+    script: 'docker/build-base-images.sh ${arch_name}',
+    label: 'Build base image for ${arch_name}'
+  )
+  archiveArtifacts artifacts: 'docker/build/base_${arch_name}/**', fingerprint: true
+  def files = findFiles(glob: 'docker/build/base_${arch_name}/**')
+  pack_lib('${arch_name}-lockfiles', files.join(', '))
+}
+
+def build_image(arch_name, image_name) {
   hash = sh(
     returnStdout: true,
     script: 'git log -1 --format=\'%h\''
   ).trim()
   def full_name = "${image_name}:${env.BRANCH_NAME}-${hash}-${env.BUILD_NUMBER}"
+  unpack_lib('${arch_name}-lockfiles')
   sh(
     script: "${docker_build} ${image_name} --spec ${full_name}",
     label: 'Build docker image'
@@ -380,64 +395,102 @@ def build_image(image_name) {
 
 if (rebuild_docker_images) {
   stage('Docker Image Build') {
+
     // TODO in a follow up PR: Find ecr tag and use in subsequent builds
-    parallel 'ci-lint': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_lint')
+    parallel(
+       'arm64': {
+        node('ARM') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_base_image('arm64')
+          }
         }
-      }
-    }, 'ci-cpu': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_cpu')
+      },
+       'x86': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_base_image('x86')
+          }
         }
-      }
-    }, 'ci-gpu': {
-      node('GPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_gpu')
+      },
+       'x86_64': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_base_image('x86_64')
+          }
         }
-      }
-    }, 'ci-qemu': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_qemu')
+      },
+    )
+
+    parallel(
+      'ci_arm': {
+        node('ARM') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('arm64', 'ci_arm')
+          }
         }
-      }
-    }, 'ci-i386': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_i386')
+      },
+      'ci_cpu': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_cpu')
+          }
         }
-      }
-    }, 'ci-arm': {
-      node('ARM') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_arm')
+      },
+      'ci_gpu': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_gpu')
+          }
         }
-      }
-    }, 'ci-wasm': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_wasm')
+      },
+      'ci_hexagon': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_hexagon')
+          }
         }
-      }
-    }, 'ci-hexagon': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_hexagon')
+      },
+      'ci_i386': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86', 'ci_i386')
+          }
         }
-      }
-    }
+      },
+      'ci_lint': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_lint')
+          }
+        }
+      },
+      'ci_qemu': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_qemu')
+          }
+        }
+      },
+      'ci_wasm': {
+        node('CPU') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('x86_64', 'ci_wasm')
+          }
+        }
+      },
+    )
+
   }
   // // TODO: Once we are able to use the built images, enable this step
   // // If the docker images changed, we need to run the image build before the lint
diff --git a/jenkins/Jenkinsfile.j2 b/jenkins/Jenkinsfile.j2
index 14cd099420..84015dde2c 100644
--- a/jenkins/Jenkinsfile.j2
+++ b/jenkins/Jenkinsfile.j2
@@ -246,9 +246,9 @@ def build_base_image(arch_name) {
     script: 'git log -1 --format=\'%h\''
   ).trim()
   sh(
-    script: 'docker/build-base-images.sh ${arch_name}',
-    label: 'Build base image for ${arch_name}'
-  }
+    script: "docker/build-base-images.sh ${arch_name}",
+    label: "Build base image for ${arch_name}"
+  )
   archiveArtifacts artifacts: 'docker/build/base_${arch_name}/**', fingerprint: true
   def files = findFiles(glob: 'docker/build/base_${arch_name}/**')
   pack_lib('${arch_name}-lockfiles', files.join(', '))
@@ -312,64 +312,34 @@ def build_image(arch_name, image_name) {
 
 if (rebuild_docker_images) {
   stage('Docker Image Build') {
+
     // TODO in a follow up PR: Find ecr tag and use in subsequent builds
-    parallel 'ci-lint': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_lint')
-        }
-      }
-    }, 'ci-cpu': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_cpu')
-        }
-      }
-    }, 'ci-gpu': {
-      node('GPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_gpu')
-        }
-      }
-    }, 'ci-qemu': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_qemu')
-        }
-      }
-    }, 'ci-i386': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_i386')
-        }
-      }
-    }, 'ci-arm': {
-      node('ARM') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_arm')
-        }
-      }
-    }, 'ci-wasm': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_wasm')
+    parallel(
+    {% for arch, img in nodes_by_arch(images) %}
+      {{ ' ' }}'{{ arch }}': {
+        node('{{ img.platform }}') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_base_image('{{ arch }}')
+          }
         }
-      }
-    }, 'ci-hexagon': {
-      node('CPU') {
-        timeout(time: max_time, unit: 'MINUTES') {
-          init_git()
-          build_image('ci_hexagon')
+      },
+    {% endfor %}
+    )
+
+    parallel(
+    {% for image in images %}
+      '{{ image.name }}': {
+        node('{{ image.platform }}') {
+          timeout(time: max_time, unit: 'MINUTES') {
+            init_git()
+            build_image('{{ image.arch }}', '{{ image.name }}')
+          }
         }
-      }
-    }
+      },
+    {% endfor %}
+    )
+
   }
   // // TODO: Once we are able to use the built images, enable this step
   // // If the docker images changed, we need to run the image build before the lint
diff --git a/jenkins/generate.py b/jenkins/generate.py
index ba7f165925..002bd64bdf 100644
--- a/jenkins/generate.py
+++ b/jenkins/generate.py
@@ -34,37 +34,46 @@ data = {
     "images": [
         {
             "name": "ci_arm",
+            "arch": "arm64",
             "platform": "ARM",
         },
         {
             "name": "ci_cpu",
+            "arch": "x86_64",
             "platform": "CPU",
         },
         {
             "name": "ci_gpu",
+            "arch": "x86_64",
             "platform": "CPU",
         },
         {
             "name": "ci_hexagon",
+            "arch": "x86_64",
             "platform": "CPU",
         },
         {
             "name": "ci_i386",
+            "arch": "x86",
             "platform": "CPU",
         },
         {
             "name": "ci_lint",
+            "arch": "x86_64",
             "platform": "CPU",
         },
         {
             "name": "ci_qemu",
+            "arch": "x86_64",
             "platform": "CPU",
         },
         {
             "name": "ci_wasm",
+            "arch": "x86_64",
             "platform": "CPU",
         },
-    ]
+    ],
+    'nodes_by_arch': lambda images: dict(sorted([(img['arch'], img) for img in images], key=lambda k: k[0])).items()
 }
 
 
@@ -111,10 +120,10 @@ if __name__ == "__main__":
                 Newly generated Jenkinsfile did not match the one on disk! If you have made
                 edits to the Jenkinsfile, move them to 'jenkins/Jenkinsfile.j2' and
                 regenerate the Jenkinsfile from the template with
-                
+
                     python3 -m pip install -r jenkins/requirements.txt
                     python3 jenkins/generate.py
-                
+
                 Diffed changes:
             """
                 ).strip()