Skip to content

Supply options to turn off networking features

Background:

BuildStream is perfectly capable of building offline, but to get it to do so for whatever reason involves turning off my wifi.

This isn't always desirable - I can see someone working on a metered connection, and being perfectly happy browsing the web, but not wanting to download a 20GB artifact from a server (and instead preferring to build that offline from sources they already have).

It would also be nice if we could disable specifically downloading from artifact caches, so that we can try rebuilding an artifact (just to see if we can still build from scratch, even if BuildStream should technically guarantee that), and disabling fetching so that I don't need to wait 20 minutes to realize that my proxy doesn't work and that I therefore only have access to an artifact server.

We technically do have a way to do some of this, by setting fetchers: 0, however I believe that the fact that we allow '0' as a value to that is counter-intuitive, and even if this is how it works internally, we should supply a different UI for that. This also gives us an opportunity to fail faster and give better error messages.

Task description

We should add options to accommodate those use cases. In particular, we should add:

  • bst --offline/--online, that switches running any network requests.
  • bst --no-/artifact-server, that turns on/off pushing/pulling.
  • bst --no-/remote-sources, that turns on/off interacting with remote sources (Anything that inherits from downloadable? Might be realted to !1423 (closed)).

This should obviously be implemented as a set of user configuration settings as well :)

Some discussion came up about allowing something like bst --offline fetch foobar.bst, since the user clearly wants to fetch. Other tools (e.g. yarn or cargo) do not permit this, and from a scripting perspective it would allow checking whether all sources have already been fetched, hence I would suggest not creating a special case here.

We should also remove the option to set fetchers/builders to 0, since this is counter-intuitive, and no longer necessary once these other flags exist.

Acceptance Criteria

BuildStream has a more understandable and slightly more granular method of disabling network interaction.


Edited by Tristan Maat
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information