Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

How to enable remote execution with language servers for TypeScriptCompile and AngularTemplateCompile actions #403

Closed
qzmfranklin opened this issue May 2, 2019 · 3 comments

Comments

@qzmfranklin
Copy link

qzmfranklin commented May 2, 2019

I am trying to make use RBE on our project.

I followed the instructions in bazel-buildfarm and got it working. Java, C/C++, and genrule targets are now using remote instead of linux-sandbox or cached. Nice.

I noticed that TypeScriptCompile and AngularTemplateCompile actions are still using workers to enable language servers:

build --strategy=TypeScriptCompile=worker
build --strategy=AngularTemplateCompile=worker

I changed it to

build --strategy=TypeScriptCompile=remote
build --strategy=AngularTemplateCompile=remote

and get it to work using remotes. But it got significantly slower as it cannot use language servers on the remote executors.

Is there a way to enable language servers on remote executors?

@qzmfranklin qzmfranklin changed the title How to enable remote execution for TypeScriptCompile and AngularTemplateCompile actions How to enable remote execution with language servers for TypeScriptCompile and AngularTemplateCompile actions May 2, 2019
@alexeagle
Copy link
Contributor

This is a great question, I have struggled with it also. The right tuning depends on the incrementality of the build - if only a small number of ts_library actions need to run, it's generally faster to do this locally because you have warm workers. But if you have a massive cache miss, and also a wide enough graph of ts_library, then there may be some of them which are queued for local worker pool so it would be faster to go remote.

Bazel has an experimental strategy to race local and remote and take the faster one, but this doesn't also allow workers to be used.

Remote compilations are over a big farm, and don't have affinity for the same worker over multiple requests, so it wouldn't make much sense to have a remote worker - it would always have a cold cache. (The time to bring up a tsc process, parse typescript.js, and JIT it is probably lower than the variable cost of compiling your sources)

/cc @gpounder

@qzmfranklin
Copy link
Author

Thanks @alexeagle for the explanation!

Agree on your comment that remote workers don't make much sense due to lack of affinities. I did not think of that earlier.

The race strategy sounds interesting. I'd certainly like to give it a shot if it comes out.

@alexeagle
Copy link
Contributor

The race strategy is --experimental_spawn_strategy so you can give it a try, but the RBE team says it has some bugs so beware!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants