同时执行超过 5 个 docker 镜像时,Jenkins 会抛出超时

问题描述 投票:0回答:1

基本上,我有一个主作业,在该作业上并行运行其他作业。但对于其中一些我会超时。

docker run -t -d -u 1000:1000 -u root docker_image cat
17:39:17  ERROR: Timeout after 180 seconds

基本上,主要的工作groovy脚本如下所示:

node ("main"){
    stage("Stage 1") {
        catchError(buildResult: "SUCCESS", stageResult: "SUCCESS") {
            step([$class: 'WsCleanup'])
            script {
                // Other operations
                jobsToRun = [:]
                parallel jobsToRun.collectEntries { jobName ->
                    ["Running $jobName": {
                        build_job(params)
                    }]
                }
            }
        }
    }
}

在其他 CI 工作中我有这个:

pipeline {
    agent none
    stages {
        stage("Stage 1") {
            agent {
                docker {
                    image "docker_image"
                    registryUrl "registry_url"
                    registryCredentialsId "creds1"
                    alwaysPull   true
                    args "-u root --network web"
                }
            }
            steps {
                // Other operations
            }
        }
    }
}

有办法防止这种超时吗?

jenkins groovy jenkins-pipeline jenkins-groovy
1个回答
0
投票

你找到解决办法了吗?我也有同样的问题。

© www.soinside.com 2019 - 2024. All rights reserved.