@@ -258,7 +258,7 @@ def buildImage(config, imageKeyToTag)
258
258
// Step 2: Build the images
259
259
stage (" Install packages" ) {
260
260
sh " pwd && ls -alh"
261
- sh " env"
261
+ sh " env | sort "
262
262
sh " apk add make git"
263
263
sh " git config --global --add safe.directory '*'"
264
264
@@ -281,23 +281,31 @@ def buildImage(config, imageKeyToTag)
281
281
try {
282
282
def build_jobs = BUILD_JOBS
283
283
// Fix the triton image pull timeout issue
284
- def TRITON_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep 'ARG TRITON_IMAGE=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
285
- def TRITON_BASE_TAG = sh(script : " cd ${ LLM_ROOT} && grep 'ARG TRITON_BASE_TAG=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
284
+ def BASE_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep '^ARG BASE_IMAGE=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
285
+ def TRITON_IMAGE = sh(script : " cd ${ LLM_ROOT} && grep '^ARG TRITON_IMAGE=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
286
+ def TRITON_BASE_TAG = sh(script : " cd ${ LLM_ROOT} && grep '^ARG TRITON_BASE_TAG=' docker/Dockerfile.multi | grep -o '=.*' | tr -d '=\" '" , returnStdout : true ). trim()
287
+
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/" )
286
295
287
296
if (dependent) {
288
297
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
+ def randomSleep = (Math . random() * 300 + 300 ). toInteger()
299
+ trtllm_utils. llmExecStepWithRetry(this , script : " docker pull ${ TRITON_IMAGE} :${ TRITON_BASE_TAG} " , sleepInSecs : randomSleep, shortCommondRunTimeMax : 7200 )
300
+ trtllm_utils. llmExecStepWithRetry(this , script : """
301
+ cd ${ LLM_ROOT} && make -C docker ${ dependent.target} _${ action} \
302
+ BASE_IMAGE=${ BASE_IMAGE} \
303
+ TRITON_IMAGE=${ TRITON_IMAGE} \
304
+ TORCH_INSTALL_TYPE=${ torchInstallType} \
305
+ IMAGE_WITH_TAG=${ dependentImageWithTag} \
306
+ STAGE=${ dependent.dockerfileStage} \
307
+ BUILD_WHEEL_OPTS='-j ${ build_jobs} ' ${ args}
308
+ """ , sleepInSecs : randomSleep, numRetries : 3 , shortCommondRunTimeMax : 7200 )
301
309
args + = " DEVEL_IMAGE=${ dependentImageWithTag} "
302
310
if (target == " ngc-release" ) {
303
311
imageKeyToTag[" NGC Devel Image ${ config.arch} " ] = dependentImageWithTag
@@ -315,18 +323,18 @@ def buildImage(config, imageKeyToTag)
315
323
}
316
324
}
317
325
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
- }
326
+ sh " env | sort "
327
+ def randomSleep = ( Math . random() * 300 + 300 ) . toInteger()
328
+ trtllm_utils . llmExecStepWithRetry( this , script : " docker pull ${ TRITON_IMAGE } : ${ TRITON_BASE_TAG } " , sleepInSecs : randomSleep, shortCommondRunTimeMax : 7200 )
329
+ trtllm_utils . llmExecStepWithRetry( this , script : """
330
+ cd ${ LLM_ROOT } && make -C docker ${ target } _ ${ action } \
331
+ BASE_IMAGE= ${ BASE_IMAGE } \
332
+ TRITON_IMAGE =${ TRITON_IMAGE } \
333
+ TORCH_INSTALL_TYPE =${ torchInstallType } \
334
+ IMAGE_WITH_TAG =${ imageWithTag } \
335
+ STAGE= ${ dockerfileStage } \
336
+ BUILD_WHEEL_OPTS='-j ${ build_jobs } ' ${ args }
337
+ """ , sleepInSecs : randomSleep, numRetries : 3 , shortCommondRunTimeMax : 7200 )
330
338
if (target == " ngc-release" ) {
331
339
imageKeyToTag[" NGC Release Image ${ config.arch} " ] = imageWithTag
332
340
}
@@ -336,6 +344,8 @@ def buildImage(config, imageKeyToTag)
336
344
stage (" custom tag: ${ customTag} (${ arch} )" ) {
337
345
sh """
338
346
cd ${ LLM_ROOT} && make -C docker ${ target} _${ action} \
347
+ BASE_IMAGE=${ BASE_IMAGE} \
348
+ TRITON_IMAGE=${ TRITON_IMAGE} \
339
349
TORCH_INSTALL_TYPE=${ torchInstallType} \
340
350
IMAGE_WITH_TAG=${ customImageWithTag} \
341
351
STAGE=${ dockerfileStage} \
0 commit comments