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

tqchen pushed a commit to branch jenkins-cleanup-trusted-main
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 8fbae68e13d2e183010a29619e04996fde7acf5d
Author: Tianqi Chen <[email protected]>
AuthorDate: Thu Oct 15 13:57:58 2026 +0000

    [CI] Resolve the Docker Hub cache from the AWS caller account
---
 ci/jenkins/generated/common.groovy | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/ci/jenkins/generated/common.groovy 
b/ci/jenkins/generated/common.groovy
index 8f2792c30f..9cab4eaf09 100644
--- a/ci/jenkins/generated/common.groovy
+++ b/ci/jenkins/generated/common.groovy
@@ -21,6 +21,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
 image_platforms = [ci_arm: 'ARM', ci_cpu: 'CPU', ci_gpu: 'GPU', ci_wasm: 'CPU']
 images = image_platforms.collectEntries { name, platform -> [(name): ''] }
 source_images = [:]
+enable_docker_hub_cache = true
 built_images = [:]
 upstream_revision = null
 max_time = 180
@@ -127,10 +128,7 @@ def init_git() {
 }
 
 // Apply only after Hub selection and job overrides; inputs stay public image 
names.
-def docker_hub_image(image) {
-  def cache = env.DOCKER_HUB_CACHE
-  if (cache == null) cache = 
'477529581014.dkr.ecr.us-west-2.amazonaws.com/docker-hub'
-  cache = cache.trim().replaceAll('/+$', '')
+def docker_hub_image(image, cache) {
   if (!cache || !image) return image
 
   def path = image
@@ -248,9 +246,18 @@ def prepare(node_type) {
             ).trim()
           }
         }
+        def cache = ''
+        if (enable_docker_hub_cache) {
+          def aws_account_id = sh(
+            returnStdout: true,
+            script: 'aws sts get-caller-identity --query Account --output 
text',
+            label: 'Get AWS ID'
+          ).trim()
+          cache = 
"${aws_account_id}.dkr.ecr.us-west-2.amazonaws.com/docker-hub"
+        }
         images.keySet().each { name ->
           source_images[name] = params["${name}_param"] ?: images[name]
-          images[name] = docker_hub_image(source_images[name])
+          images[name] = docker_hub_image(source_images[name], cache)
         }
         sh(
           script: 'echo "Docker images being used in this build:"\n' +

Reply via email to