Giter VIP home page Giter VIP logo

Comments (2)

ruffsl avatar ruffsl commented on June 5, 2024

Hey @zflat , neat to hear your use of this extension to speed up CI. If you like to see a real world example using this extension, we've been using it rather heavily for the Nav2 project for over a year or so:

Can you please explain the purpose of the --packages-select-cache-key? For example, where would I look to see what the default key is and why would I need to override it?

The purpose of the --packages-select-cache-key is to override the default cache key selected by the verb handler. For example, the verb handler for the "colcon list", it uses the same verb handler for "colcon cache", which defines what lockfiles are to be used for comparison or reference. When used with package selection, this can be helpful when listing what caches are still valid for other colcon verbs (e.g. not just for "colcon list").

In Nav2 for example, we do this to list packages with invalidated caches for specifically the "colcon build" verb, so that we can determine the package builds that must be subsequently cleaned:

https://github.com/ros-planning/navigation2/blob/5547a20ae711417af90768d9d594a4524064e1ca/.circleci/config.yml#L163-L169

Also, the lock workflow is not intuitive to me.

The level of abstraction with caching results for colcon verbs, verbs that transitively depend on other verbs, makes this difficult to describe. The hashing of source files (or query to detected revision control) is only invoked with the "colcon cache lock" subverb. I suppose this could have been abbreviated to the root verb "colcon cache", but I suspected I may want to add more extension subverbs in the future, so I pushed that hashing funatilty into a "lock" subverb, as "colcon cache cache" seemed too peculiar.

The updating of lockfiles is currently simply a copy operation upon a successful task for the package, where the invoked colcon verb triggers an event handler that copies the lockfile from the verb it transitively depends upon. E.g. the build verb depends upon the cache verb, and the test verb depends upon the build verb. This pattern could be extended for any other verbs via more registered event handlers.

I think that a more detailed explanation (maybe annotating the example) of what creates and or modifies which lock files and what checks against the lock files are performed would be helpful.

I can add a "How does it work" section to the readme, but I'd first like to finish refactoring where the lockfiles are written and read from in the colcon workspace, as to store the lockfiles closer to the artifacts they claim to represent:

from colcon-cache.

zflat avatar zflat commented on June 5, 2024

Thanks @ruffsl for the explanation! The example of using a different --packages-select-cache-key makes it more clear to me now.

It is helpful to know that the build verb lock file is just copied from the cache verb. And I think that a "how it works" section would be very helpful.

from colcon-cache.

Related Issues (1)

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.