Skip to content

Share cache volumes between workers #1987

Closed as not planned
Closed as not planned

Description

@JohannesRudolph

Feature Request

What challenge are you facing?

I'm using concourse 3.8 with the random container placement strategy. The random placement is necessary because we've had too much trouble with "worker gravity" overloading individual workers in our 6-node cluster. Obviously, the random worker placement resulted in decreased hit-rates for task caches.

A Modest Proposal

Task caches are currently local to a worker. I propose that concourse, after a successful build, asynchronously tries to transfer the cache volume using baggageclaim to a central "cache store".

When executing a task and workers fail to find a cache volume locally, they can try to pull one from the central "cache store". Since it's just caches, this behavior can be "bolted on". It's not important that workers retrieve the most recent version of a cache volume from the "cache store" under all circumstances (no locking etc. required), but more important that they receive any version at all.

Activity

  1. JohannesRudolph commented on Mar 31, 2018

    @JohannesRudolph
    ContributorAuthor

    Since the work on spaces has just started #1707, may I also add another scenario: sharing cache volumes between different "variants" of a job or task. We currently repeat many jobs 3 times in our pipeline to serve in build pipelines of different git branches (feature/*, develop, master). This causes us to have a lot more caches than we would need conceptually.

    We use caches primarily to cache gradle and yarn's global package caches, and those could be easily shared between different "incarnations" of a job/task in our pipeline.

    I'm referencing the spaces epic here because this kind of sharing may become a lot easier to implement with spaces.

  2. simonjohansson commented on Jan 29, 2019

    @simonjohansson
    Contributor

    I second this issue.

    We have a lot of pipelines(mostly Java/Scala/Kotlin, so often apps needs to download the universe) and therefore a lot of workers, which will at some point or another get recreated, sometimes every 24h, thus blowing away the cache.

    What we currently do is mount a NFS volume inside all the jobs to use as a cache, that under the hood uses GCP Filestore. Whilst it works it would be much nicer to have Concourse manage the lifecycle of a cache per job rather than us doing gnarly stuff like that.

    Another approach that would require less refactoring but bring value would be to store the caches on a persistent BOSH volume, and keep the db entry when a worker gets recreated/deployed to with new stemcell/etc, this would also work with the Helm chart with persistent volumes I believe.

  3. vito commented on Jan 29, 2019

    @vito
    Contributor

    I think this would actually be pretty cheap to work in to the existing design - we already transfer around caches when a task or put step needs a cache that's not present on the worker already. But then we throw that volume away. If we instead marked it as an equivalent cache, they would warm across the cluster more rapidly.

  4. ddadlani commented on Jul 30, 2019

    @ddadlani
    Contributor

    This is interesting because we have already been discussing this as part of vmware-archive/architecture-rfcs#1 -- treating all artifacts as the same thing would require that we favor streaming caches over to the requisite worker as opposed to downloading new artifacts every time

  5. taylorsilva commented on Jan 6, 2025

    @taylorsilva
    Member

    Issue Bankruptcy

    This issue is being closed as part of 2025's Issue Bankruptcy declaration. See here for details

    If you think this issue still has merit then feel free to open a new issue and reference this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions