From aacd733e30bf73d5e79d31255e48f3b8e8de8491 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 16:05:09 -0800 Subject: [PATCH 01/14] big --- .github/workflows/selfdrive_tests.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index ec40660f154017..d93f7ebf5e272a 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -166,6 +166,11 @@ jobs: with: submodules: true - uses: ./.github/workflows/setup-with-retry + - name: Breakpoint if tests failed + uses: namespacelabs/breakpoint-action@v0 + with: + duration: 30m + authorized-users: maxime-desroches - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" - name: Run unit tests From 96203262e08df47f1b5e11829b829665ba3d8202 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 16:09:34 -0800 Subject: [PATCH 02/14] here --- .github/workflows/selfdrive_tests.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index d93f7ebf5e272a..7a52d91147741f 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -166,11 +166,6 @@ jobs: with: submodules: true - uses: ./.github/workflows/setup-with-retry - - name: Breakpoint if tests failed - uses: namespacelabs/breakpoint-action@v0 - with: - duration: 30m - authorized-users: maxime-desroches - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" - name: Run unit tests @@ -207,6 +202,11 @@ jobs: - name: Build openpilot run: | ${{ env.RUN }} "scons -j$(nproc)" + - name: debug + uses: namespacelabs/breakpoint-action@v0 + with: + duration: 30m + authorized-users: maxime-desroches - name: Run replay timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | From 3ac559c0fb2e337f3ec83a31bf2bcbd8b32ca910 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 19:22:35 -0800 Subject: [PATCH 03/14] why --- Dockerfile.openpilot_base | 48 ++++----------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/Dockerfile.openpilot_base b/Dockerfile.openpilot_base index 6dbd249c2355a6..17780354b05a08 100644 --- a/Dockerfile.openpilot_base +++ b/Dockerfile.openpilot_base @@ -18,43 +18,6 @@ RUN /tmp/tools/install_ubuntu_dependencies.sh && \ cd /usr/lib/gcc/arm-none-eabi/* && \ rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp -# Add OpenCL -RUN apt-get update && apt-get install -y --no-install-recommends \ - apt-utils \ - alien \ - unzip \ - tar \ - curl \ - xz-utils \ - dbus \ - gcc-arm-none-eabi \ - tmux \ - vim \ - libx11-6 \ - wget \ - && rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /tmp/opencl-driver-intel && \ - cd /tmp/opencl-driver-intel && \ - wget https://github.com/intel/llvm/releases/download/2024-WW14/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \ - wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-lin.tgz && \ - mkdir -p /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \ - cd /opt/intel/oclcpuexp_2024.17.3.0.09_rel && \ - tar -zxvf /tmp/opencl-driver-intel/oclcpuexp-2024.17.3.0.09_rel.tar.gz && \ - mkdir -p /etc/OpenCL/vendors && \ - echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64/libintelocl.so > /etc/OpenCL/vendors/intel_expcpu.icd && \ - cd /opt/intel && \ - tar -zxvf /tmp/opencl-driver-intel/oneapi-tbb-2021.12.0-lin.tgz && \ - ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \ - ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \ - ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbb.so.12 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \ - ln -s /opt/intel/oneapi-tbb-2021.12.0/lib/intel64/gcc4.8/libtbbmalloc.so.2 /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 && \ - mkdir -p /etc/ld.so.conf.d && \ - echo /opt/intel/oclcpuexp_2024.17.3.0.09_rel/x64 > /etc/ld.so.conf.d/libintelopenclexp.conf && \ - ldconfig -f /etc/ld.so.conf.d/libintelopenclexp.conf && \ - cd / && \ - rm -rf /tmp/opencl-driver-intel - ENV NVIDIA_VISIBLE_DEVICES all ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute ENV QTWEBENGINE_DISABLE_SANDBOX 1 @@ -68,17 +31,14 @@ RUN usermod -aG sudo $USER RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER $USER -COPY --chown=$USER pyproject.toml uv.lock /tmp/ -COPY --chown=$USER tools/install_python_dependencies.sh /tmp/tools/ +COPY --chown=$USER pyproject.toml uv.lock /home/$USER +COPY --chown=$USER tools/install_python_dependencies.sh /home/$USER/tools/ ENV VIRTUAL_ENV=/home/$USER/.venv ENV PATH="$VIRTUAL_ENV/bin:$PATH" -RUN cd /tmp && \ +RUN cd /home/$USER && \ tools/install_python_dependencies.sh && \ - mkdir -p $VIRTUAL_ENV && \ - cp -r /tmp/.venv/* $VIRTUAL_ENV && \ - rm -rf /tmp/* && \ - rm -rf /home/$USER/.cache + rm -rf tools/ pyproject.toml uv.lock .cache USER root RUN sudo git config --global --add safe.directory /tmp/openpilot From b7fb826e1659a223420acc467f4e7d2c18ebb108 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 19:24:39 -0800 Subject: [PATCH 04/14] pocl --- Dockerfile.openpilot_base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.openpilot_base b/Dockerfile.openpilot_base index 17780354b05a08..aa5230fa6d0f6a 100644 --- a/Dockerfile.openpilot_base +++ b/Dockerfile.openpilot_base @@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED 1 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y --no-install-recommends sudo tzdata locales ssh pulseaudio xvfb x11-xserver-utils gnome-screenshot && \ + apt-get install -y --no-install-recommends sudo tzdata locales ssh pulseaudio xvfb x11-xserver-utils gnome-screenshot pocl-opencl-icd && \ rm -rf /var/lib/apt/lists/* RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen From 0b289c3958d8672628d74443b0bb33ecab180d87 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 19:33:44 -0800 Subject: [PATCH 05/14] remove this --- .github/workflows/selfdrive_tests.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 7a52d91147741f..ec40660f154017 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -202,11 +202,6 @@ jobs: - name: Build openpilot run: | ${{ env.RUN }} "scons -j$(nproc)" - - name: debug - uses: namespacelabs/breakpoint-action@v0 - with: - duration: 30m - authorized-users: maxime-desroches - name: Run replay timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | From e274644aedf4c6f3d8eb6235bd39bdc4cb82dd49 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 19:54:00 -0800 Subject: [PATCH 06/14] more debug --- .github/workflows/selfdrive_tests.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index ec40660f154017..7a52d91147741f 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -202,6 +202,11 @@ jobs: - name: Build openpilot run: | ${{ env.RUN }} "scons -j$(nproc)" + - name: debug + uses: namespacelabs/breakpoint-action@v0 + with: + duration: 30m + authorized-users: maxime-desroches - name: Run replay timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | From 7b1d59796e3d4cfd495a66c1c191b930dfedb3a0 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 19:59:44 -0800 Subject: [PATCH 07/14] see this --- .github/workflows/selfdrive_tests.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 7a52d91147741f..80712189f7f6cd 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -202,11 +202,6 @@ jobs: - name: Build openpilot run: | ${{ env.RUN }} "scons -j$(nproc)" - - name: debug - uses: namespacelabs/breakpoint-action@v0 - with: - duration: 30m - authorized-users: maxime-desroches - name: Run replay timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.dependency-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | @@ -263,6 +258,11 @@ jobs: key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }} - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" + - name: debug + uses: namespacelabs/breakpoint-action@v0 + with: + duration: 30m + authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | From 42807a55044e83dca9b54a6ea6743efec61bc00b Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 20:29:11 -0800 Subject: [PATCH 08/14] more --- .github/workflows/selfdrive_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 80712189f7f6cd..07faddfac1cd5d 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -261,7 +261,7 @@ jobs: - name: debug uses: namespacelabs/breakpoint-action@v0 with: - duration: 30m + duration: 31m authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} From cfb8ebc6b0ccfb693653d6588f00f1752f289799 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 21:01:45 -0800 Subject: [PATCH 09/14] more --- .github/workflows/selfdrive_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 07faddfac1cd5d..a8111f549a62b0 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -261,7 +261,7 @@ jobs: - name: debug uses: namespacelabs/breakpoint-action@v0 with: - duration: 31m + duration: 32m authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} From 47620c32bf5249c72d0de46c5f1ca5b121de30de Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 21:06:06 -0800 Subject: [PATCH 10/14] diff --- .github/workflows/selfdrive_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index a8111f549a62b0..80712189f7f6cd 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -261,7 +261,7 @@ jobs: - name: debug uses: namespacelabs/breakpoint-action@v0 with: - duration: 32m + duration: 30m authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} From 6d5293094ff9b4258fff2d5688256439be189032 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 21:33:35 -0800 Subject: [PATCH 11/14] cleanup --- .github/workflows/selfdrive_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 80712189f7f6cd..07faddfac1cd5d 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -261,7 +261,7 @@ jobs: - name: debug uses: namespacelabs/breakpoint-action@v0 with: - duration: 30m + duration: 31m authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} From a9575bc33ed4f7af07888894e2707dfbb7249d49 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 21:42:23 -0800 Subject: [PATCH 12/14] cleanup --- .github/workflows/selfdrive_tests.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 07faddfac1cd5d..ec40660f154017 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -258,11 +258,6 @@ jobs: key: car_models-${{ hashFiles('selfdrive/car/tests/test_models.py', 'selfdrive/car/tests/routes.py') }}-${{ matrix.job }} - name: Build openpilot run: ${{ env.RUN }} "scons -j$(nproc)" - - name: debug - uses: namespacelabs/breakpoint-action@v0 - with: - duration: 31m - authorized-users: maxime-desroches - name: Test car models timeout-minutes: ${{ contains(runner.name, 'nsc') && (steps.routes-cache.outputs.cache-hit == 'true') && 1 || 20 }} run: | From 137cde5fc98ec39497e85f335e2f636cf9a5e5ea Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 21:55:54 -0800 Subject: [PATCH 13/14] check --- selfdrive/test/docker_build.sh | 9 +++++++++ selfdrive/test/docker_common.sh | 1 + 2 files changed, 10 insertions(+) diff --git a/selfdrive/test/docker_build.sh b/selfdrive/test/docker_build.sh index 4d58a1507c2326..4a7d901d0a2977 100755 --- a/selfdrive/test/docker_build.sh +++ b/selfdrive/test/docker_build.sh @@ -19,6 +19,15 @@ source $SCRIPT_DIR/docker_common.sh $1 "$TAG_SUFFIX" DOCKER_BUILDKIT=1 docker buildx build --provenance false --pull --platform $PLATFORM --load --cache-to type=inline --cache-from type=registry,ref=$REMOTE_TAG -t $DOCKER_IMAGE:latest -t $REMOTE_TAG -t $LOCAL_TAG -f $OPENPILOT_DIR/$DOCKER_FILE $OPENPILOT_DIR +if [ -n "$DOCKER_MAX_SIZE" ]; then + SIZE="$(docker inspect $DOCKER_IMAGE:latest --format='{{.Size}}')" + echo "$DOCKER_IMAGE size: $SIZE bytes" + if [ $(echo "$SIZE > $DOCKER_MAX_SIZE" | bc) -eq 1 ]; then + echo "Image too large, max is $DOCKER_MAX_SIZE bytes" + exit 1 + fi +fi + if [ -n "$PUSH_IMAGE" ]; then docker push $REMOTE_TAG docker tag $REMOTE_TAG $REMOTE_SHA_TAG diff --git a/selfdrive/test/docker_common.sh b/selfdrive/test/docker_common.sh index 2887fff74bc32e..cef507b3910e7b 100644 --- a/selfdrive/test/docker_common.sh +++ b/selfdrive/test/docker_common.sh @@ -1,6 +1,7 @@ if [ "$1" = "base" ]; then export DOCKER_IMAGE=openpilot-base export DOCKER_FILE=Dockerfile.openpilot_base + export DOCKER_MAX_SIZE="7.1*10^9" elif [ "$1" = "prebuilt" ]; then export DOCKER_IMAGE=openpilot-prebuilt export DOCKER_FILE=Dockerfile.openpilot From b62f9d11d85a89efacf05cfad4dcc432fc00c451 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 4 Dec 2024 22:01:10 -0800 Subject: [PATCH 14/14] NO DC??? This reverts commit 137cde5fc98ec39497e85f335e2f636cf9a5e5ea. --- selfdrive/test/docker_build.sh | 9 --------- selfdrive/test/docker_common.sh | 1 - 2 files changed, 10 deletions(-) diff --git a/selfdrive/test/docker_build.sh b/selfdrive/test/docker_build.sh index 4a7d901d0a2977..4d58a1507c2326 100755 --- a/selfdrive/test/docker_build.sh +++ b/selfdrive/test/docker_build.sh @@ -19,15 +19,6 @@ source $SCRIPT_DIR/docker_common.sh $1 "$TAG_SUFFIX" DOCKER_BUILDKIT=1 docker buildx build --provenance false --pull --platform $PLATFORM --load --cache-to type=inline --cache-from type=registry,ref=$REMOTE_TAG -t $DOCKER_IMAGE:latest -t $REMOTE_TAG -t $LOCAL_TAG -f $OPENPILOT_DIR/$DOCKER_FILE $OPENPILOT_DIR -if [ -n "$DOCKER_MAX_SIZE" ]; then - SIZE="$(docker inspect $DOCKER_IMAGE:latest --format='{{.Size}}')" - echo "$DOCKER_IMAGE size: $SIZE bytes" - if [ $(echo "$SIZE > $DOCKER_MAX_SIZE" | bc) -eq 1 ]; then - echo "Image too large, max is $DOCKER_MAX_SIZE bytes" - exit 1 - fi -fi - if [ -n "$PUSH_IMAGE" ]; then docker push $REMOTE_TAG docker tag $REMOTE_TAG $REMOTE_SHA_TAG diff --git a/selfdrive/test/docker_common.sh b/selfdrive/test/docker_common.sh index cef507b3910e7b..2887fff74bc32e 100644 --- a/selfdrive/test/docker_common.sh +++ b/selfdrive/test/docker_common.sh @@ -1,7 +1,6 @@ if [ "$1" = "base" ]; then export DOCKER_IMAGE=openpilot-base export DOCKER_FILE=Dockerfile.openpilot_base - export DOCKER_MAX_SIZE="7.1*10^9" elif [ "$1" = "prebuilt" ]; then export DOCKER_IMAGE=openpilot-prebuilt export DOCKER_FILE=Dockerfile.openpilot