Cache in tekton pipelines
The idea of this article is to explore the different ways to “handle” cache when using
tektoncd/pipeline
or openshift-pipelines. This should evolve as time passes as it will
explore what is possible today and what could be done built-in. If someday
tektoncd/pipeline
or any tektoncd component provides this features, this article would
be either adapted or marked as deprecated.
Introduction
Cache and caching are very abstract, wide concept. In the context of a CI pipeline, it
can take several forms depending on what the pipeline and tasks are doing. If we are
building an image, the cache is most likely related to the “base image” and layers re-used
accross multiple builds. If we are building a go project, it could be around fetching
the dependencies (if no vendor
folder) or around build cache (the go compiler cache, to
speed the next compilation).