Re: [BuildStream] Platform - Sandbox refactoring



Hi,

On Tue, Nov 20, 2018 at 2:52 PM Benjamin Schubert via BuildStream-list <buildstream-list gnome org> wrote:
Hi everyone,

As part of my ongoing work with a Docker sandbox POC [0],
I have been struggling with how the `sandbox`s and the `platform`s are coupled.

I would like to propose another way of handling this in this thread. Please let me know your thoughts.

--- Problem ---
First, a more thorough explanation of the problem:

We currently have three platforms:
  - Darwin
  - Linux
  - Unix
 
- Darwin does not support other sandboxes than "SandboxDummy"
- Linux supports "SandboxBwrap" and has a fallback on "SandboxDummy"
- Unix supports "SandboxChroot" but does not fallback on "SandboxDummy"

Each platform is currently responsible for checking if a sandbox is available and usable and initiating it.
This means that for adding a new sandbox to all of them, we would need to have the checks in three places.
Moreover, it is not possible to configure the platform explicitly (What if I want the chroot platform on Linux
for whatever reason?).

Moreover, that also means the platform needs to know what the sandbox needs in order to check it. This makes
both tightly coupled and hard to setup.

--- Changes ---
I would like to change the system such that:

- The platform's responsibility is to go over a list of available sandboxes (We know that some platforms
won't have some sandboxes, so there is no need to use them) and try to instantiate it.
  - If that fails, the platform tries the next sandbox until there are none left and falls back to the DummySandbox.
  - If one succeeds, it will be used.
 
- We add a configuration entry in the user's config to specify which sandbox to use. Or even better, a list of them, in preference order.
  If that (those) sandbox is unavailable, we fail.

With a list of sensible defaults for each host platform, so that ideally the user doesn't need to configure anything in the default case.
 
- The sandbox itself checks whether it can be used or not on instantiation. A successful instantiation means the
  sandbox is completely functional.
 
What do you think about this change? Does it make sense?

It does, with one caveat.  Once we land a buildbox based sandbox, does that logic not all move there instead of BuildStream?  I believe we have a mention of that in another thread as well.
 
Once (if) we reach consensus, I will tackle the code changes.

Cheers,
Benjamin

Cheers,

Sander
 
[0] https://mail.gnome.org/archives/buildstream-list/2018-October/msg00055.html


_______________________________________________
BuildStream-list mailing list
BuildStream-list gnome org
https://mail.gnome.org/mailman/listinfo/buildstream-list
--

Cheers,

Sander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]