diff --git a/jenkins/opensearch-dashboards/distribution-build.jenkinsfile b/jenkins/opensearch-dashboards/distribution-build.jenkinsfile index f1435540dc..1462aa2075 100644 --- a/jenkins/opensearch-dashboards/distribution-build.jenkinsfile +++ b/jenkins/opensearch-dashboards/distribution-build.jenkinsfile @@ -872,44 +872,55 @@ pipeline { } } } - } - } - stage('docker build') { - when { - beforeAgent true - allOf { - expression { - params.BUILD_DOCKER != 'do_not_build_docker' + stage('docker build') { + when { + beforeAgent true + allOf { + expression { + params.BUILD_DOCKER != 'do_not_build_docker' + } + expression { + params.BUILD_PLATFORM.contains('linux') + } + expression { + params.BUILD_DISTRIBUTION.contains('tar') + } + } } - expression { - params.BUILD_PLATFORM.contains('linux') + options { + timeout(time: 90, unit: 'MINUTES') } - expression { - params.BUILD_DISTRIBUTION.contains('tar') + agent { + docker { + label AGENT_LINUX_X64 + image dockerAgent.image + args dockerAgent.args + registryUrl 'https://public.ecr.aws/' + alwaysPull true + } } - } - } - agent { - docker { - label AGENT_LINUX_X64 - image dockerAgent.image - args dockerAgent.args - registryUrl 'https://public.ecr.aws/' - alwaysPull true - } - } - steps { - script { - echo "env.ARTIFACT_URL_LINUX_X64_TAR: ${env.ARTIFACT_URL_LINUX_X64_TAR}" - echo "env.ARTIFACT_URL_LINUX_ARM64_TAR: ${env.ARTIFACT_URL_LINUX_ARM64_TAR}" + steps { + script { + while(true) { + if (env.ARTIFACT_URL_LINUX_X64_TAR != null && env.ARTIFACT_URL_LINUX_ARM64_TAR != null) { + echo "env.ARTIFACT_URL_LINUX_X64_TAR: ${env.ARTIFACT_URL_LINUX_X64_TAR}" + echo "env.ARTIFACT_URL_LINUX_ARM64_TAR: ${env.ARTIFACT_URL_LINUX_ARM64_TAR}" - buildDockerImage( - inputManifest: "manifests/${INPUT_MANIFEST}", - buildNumber: "${BUILD_NUMBER}", - buildOption: "${BUILD_DOCKER}", - artifactUrlX64: env.ARTIFACT_URL_LINUX_X64_TAR, - artifactUrlArm64: env.ARTIFACT_URL_LINUX_ARM64_TAR - ) + buildDockerImage( + inputManifest: "manifests/${INPUT_MANIFEST}", + buildNumber: "${BUILD_NUMBER}", + buildOption: "${BUILD_DOCKER}", + artifactUrlX64: env.ARTIFACT_URL_LINUX_X64_TAR, + artifactUrlArm64: env.ARTIFACT_URL_LINUX_ARM64_TAR + ) + break + } else { + echo "Waiting for x64 and arm64 tar builds to complete, sleeping 120 seconds..." + sleep(time: 120, unit: 'SECONDS') + } + } + } + } } } } diff --git a/jenkins/opensearch/distribution-build.jenkinsfile b/jenkins/opensearch/distribution-build.jenkinsfile index 543d972fc3..9b5e2d7e10 100644 --- a/jenkins/opensearch/distribution-build.jenkinsfile +++ b/jenkins/opensearch/distribution-build.jenkinsfile @@ -659,7 +659,7 @@ pipeline { expression { params.BUILD_DISTRIBUTION.contains('deb') } - + } agent { label AGENT_LINUX_ARM64 } stages { @@ -834,41 +834,53 @@ pipeline { } } } - } - } - stage('docker build') { - when { - beforeAgent true - allOf { - expression { - params.BUILD_DOCKER != 'do_not_build_docker' + stage('docker build') { + when { + beforeAgent true + allOf { + expression { + params.BUILD_DOCKER != 'do_not_build_docker' + } + expression { + params.BUILD_PLATFORM.contains('linux') + } + } } - expression { - params.BUILD_PLATFORM.contains('linux') + options { + timeout(time: 90, unit: 'MINUTES') + } + agent { + docker { + label AGENT_LINUX_X64 + image dockerAgent.image + args dockerAgent.args + registryUrl 'https://public.ecr.aws/' + alwaysPull true + } + } + steps { + script { + while (true){ + if (env.ARTIFACT_URL_LINUX_X64_TAR != null && env.ARTIFACT_URL_LINUX_ARM64_TAR != null) { + echo "env.ARTIFACT_URL_LINUX_X64_TAR: ${env.ARTIFACT_URL_LINUX_X64_TAR}" + echo "env.ARTIFACT_URL_LINUX_ARM64_TAR: ${env.ARTIFACT_URL_LINUX_ARM64_TAR}" + buildDockerImage( + inputManifest: "manifests/${INPUT_MANIFEST}", + buildNumber: "${BUILD_NUMBER}", + buildOption: "${BUILD_DOCKER}", + artifactUrlX64: env.ARTIFACT_URL_LINUX_X64_TAR, + artifactUrlArm64: env.ARTIFACT_URL_LINUX_ARM64_TAR + ) + break + } else { + echo "Waiting for x64 and arm64 tar builds to complete, sleeping 120 seconds..." + sleep(time: 120, unit: 'SECONDS') + + } + } + + } } - } - } - agent { - docker { - label AGENT_LINUX_X64 - image dockerAgent.image - args dockerAgent.args - registryUrl 'https://public.ecr.aws/' - alwaysPull true - } - } - steps { - script { - echo "env.ARTIFACT_URL_LINUX_X64_TAR: ${env.ARTIFACT_URL_X64_TAR}" - echo "env.ARTIFACT_URL_LINUX_ARM64_TAR: ${env.ARTIFACT_URL_ARM64_TAR}" - - buildDockerImage( - inputManifest: "manifests/${INPUT_MANIFEST}", - buildNumber: "${BUILD_NUMBER}", - buildOption: "${BUILD_DOCKER}", - artifactUrlX64: env.ARTIFACT_URL_LINUX_X64_TAR, - artifactUrlArm64: env.ARTIFACT_URL_LINUX_ARM64_TAR - ) } } } @@ -896,7 +908,7 @@ pipeline { } postCleanup() } - + } } success {