From b334f1977b6826fefeb0a11f7576af36ae09e80d Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 2 Dec 2021 17:52:44 +0100 Subject: [PATCH] Add delay and timeout to image pull job Signed-off-by: Evan Lezar --- .nvidia-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.nvidia-ci.yml b/.nvidia-ci.yml index 9f34aa7d..09c9a6f0 100644 --- a/.nvidia-ci.yml +++ b/.nvidia-ci.yml @@ -46,6 +46,18 @@ variables: OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}" OUT_REGISTRY: "${CI_REGISTRY}" OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/container-toolkit" + # We delay the job start to allow the public pipeline to generate the required images. + when: delayed + start_in: 30 minutes + timeout: 30 minutes + retry: + max: 2 + when: + - job_execution_timeout + - stuck_or_timeout_failure + before_script: + - > + docker pull ${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST} > /dev/null && echo "${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST}" || ( echo "${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST} does not exist" && sleep infinity ) script: - docker pull ${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST} - docker tag ${IN_REGISTRY}/${IN_IMAGE_NAME}:${IN_VERSION}-${DIST} ${OUT_IMAGE_NAME}:${CI_COMMIT_SHORT_SHA}-${DIST}