@@ -281,23 +281,30 @@ def buildImage(config, imageKeyToTag)
281281 try {
282282 def build_jobs = BUILD_JOBS
283283 // Fix the triton image pull timeout issue
284+ def BASE_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep 'ARG BASE_IMAGE=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
284285 def TRITON_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep 'ARG TRITON_IMAGE=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
285286 def TRITON_BASE_TAG = sh(script : " cd ${ LLM_ROOT} && grep 'ARG TRITON_BASE_TAG=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
286287
288+ if (target == " rockylinux8" ) {
289+ BASE_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep 'jenkins-rockylinux8_%: BASE_IMAGE =' docker/Makefile | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
290+ }
291+
292+ // Replace the base image and triton image with the internal mirror
293+ BASE_IMAGE = BASE_IMAGE . replace(" nvcr.io/" , " urm.nvidia.com/docker/" )
294+ TRITON_IMAGE = TRITON_IMAGE . replace(" nvcr.io/" , " urm.nvidia.com/docker/" )
295+
287296 if (dependent) {
288297 stage (" make ${ dependent.target} _${ action} (${ arch} )" ) {
289- retry(3 ) {
290- sh " docker pull ${ TRITON_IMAGE} :${ TRITON_BASE_TAG} "
291- }
292- retry(3 ) {
293- sh """
294- cd ${ LLM_ROOT} && make -C docker ${ dependent.target} _${ action} \
295- TORCH_INSTALL_TYPE=${ torchInstallType} \
296- IMAGE_WITH_TAG=${ dependentImageWithTag} \
297- STAGE=${ dependent.dockerfileStage} \
298- BUILD_WHEEL_OPTS='-j ${ build_jobs} ' ${ args}
299- """
300- }
298+ trtllm_utils. llmExecStepWithRetry(this , script : " docker pull ${ TRITON_IMAGE} :${ TRITON_BASE_TAG} " , sleepInSecs : 300 , shortCommondRunTimeMax : 7200 )
299+ trtllm_utils. llmExecStepWithRetry(this , script : """
300+ cd ${ LLM_ROOT} && make -C docker ${ dependent.target} _${ action} \
301+ BASE_IMAGE=${ BASE_IMAGE} \
302+ TRITON_IMAGE=${ TRITON_IMAGE} \
303+ TORCH_INSTALL_TYPE=${ torchInstallType} \
304+ IMAGE_WITH_TAG=${ dependentImageWithTag} \
305+ STAGE=${ dependent.dockerfileStage} \
306+ BUILD_WHEEL_OPTS='-j ${ build_jobs} ' ${ args}
307+ """ , sleepInSecs : 300 , shortCommondRunTimeMax : 7200 )
301308 args + = " DEVEL_IMAGE=${ dependentImageWithTag} "
302309 if (target == " ngc-release" ) {
303310 imageKeyToTag[" NGC Devel Image ${ config.arch} " ] = dependentImageWithTag
@@ -315,18 +322,16 @@ def buildImage(config, imageKeyToTag)
315322 }
316323 }
317324 stage (" make ${ target} _${ action} (${ arch} )" ) {
318- retry(3 ) {
319- sh " docker pull ${ TRITON_IMAGE} :${ TRITON_BASE_TAG} "
320- }
321- retry(3 ) {
322- sh """
323- cd ${ LLM_ROOT} && make -C docker ${ target} _${ action} \
324- TORCH_INSTALL_TYPE=${ torchInstallType} \
325- IMAGE_WITH_TAG=${ imageWithTag} \
326- STAGE=${ dockerfileStage} \
327- BUILD_WHEEL_OPTS='-j ${ build_jobs} ' ${ args}
328- """
329- }
325+ trtllm_utils. llmExecStepWithRetry(this , script : " docker pull ${ TRITON_IMAGE} :${ TRITON_BASE_TAG} " , sleepInSecs : 300 , shortCommondRunTimeMax : 7200 )
326+ trtllm_utils. llmExecStepWithRetry(this , script : """
327+ cd ${ LLM_ROOT} && make -C docker ${ target} _${ action} \
328+ BASE_IMAGE=${ BASE_IMAGE} \
329+ TRITON_IMAGE=${ TRITON_IMAGE} \
330+ TORCH_INSTALL_TYPE=${ torchInstallType} \
331+ IMAGE_WITH_TAG=${ imageWithTag} \
332+ STAGE=${ dockerfileStage} \
333+ BUILD_WHEEL_OPTS='-j ${ build_jobs} ' ${ args}
334+ """ , sleepInSecs : 300 , shortCommondRunTimeMax : 7200 )
330335 if (target == " ngc-release" ) {
331336 imageKeyToTag[" NGC Release Image ${ config.arch} " ] = imageWithTag
332337 }
@@ -336,6 +341,8 @@ def buildImage(config, imageKeyToTag)
336341 stage (" custom tag: ${ customTag} (${ arch} )" ) {
337342 sh """
338343 cd ${ LLM_ROOT} && make -C docker ${ target} _${ action} \
344+ BASE_IMAGE=${ BASE_IMAGE} \
345+ TRITON_IMAGE=${ TRITON_IMAGE} \
339346 TORCH_INSTALL_TYPE=${ torchInstallType} \
340347 IMAGE_WITH_TAG=${ customImageWithTag} \
341348 STAGE=${ dockerfileStage} \
0 commit comments