Giter Club home page Giter Club logo

Comments (6)

Bilge avatar Bilge commented on May 30, 2024 4

So, basically the whole point of this action doesn't even work?


Edit: NVM works for me lol xD


Edit: Doesn't work for different build types, e.g. cache is not shared between push and PR, even if the PR is for a single commit that was already built.

from action-docker-layer-caching.

japgolly avatar japgolly commented on May 30, 2024 3

Found a fix:

        with:
          key: docker-layer-cache-{hash}
          restore-keys: |
            docker-layer-cache-
            layer-docker-layer-cache-

Turns out that layers are saved with a layer- prefix (see here) that isn't used during cache restoration (see here).

from action-docker-layer-caching.

cscetbon avatar cscetbon commented on May 30, 2024

I was also surprised to see this. In my case I have a run that is triggered by a regular push, then another one when I tag the version. I was expecting the second to not rebuild docker images but it does 🤷‍♂️. They are the same commit so I would expect the cache to work in that case. I'm using docker-compose to build my images.

Run of the push before tagging it

with:
  key: docker-layer-caching-SATTL-{hash}
  restore-keys: docker-layer-caching-SATTL-
  concurrency: 4
  skip-save: false
env:
  AWS_DEFAULT_REGION: us-west-2
  AWS_REGION: us-west-2
  AWS_ACCESS_KEY_ID: ***
  AWS_SECRET_ACCESS_KEY: ***
Received 10853 of 10853 (100.0%), 0.2 MBs/sec
...
Cache saved successfully
119
Stored layer cache: {"key":"layer-docker-layer-caching-SATTL-f0ef9365e55bcbec8d3ee03a24ee9f410a784f1b5e42c358c399f0cdcdb030f9","cacheId":57}

Run of the tag

with:
  key: docker-layer-caching-SATTL-{hash}
  restore-keys: docker-layer-caching-SATTL-
  concurrency: 4
  skip-save: false
env:
  AWS_DEFAULT_REGION: us-west-2
  AWS_REGION: us-west-2
  AWS_ACCESS_KEY_ID: **
  AWS_SECRET_ACCESS_KEY: **
Root cache could not be found. aborting.

from action-docker-layer-caching.

cscetbon avatar cscetbon commented on May 30, 2024

@satackey 👆 you probably have an idea of what is going on ?

from action-docker-layer-caching.

jamie-wearsafe avatar jamie-wearsafe commented on May 30, 2024

@andre-lx and @cscetbon it might be due to the keys and restore keys being used.
Try this:

    - uses: satackey/[email protected]
      with:
        key: docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}-{hash}
        restore-keys: |
          docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}-{hash}
          docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
          docker-layer-caching-${{ github.workflow }}-${{ github.event_name }}
          docker-layer-caching-${{ github.workflow }}
          docker-layer-caching-

And see if it makes any difference.

from action-docker-layer-caching.

japgolly avatar japgolly commented on May 30, 2024

FYI I tried the above and it didn't make a difference

from action-docker-layer-caching.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.