Hi Tomaz, Thanks for bringing this to the list.
A few comments inline. On Mon, Aug 24, 2020 at 10:53 AM Tomaz Canabrava <[email protected]> wrote: > > During development and testing one of the missing features on buildstream > for > me is the hability to specify "I want to bypass cache for this element", be > it > a local cache or remote cache (or soemtimes interchange that). > > I'v proposed a new cli argument for the build subcommand: --ignore-cache-for > that should be used once per element that we want to bypass and force a > local > build. > > so, instead of doing: > bst build ELEMENT > bst artifact delete ELEMENT > bst build ELEMENT This snippet won't actually disable fetching from a remote cache as `artifact delete` is only a local operation. To make this work as-is, one would also need to pass something like `--fetchers 0` to disable fetching from remote caches. In the past a `--offline` flag has been discussed to disable interaction with remotes. Assuming there's a flag like that, this version would look more like: bst artifact delete ELEMENT bst --offline build ELEMENT `--offline` is desirable for other reasons as well, but may also be useful here. > we dould do: > bst build --ignore-cache-for ELEMENT ELEMENT This may be trickier than it seems at first. A couple of things to consider while using the word "cache": - are we referring to local cache, remote cache, both? if both, how do we specify that? - is this going to refer to source caches, artifact caches, both? If we are to add such an option, I think we first need to iron out the semantics of this new option, and how would it behave in various cases, like the ones mentioned above. I'd like to see some more details around this before we make a decision. > The downside of this approach is that it adds a new command to the CLI, > arguments are that we are going to make the CLI fat and anything that is a > cli argument is also a promise that it will stay there for the future, as > it's the entry point of buildstream and scripts using buidlstream need to > rely on the cli API. Also noting that the first approach does not really > removes cache as it's still possible to download the cache via the cache > server. You're right, the original version of the first option won't work for remote caches, but can be made to work with some work; see comment above regarding that. > the upside of this approach is that it's queryeable via `bst build --help` > with all of the help that `man bst` and `tldr bst` add, increasing the > semantic information provided by buildstream. That' a fair point, although I do wonder whether this is a "power user" functionality. If so, maybe it's not that bad for this to be covered in some sort of `how to` document, and be two different `bst` invocations. But, I could be convinced otherwise if folks feel strongly that this should be a built-in feature. <snip> Cheers, Chandan
