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

WIP: Shorten openpilot CI Setup Time to <40s #31836

Closed
wants to merge 15 commits into from
15 changes: 9 additions & 6 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ concurrency:
cancel-in-progress: true

env:
BASE_IMAGE: openpilot-base

BUILD: selfdrive/test/docker_build.sh base

RUN: docker run --shm-size 1G -v $GITHUB_WORKSPACE:/tmp/openpilot -w /tmp/openpilot -e FILEREADER_CACHE=1 -e PYTHONPATH=/tmp/openpilot -e NUM_JOBS -e JOB_ID -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -v $GITHUB_WORKSPACE/.ci_cache/scons_cache:/tmp/scons_cache -v $GITHUB_WORKSPACE/.ci_cache/comma_download_cache:/tmp/comma_download_cache -v $GITHUB_WORKSPACE/.ci_cache/openpilot_cache:/tmp/openpilot_cache $BASE_IMAGE /bin/bash -c
PYTHON_VERSION: 3.11.4
APT_PACKAGES: ca-certificates casync clang cmake make
cppcheck bzip2 capnproto curl git
git-lfs ffmpeg libffi-dev
libssl-dev libsystemd-dev locales opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev clinfo portaudio19-dev
qml-module-qtquick2 qtmultimedia5-dev qtlocation5-dev qtpositioning5-dev qttools5-dev-tools libqt5sql5-sqlite libqt5svg5-dev
libqt5charts5-dev libqt5serialbus5-dev libqt5x11extras5-dev libreadline-dev libdw1 valgrind
apt-utils alien unzip tar xz-utils dbus tmux lsb-core libx11-6

jobs:
docs:
Expand All @@ -26,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ./.github/workflows/setup-with-retry
- uses: ./.github/workflows/setup-with-retry-mau
- name: Build openpilot
run: |
${{ env.RUN }} "scons -j$(nproc)"
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/setup-mau/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: setup-mau-test

inputs:
is_retried:
description: 'A mock param that asserts that we use the setup-with-retry instead of this action directly'
required: false
default: 'false'
runs:
using: "composite"
steps:
# assert that this action is retried using the setup-with-retry
- shell: bash
if: ${{ inputs.is_retried == 'false' }}
run: |
echo "You should not run this action directly. Use setup-with-retry instead"
exit 1
# do this after checkout to ensure our custom LFS config is used to pull from GitLab
- shell: bash
run: git lfs pull
# build cache
- id: date
shell: bash
run: echo "CACHE_COMMIT_DATE=$(git log -1 --pretty='format:%cd' --date=format:'%Y-%m-%d-%H:%M')" >> $GITHUB_ENV
- shell: bash
run: echo "$CACHE_COMMIT_DATE"
- id: setup-apt-packages
uses: awalsh128/[email protected]
with:
packages: ${{ env.APT_PACKAGES }}
33 changes: 33 additions & 0 deletions .github/workflows/setup-with-retry-mau/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'openpilot env setup-mau, with retry on failure'

inputs:
sleep_time:
description: 'Time to sleep between retries'
required: false
default: 30

runs:
using: "composite"
steps:
- id: setup-mau1
uses: ./.github/workflows/setup-mau
continue-on-error: true
with:
is_retried: true
- if: steps.setup-mau1.outcome == 'failure'
shell: bash
run: sleep ${{ inputs.sleep_time }}
- id: setup-mau2
if: steps.setup-mau1.outcome == 'failure'
uses: ./.github/workflows/setup-mau
continue-on-error: true
with:
is_retried: true
- if: steps.setup-mau2.outcome == 'failure'
shell: bash
run: sleep ${{ inputs.sleep_time }}
- id: setup-mau3
if: steps.setup-mau2.outcome == 'failure'
uses: ./.github/workflows/setup-mau
with:
is_retried: true
Loading