Distributed caching/compilation

214 views
Skip to first unread message

Laurent Le Brun

unread,
May 1, 2015, 8:58:36 PM5/1/15
to bazel-...@googlegroups.com, ts...@arista.com
Forwarding here discussion that started outside the mailing-list

Tsuna wrote:
>> Jeff's "features we need for the beta" list includes "sandboxing", and
>> there are sandboxing technologies using which would be a good step
>> towards remote execution. Looking at that list every item has a
>> natural owner except for the sandboxing, so IMHO this would be a good
>> avenue to start.
>>
>> (But note that once you do remote execution, you need to answer the
>> question "how do I get a compiler", which is hard, unless the compiler
>> is hermetic. In particular, the current /usr/bin/gcc approach is
>> rickety in this case, although I could imagine ways it could be made
>> to work.)
>
> Yeah this problem isn’t particularly easy to solve. Maybe a Docker
> container for each of the compiler environments? Anyways that’s why
> we wanted to tackle the distributed caching aspect first.

--
Laurent

Lukács T. Berki

unread,
May 2, 2015, 12:04:49 AM5/2/15
to Laurent Le Brun, bazel-...@googlegroups.com, ts...@arista.com
Well, distributed caching is also not optimal if we cannot guarantee that the things read from the cache are the same things Bazel would build if it didn't use the cache...

The current model that is used within Google is that there is one blessed, reproducible environment and both tools and source files are simply input files that are put in the environment when needed.

Some less common scenarios are less easy to implement under the "one Docker container per compiler" model (e.g. a genrule that wants to do compilation, or maybe even multiple compilation steps). It also doesn't easily lend itself to non-Linux environments.

tsuna

unread,
May 2, 2015, 1:45:29 AM5/2/15
to Lukács T. Berki, Laurent Le Brun, bazel-...@googlegroups.com
Well, either way the tools are considered as part of the input files,
as you say, and they take part in the hash key used by the caching
system, right?

> Some less common scenarios are less easy to implement under the "one Docker
> container per compiler" model (e.g. a genrule that wants to do compilation,
> or maybe even multiple compilation steps). It also doesn't easily lend
> itself to non-Linux environments.

If there’s any container technology that appears to eventually be
supported across Linux and Windows, it’s Docker.

On Wednesday, Mark Russinovich, the CTO of Microsoft Azure, gave a
presentation at Build 2015, wearing a Docker T-shirt, in which he was
showing how to package and deploy an ASP.NET website as a Docker
container on a Windows Server with Docker support.

> --
> You received this message because you are subscribed to the Google Groups
> "bazel-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bazel-discus...@googlegroups.com.
> To post to this group, send email to bazel-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bazel-discuss/CAOu%2B0LXCiw58ia9PQvHU0kSzwnH39FVRbfPQU763EUZj3uwmXw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

Would you guys consider changing the Groups setting to remove all that crap? :)

--
Benoit "tsuna" Sigoure

Kristina Chodorow

unread,
May 4, 2015, 10:31:08 AM5/4/15
to tsuna, Lukács T. Berki, Laurent Le Brun, bazel-...@googlegroups.com
Removed the "how to post" stuff, but I left the URL to the thread (I find that useful).

tsuna

unread,
May 4, 2015, 3:05:06 PM5/4/15
to Kristina Chodorow, Lukács T. Berki, Laurent Le Brun, bazel-...@googlegroups.com
On Mon, May 4, 2015 at 7:30 AM, Kristina Chodorow <kcho...@google.com> wrote:
> Removed the "how to post" stuff, but I left the URL to the thread (I find
> that useful).

Thanks :D

Any thoughts on Docker?
--
Benoit "tsuna" Sigoure

Lukács T. Berki

unread,
May 7, 2015, 4:39:06 AM5/7/15
to tsuna, Kristina Chodorow, Laurent Le Brun, bazel-...@googlegroups.com
On Mon, May 4, 2015 at 9:04 PM, tsuna <tsun...@gmail.com> wrote:
On Mon, May 4, 2015 at 7:30 AM, Kristina Chodorow <kcho...@google.com> wrote:
> Removed the "how to post" stuff, but I left the URL to the thread (I find
> that useful).

Thanks :D

Any thoughts on Docker?
I think it will have some role in our eventual distributed compilation plan. I'd rather not draw up more detailed plans, but whatever way we end up using to package compilers will also need to work in the single-machine case, and preferably should be compositable (i.e. "I want a C++ and a Java compiler for this action"). We could probably live without the latter, but it seems like a nice property because then you can say things like "This genrule needs a C++ and a Java compiler". 
Reply all
Reply to author
Forward
0 new messages