Git Product home page Git Product logo

Comments (4)

KevinMind avatar KevinMind commented on June 9, 2024 1

Having the same issue. I'm trying all of the variously proposed options to get my github action cache to persist across multiple runners, cannot figure it out. So I tried running the build 2 times in the same runner, both times getting this issue where

WARNING: local cache import at /tmp/.buildx-cache not found due to err: could not read /tmp/.buildx-cache/index.json: open /tmp/.buildx-cache/index.json: no such file or directory

Run: https://github.com/mozilla/addons-server/actions/runs/8019019347/job/21906086963?pr=21893

from build-push-action.

crazy-max avatar crazy-max commented on June 9, 2024 1

You need to set the actions/cache step in our workflow otherwise cache is not retained across runs. See our docs: https://docs.docker.com/build/ci/github-actions/cache/#local-cache

Tried in this repo through #1066 and looks good to me:

Also you should consider using the gha cache backend which is more efficient: https://docs.docker.com/build/ci/github-actions/cache/#github-cache

from build-push-action.

Wenzel avatar Wenzel commented on June 9, 2024

Thanks for testing and pointing to the docs @crazy-max.

I tried your setup, and the cache works for me (replacing /tmp/.buildx-cache by /tmp/.docker-cache)

$ du -h /tmp/.docker-cache/
1.6G    /tmp/.docker-cache/blobs/sha256
1.6G    /tmp/.docker-cache/blobs
4.0K    /tmp/.docker-cache/ingest
1.6G    /tmp/.docker-cache/

But as soon as I replace this path with ~/.cache/docker-ci, the caching doesn't work anymore.
That folder remains empty.

      - name: Cache Docker layers
        uses: actions/cache@v4
        with:
          path: ~/.cache/docker-ci
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-

I tried to remove this folder, and let the workflow create it, but it didn't work either.
So I'm puzzled as to what really happens, and i'm forced to use a path starting with /tmp here.

Also you should consider using the gha cache backend which is more efficient: https://docs.docker.com/build/ci/github-actions/cache/#github-cache

That solution would be suitable if the cache content wasn't sensitive or private, which is the case here.

from build-push-action.

crazy-max avatar crazy-max commented on June 9, 2024

path: ~/.cache/docker-ci

Don't think actions/cache@v4 expands ~. You should use an absolute dir.

from build-push-action.

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.