forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Nailgun in V2 hermetic execution (pantsbuild#8371)
### Problem Local hermetic execution of jvm compiles cannot take advantage of Nailgun, missing out on possible performance benefits. ### Solution Following the discussion from pantsbuild#8387, we have come to the following UX design for now: - We add a field, `nailgunnable`, to `ExecuteProcessRequest`s (EPR). This bit is off in all cases except for compiling with zinc and rsc. - We create a new data structure, `NailgunPool`, that will expose a method `connect(req: ExecuteProcessRequest...)`. This is in charge of maintaining the various nailgun server instances alive. When someone calls `connect()`, it will start a server if it needs to, and then store it for all other users. - We create a new command runner, `NailgunCommandRunner`, that will hold an instance of `NailgunPool` and wrap the `local::CommandRunner`. When asked to run a local EPR, if the EPR is marked _not nailgunnable_, it will forward it to the wrapped `local::CommandRunner`. If **nailgunnable=True**, then: - It will parse the CLI args of the request to figure out the startup arguments of the nailgun server. This will turn into an EPR. - With that EPR, it will call `NailgunPool::connect` to (maybe start and) retrieve the port of a running nailgun instance. - It will modify the original request to be able to connect to nailgun, instead of using the JDK. - It will forward this new and modified client request to the `local::CommandRunner`, to run normally. ### Result Hermetic execution should be able to use nailgun where desired. Fixes pantsbuild#8311, and opens a bunch of followups.
- Loading branch information
Showing
24 changed files
with
1,410 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.