Giter Site home page Giter Site logo

Comments (4)

ericboucher avatar ericboucher commented on July 20, 2024

Idea: store the cache file somewhere else? In S3, or at least somewhere that gives us a bit more control?

https://github.com/marketplace/actions/s3-cache-for-github-actions or similar?

from tap-github.

laurentS avatar laurentS commented on July 20, 2024

One year later, I'm reopening this, as the cache is clearly not used.
This screenshot from https://github.com/MeltanoLabs/tap-github/actions/caches confirms why:
image

Cache is python version specific, which defeats the purpose of our caching attempts.

A local run of the test suite consumes about 500 rest requests and 25 graphql points. As we run 5 versions of python, we're still at only 50% of quota on rest, and much less on graphql. So there's probably some other consumer of quota outside of CI.

Storage of cache outside of github seems like the only option at this point. I will follow up on the suggestion above.

from tap-github.

laurentS avatar laurentS commented on July 20, 2024

Actually, I think I misunderstood what is happening. The cache key is api-cache-v4 which is python version agnostic.

But the cached file is 3 weeks old in the screenshot above, so our code ignores it (it expires the cache after 24h) so it hits the API again.

My guess at this point is that the cache works the first day we use it, but it then becomes stale and ignored by requests-cache. 2 options:

  • change code to expire the cache after much longer than 24h. The problem being that tests use a start_date of more or less "today". So beyond the first day, it's likely that requests might change
  • use a cache key based on the current date, which should make the cache file renew every 24h, in line with the cache expiry and api requests.

from tap-github.

laurentS avatar laurentS commented on July 20, 2024

To expand on the above, this is all because cached files are read-only, so the cache file is not updated beyond its first creation time.
See https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache for details.

from tap-github.

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.