Build CF host debian packages in parallel#2621
Open
0405ysj wants to merge 1 commit into
Open
Conversation
Databean
reviewed
Jun 1, 2026
Comment on lines
+28
to
+29
| sudo docker build --file "tools/buildutils/cw/Containerfile" --tag "android-cuttlefish-build" . | ||
| sudo docker run -v=$PWD:/mnt/build -w /mnt/build -v=$HOME/bazel-disk-cache:/root/bazel-disk-cache android-cuttlefish-build base -d /root/bazel-disk-cache & |
Member
There was a problem hiding this comment.
The standard GitHub runners claim to have only 4 CPUs allocated. On top of that, bazel and go build which are used for cuttlefish-base and cuttlefish-frontend already have parallelism built in. I believe npm install is the only build system that will run serially, while the others will expand to fill all available CPUs, without coordinating to share the CPUs with other build systems.
By default docker run will use CPU share constraints for giving CPU time out to instances, but will still report the number of available CPUs that the host has unless controlled with a cpuset.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
build-debian-package-{arch}GitHub workflow job, it tries to build debian packages for each directory in a row. This PR suggests to build CF host debian packages in parallel, and wait until all build procedure is done. I expect we can reduce presubmit/postsubmit workflow time with applying this PR.However, you can see the elapsed time of
build-debian-package-{arch}is huge. This is intended behavior, as the bazel cache is invalidated by changing corresponding GitHub action code. Once it's merged to the main branch and writing bazel cache via postsubmit procedure, I expect it would be reduced as intended.