From bb261219d7854b8fe238a18cb2c4bb23b3367ac6 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Fri, 29 May 2020 20:05:31 -0700 Subject: [PATCH] CI: Prime docker cache in "Docker cache build" job (#18438) Cache priming was previously only handled when using the ./ci/build.py or ./ci/docker_cache.py script. The former is used during most CI jobs. The latter is used for containers not declared in docker-compose.yml during the "Docker cache build" job. More and more containers are declared in docker-compose.yml now, but prior to this commit their cache wasn't primed in the "Docker cache build" job. --- ci/Jenkinsfile_docker_cache | 2 +- ci/jenkins/Jenkins_steps.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile_docker_cache b/ci/Jenkinsfile_docker_cache index 2bf9040912b0..96cf2c7bef86 100644 --- a/ci/Jenkinsfile_docker_cache +++ b/ci/Jenkinsfile_docker_cache @@ -38,7 +38,7 @@ core_logic: { timeout(time: total_timeout, unit: 'MINUTES') { utils.init_git() sh "python3 ./ci/docker_cache.py --docker-registry ${env.DOCKER_CACHE_REGISTRY}" - sh "cd ci && python3 ./docker_login.py --secret-name ${env.DOCKERHUB_SECRET_NAME} && docker-compose -f docker/docker-compose.yml build --parallel && COMPOSE_HTTP_TIMEOUT=600 docker-compose -f docker/docker-compose.yml push && docker logout" + sh "cd ci && python3 ./docker_login.py --secret-name ${env.DOCKERHUB_SECRET_NAME} && docker-compose -f docker/docker-compose.yml pull && docker-compose -f docker/docker-compose.yml build --parallel && COMPOSE_HTTP_TIMEOUT=600 docker-compose -f docker/docker-compose.yml push && docker logout" } } } diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy index 8c8e0da979df..83b2e01d84cb 100644 --- a/ci/jenkins/Jenkins_steps.groovy +++ b/ci/jenkins/Jenkins_steps.groovy @@ -1743,7 +1743,7 @@ def misc_test_docker_cache_build() { ws('workspace/docker_cache') { utils.init_git() sh "python3 ./ci/docker_cache.py --docker-registry ${env.DOCKER_CACHE_REGISTRY} --no-publish" - sh "cd ci && docker-compose -f docker/docker-compose.yml build --parallel" + sh "cd ci && docker-compose -f docker/docker-compose.yml pull && docker-compose -f docker/docker-compose.yml build --parallel" } } }]