-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Requesting clarification in documentation #43
Comments
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:
The purpose of the
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:
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 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: |
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. |
Thanks @ruffsl for this helpful extension! I am using this to speed up CI for feature branches and would like to seek some clarification to what is described in the README. (Also, much thanks to providing a nice readme instead of just a mostly empty file only containing the package name!)
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?Also, the lock workflow is not intuitive to me. In the quick start example, why do I need to lock the workspace before the first
colcon build
and also after the minor source file changes? Whencolcon build --packages-skip-cache-valid
is run, does it re-hash the package and compare to what is cached? Or does the hashing only happen whencolcon lock
is called? Also, it appears that lockfiles are also updated/created after thebuild
andtest
verbs too (as described by the sentence "Upon successful task completion for a package job, as when evoking colcon verbs like build, test, etc, these lockfiles are updated for the evoked verb, thereby delineating the provenance of the job’s results"). To my understanding, the verblock
is a bit strong because it sounds like other actions would not be permitted to make changes to lockfiles, but that is not the case. To me, the verb is closer tohash
or maybeupdate
to manually trigger an update to the lock files.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. Also, an example of using
--packages-select-cache-key
would be helpful.Overall, I think that understanding that there are some "automatic" updates to lock files depending on using verbs like
build
andtest
is an important concept that a new user may not be aware of based on the current example and explanation.The text was updated successfully, but these errors were encountered: