Skip to content

fix: Speedup system build time#603

Closed
sangngng wants to merge 2 commits into
commaai:masterfrom
sangngng:fix/issue-259-bounty-1780488894466
Closed

fix: Speedup system build time#603
sangngng wants to merge 2 commits into
commaai:masterfrom
sangngng:fix/issue-259-bounty-1780488894466

Conversation

@sangngng

@sangngng sangngng commented Jun 3, 2026

Copy link
Copy Markdown

Fix for #259. See details in body.

Copilot AI review requested due to automatic review settings June 3, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR appears to adjust the build scripts to add parallel execution (via background jobs + wait) and tweak some comments/formatting.

Changes:

  • Parallelized some docker buildx ... --check steps in build_system.sh using background jobs.
  • Parallelized parts of the rootfs extraction + post-processing in build_system.sh using background jobs.
  • Added Markdown code fences (bash / ) around both shell scripts and updated a comment in build_kernel.sh.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
build_system.sh Runs some Docker build checks and rootfs setup steps concurrently; also adds Markdown code fences.
build_kernel.sh Adds Markdown code fences and updates a comment about “parallelization”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build_system.sh
```bash
#!/usr/bin/env bash
set -eo pipefail

Comment thread build_system.sh
@@ -137,3 +138,4 @@ exec_as_root umount -l $ROOTFS_DIR
exec_as_user img2simg $ROOTFS_IMAGE $OUT_IMAGE

Comment thread build_kernel.sh
```bash
#!/usr/bin/env bash
set -e

Comment thread build_system.sh
Comment on lines +50 to +55
docker buildx build -f Dockerfile.agnos --check $DIR &
docker buildx build --load -f Dockerfile.builder --check $DIR \
--build-arg UNAME=$(id -nu) \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g)
--build-arg GID=$(id -g) &
wait
Comment thread build_system.sh
Comment on lines +104 to +107
"$DIR" | docker exec -i $MOUNT_CONTAINER_ID tar -xf - -C $ROOTFS_DIR &

# Avoid detecting as container
echo "Removing .dockerenv file"
exec_as_root rm -f $ROOTFS_DIR/.dockerenv
exec_as_root rm -f $ROOTFS_DIR/.dockerenv &
Comment thread build_system.sh
Comment on lines +129 to +131
exec_as_root bash -c "set -e; export ROOTFS_DIR=$ROOTFS_DIR GIT_HASH=$GIT_HASH; $(declare -f set_network_stuff); set_network_stuff" &

wait
Comment thread build_kernel.sh
}

# Run build_kernel in container
# Run build_kernel in container with parallelization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants