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

Build concurrency with bazel builds #6047

Open
robertgates55 opened this issue Jun 21, 2021 · 1 comment
Open

Build concurrency with bazel builds #6047

robertgates55 opened this issue Jun 21, 2021 · 1 comment
Labels
build/bazel kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@robertgates55
Copy link

robertgates55 commented Jun 21, 2021

Am interested in guidance on how best to use skaffold to run our CI builds. We're moving to using bazel for our artifact builds, and I was interested in how concurrency would be handled by the bazel server. It appears skaffold invokes multiple bazel builds, and bazel server only allows these to be run one at a time. Eg if I set concurrency: 4 and run skaffold build with 4 bazel artifacts, I get

Building 4 artifacts in parallel
Building [blah]...
Another command holds the client lock: 
pid=35039
owner=client
cwd=/Users/robgates/Repositories/blah

Waiting for it to complete...
Another command holds the client lock: 
pid=35026
owner=client
cwd=/Users/robgates/Repositories/blah

Waiting for it to complete...
Another command (pid=35039) is running. Waiting for it to complete on the server (server_pid=10136)..

... bazel waits until each build completes before allowing the next to start.

Is there a better way of setting this up? Is there any way for skaffold to invoke bazel build //src/artifact1:artifact1.tar //src/artifact2:artifact2.tar //src/artifact3:artifact3.tar //src/artifact4:artifact4.tar such that bazel handles the concurrency? (obviously I know with multiple providers they'll all behave differently so I understand the complexity; but am just wondering what the right way to handle this scenario is?

@tejal29 tejal29 added the priority/p3 agreed that this would be good to have, but no one is available at the moment. label Jul 1, 2021
@tejal29
Copy link
Member

tejal29 commented Jul 1, 2021

@robertgates55 unfortunately like you mentioned concurrent bazel builds wont work with current implementation.

It will take some effort to re-think how we can support concurrent builds for bazel. Right now the team does not have the bandwidth to look into this.

I like the idea of bazel build //src/artifact1:artifact1.tar //src/artifact2:artifact2.tar //src/artifact3:artifact3.tar //src/artifact4:artifact4.tar Would you be open to write a design proposal and consider more aspects like how skaffold will use the concurrency config ? Does bazel support number of concurrent builds on the command line which we can pass as is?

We can definitely help you make the code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/bazel kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

3 participants