[BuildStream] BuildStream on Windows



Hello list!

I have started to prototype "BuildStream on native Windows, without sandbox", I
think this will be a major use-case for me.

I've managed to make a series of hacks that get a "Hello World" application
to build. See [0] for the code and [1] for setup instructions.

Over the coming months, I'd like to start making changes to BuildStream that
will end up with Windows being a supported platform.

Here is the high-level roadmap that I was thinking of, and have already hacked
together:

- Add support for `multiprocessing.set_start_method('spawn')`[2] on platforms
  that don't support 'fork'.
    - Make elements and sources picklable.
    - Start being mindful of what references what, so that we're not pickling
      more than we need to. This may mean being more explicit in general about
      the split between the main and worker processes.
- Change to use some more portable versions of things, re-assess some
  assumptions, being mindful of performance across platforms.
- "Do something about signals on win32".
- Introduce win32 platform, using SandboxDummy.
- Introduce SandboxNone, which relies on copying files and good faith. I'd also
  like to try this on MacOS, to provide an alternative to the package manager
  Homebrew.
- Provide a facility for plugin developers to record and replay job
  invocations, for debugging. This works by saving the pickled job data and
  launching it again separately.

After that I'll be looking at hacking and implementing these things:

- Evaluate a job queue and persistent worker processes model. This will avoid
  the high cost of spawning new Python processes for each job. This cost isn't
  the same when forking. This approach may also help with our memory overhead.
- Evaluate ProjFS[3] on Windows, to provide some filesystem sandboxing.
- Evaluate Windows Sandbox [4] for sandboxing.
- Evaluate Windows Containers [5] for sandboxing.

Let me know what you think!

Cheers,
Angelos

Here is the MR for the prototype:
[0]: https://gitlab.com/BuildStream/buildstream/merge_requests/1298

There are repro instruction on the branch here:
[1]: https://gitlab.com/BuildStream/buildstream/blob/aevri/win32/WINDOWS.md

multiprocessing.set_start_method:
[2]: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.set_start_method

Windows Projected File System (ProjFS):
[3]: https://docs.microsoft.com/en-us/windows/desktop/projfs/projected-file-system

Windows Sandbox is a new lightweight desktop environment tailored for safely running applications in isolation:
[4]: https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/Windows-Sandbox/ba-p/301849

Containers on Windows:
[5]: https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/


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