From 2b9b880ab0f1dacaeb03b0e1b45b5d9f60f2a470 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Wed, 3 Jan 2024 19:55:16 -0500 Subject: [PATCH] jenkins: lock "pc" label to limit concurrent workers (#30902) * lock pc label * remove that old-commit-hash: 4430944b2966d0bcdf54357dfdfafacf24e6de32 --- Jenkinsfile | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5c872664a2..0ae5f5076d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -110,18 +110,20 @@ def pcStage(String stageName, Closure body) { return docker.build("openpilot-base:build-${env.GIT_COMMIT}", "-f Dockerfile.openpilot_base .") } - openpilot_base.inside(dockerArgs) { - timeout(time: 20, unit: 'MINUTES') { - try { - retryWithDelay (3, 15) { - sh "git config --global --add safe.directory '*'" - sh "git submodule update --init --recursive" - sh "git lfs pull" - } - body() - } finally { - sh "rm -rf ${env.WORKSPACE}/* || true" - sh "rm -rf .* || true" + lock(resource: "", label: 'pc', inversePrecedence: true, quantity: 1) { + openpilot_base.inside(dockerArgs) { + timeout(time: 20, unit: 'MINUTES') { + try { + retryWithDelay (3, 15) { + sh "git config --global --add safe.directory '*'" + sh "git submodule update --init --recursive" + sh "git lfs pull" + } + body() + } finally { + sh "rm -rf ${env.WORKSPACE}/* || true" + sh "rm -rf .* || true" + } } } }