Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow persistent workers to communicate with Bazel using JSON instead of protos #7998

Closed
Ubehebe opened this issue Apr 10, 2019 · 7 comments
Closed
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request

Comments

@Ubehebe
Copy link

Ubehebe commented Apr 10, 2019

Description of the problem / feature request:

Currently, persistent workers must use protocol buffers to communicate with Bazel. This limits the languages that workers can be implemented in to those that have first-class protocol buffer support.

Allowing workers to use a JSON serialization of the worker protocol would make it easier to implement workers in languages other than Java/C++. Since languages without first-class proto support often also have performance problems, this could open a number of interesting use cases (for example, a worker written as a shell script).

What underlying problem are you trying to solve with this feature?

I recently implemented a persistent worker in Python. Although it is possible, it is not easy, mostly because of the immaturity of the Python proto toolchain and APIs (no py_proto_library (#2626), no methods for varint-delimited reading/writing (protocolbuffers/protobuf#54), etc.). The repo linked above discusses the workarounds I needed to use to get a Python worker working.

The actual worker protocol is quite simple. I think it would be amenable to JSON serialization, which would make the Python worker much simpler.

@cushon
Copy link
Contributor

cushon commented Apr 11, 2019

The actual worker protocol is quite simple.

Related: #2832

@aiuto aiuto added team-Local-Exec Issues and PRs for the Execution (Local) team untriaged type: feature request labels Apr 15, 2019
@jmmv jmmv added P1 I'll work on this now. (Assignee required) and removed untriaged labels May 23, 2019
@katre
Copy link
Member

katre commented May 13, 2020

Closed for lack of activity. Please ping the reviewers to reopen if this is still a problem.

@katre katre closed this as completed May 13, 2020
@susinmotion
Copy link
Contributor

@karljamesgray is looking into this.

@susinmotion susinmotion reopened this May 19, 2020
@keith
Copy link
Member

keith commented Sep 11, 2020

Looks like this change is related? aa5592e

@susinmotion
Copy link
Contributor

Yes, the infrastructure is there as of September, and is documented in https://docs.bazel.build/versions/master/persistent-workers.html. We're doing a bit more testing; stay tuned for a blog post in the next couple of weeks.

@meisterT
Copy link
Member

meisterT commented Dec 8, 2020

If you ended up on this issue you might be interested in https://www.youtube.com/watch?v=d7q1cVLuRhY&list=PLxNYxgaZ8RseRybXNbopHRv6-wGmFr04n&index=3

@larsrc-google
Copy link
Contributor

This is now generally available, since 003cfcd also for multiplex workers. It's automatically available for any worker implementation that uses WorkRequestHandler, the execution-requirements must still be updated in order to use it, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Local-Exec Issues and PRs for the Execution (Local) team type: feature request
Projects
None yet
Development

No branches or pull requests

9 participants