From 1d6d0fb85c94c663be087683eb690a7578a18ad9 Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Sat, 29 Nov 2025 02:19:30 +0100 Subject: [PATCH] ci: prevent build OOM by throttling locationd concurrency (#1527) * ci: add conditional swap creation to prebuilt workflow - Dynamically creates an 8GB swap file on systems with less than 8GB RAM. - Ensures builds complete reliably on low-memory environments. - Introduced cleanup step to remove swap after workflow execution. * Nice save * clean * reduce swap size in prebuilt workflow - Adjusted swap file size from 8GB to 4GB to optimize resource usage. * remove swap creation from prebuilt workflow - Simplified workflow by removing dynamic swap file creation and cleanup. - Adjusted resource management to rely on existing system resources. * update sunnypilot build workflow to use explicit script calls - Replaced `op` commands with explicit `/data/openpilot/tools/op.sh` script calls for better reliability and clarity. * update sunnypilot build workflow to use systemd for process management - Replaced `/data/openpilot/tools/op.sh` script calls with `systemctl` commands for improved compatibility and reliability. - Ensures consistent resource management during start and stop operations. * Splitting a bit the build then? * split build steps in sunnypilot prebuilt workflow - Added separate build steps for `modeld`, `modeld_v2`, and `locationd` with descriptive messages. - Improves logging and clarity during the build process. * limit locationd parallel processes aiming to help with resource consumption * typo * adding op's location d AND bumping to 4 cores for them * Apply suggestion from @sunnyhaibin --------- Co-authored-by: Jason Wen --- .github/workflows/sunnypilot-build-prebuilt.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/sunnypilot-build-prebuilt.yaml b/.github/workflows/sunnypilot-build-prebuilt.yaml index d3ad2d241..8af877963 100644 --- a/.github/workflows/sunnypilot-build-prebuilt.yaml +++ b/.github/workflows/sunnypilot-build-prebuilt.yaml @@ -180,6 +180,15 @@ jobs: ./release/release_files.py | sort | uniq | rsync -rRl${RUNNER_DEBUG:+v} --files-from=- . $BUILD_DIR/ cd $BUILD_DIR sed -i '/from .board.jungle import PandaJungle, PandaJungleDFU/s/^/#/' panda/__init__.py + echo "Building sunnypilot's modeld..." + scons -j$(nproc) cache_dir=${{env.SCONS_CACHE_DIR}} --minimal sunnypilot/modeld + echo "Building sunnypilot's modeld_v2..." + scons -j$(nproc) cache_dir=${{env.SCONS_CACHE_DIR}} --minimal sunnypilot/modeld_v2 + echo "Building sunnypilot's locationd..." + scons -j4 cache_dir=${{env.SCONS_CACHE_DIR}} --minimal sunnypilot/selfdrive/locationd + echo "Building openpilot's locationd..." + scons -j4 cache_dir=${{env.SCONS_CACHE_DIR}} --minimal selfdrive/locationd + echo "Building rest of sunnypilot" scons -j$(nproc) cache_dir=${{env.SCONS_CACHE_DIR}} --minimal touch ${BUILD_DIR}/prebuilt if [[ "${{ runner.debug }}" == "1" ]]; then