Add ability to skip entire job if cache key exists

I have several jobs that are prerequisites for other jobs. These jobs are used to set up baseline caches for the all of the following jobs, such as installing/updating dependencies. 99% of the time none of the dependencies have changed, so running the job is not necessary at all. However, there is overhead every time the job is run:

  1. "Spin up environment" can take 30-60s+ as the Docker image cache is not always consistent.

  2. Restoring a large cache can take 10s+

That is 40-70s+ wasted when a simple presence check on the cache would allow the entire job to be skipped.

Suggestion

I suggest adding a skip_if_cache_exists or similar entry to the job configuration. Example:

skip_if_cache_exists: source-v1-{{ .Branch }}-{{ .Revision }}

This would allow the job to be skipped entirely, avoiding any unnecessary overhead of spinning up the container and restoring caches.

  • Guest
  • Apr 7 2020
  • Taking votes
  • Attach files
  • Christian Mühlbacher commented
    25 Apr 03:42pm

    Nr.: /bin/bash

    Nr.: /bin/bash

    circleci config pack src > orb.yml

    circleci orb publish orb.yml circleci/gcp-cli@dev:alpha

    rm -rf orb.yml

  • and 20 more