Skip to content

Commit

Permalink
Integrate containerd setup and parallelize CI jobs
Browse files Browse the repository at this point in the history
* **Setup containerd and lazy loading:**
  - Add steps to set up containerd using `ghaction-setup-containerd` in `setup-with-retry/action.yaml` and `setup/action.yaml`
  - Add steps to use lazy loading with eStargz in `setup-with-retry/action.yaml` and `setup/action.yaml`

* **Parallelize CI jobs:**
  - Add steps to run `setup-with-retry` and build openpilot in parallel in `compile-openpilot/action.yaml` and `selfdrive_tests.yaml`
  • Loading branch information
vishwamartur committed Nov 30, 2024
1 parent f76ecce commit 03ba97d
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 24 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/compile-openpilot/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,33 @@ runs:
with:
path: .ci_cache/scons_cache
key: scons-${{ runner.arch }}-${{ env.CACHE_COMMIT_DATE }}-${{ github.sha }}
- name: Run setup-with-retry in parallel
run: |
jobs:
setup1:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
setup2:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
setup3:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot in parallel
run: |
jobs:
build1:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
build2:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
build3:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
40 changes: 40 additions & 0 deletions .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,43 @@ jobs:
with:
name: report-${{ inputs.run_number || '1' }}-${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 'master' || github.event.number }}
path: selfdrive/ui/tests/test_ui/report_1/screenshots

parallel_setup_with_retry:
name: Parallel setup-with-retry
runs-on: ubuntu-latest
steps:
- name: Run setup-with-retry in parallel
run: |
jobs:
setup1:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
setup2:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
setup3:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup-with-retry
parallel_build_openpilot:
name: Parallel build openpilot
runs-on: ubuntu-latest
steps:
- name: Build openpilot in parallel
run: |
jobs:
build1:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
build2:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
build3:
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/compile-openpilot
22 changes: 15 additions & 7 deletions .github/workflows/setup-with-retry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ inputs:
runs:
using: "composite"
steps:
- name: Set up containerd
uses: crazy-max/ghaction-setup-containerd@v1
with:
containerd-version: '1.5.5'

- name: Use lazy loading with eStargz
run: |
sudo apt-get update
sudo apt-get install -y fuse-overlayfs
sudo mkdir -p /etc/containerd
echo "version = 2" | sudo tee /etc/containerd/config.toml
echo "[plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options]" | sudo tee -a /etc/containerd/config.toml
echo " SystemdCgroup = true" | sudo tee -a /etc/containerd/config.toml
sudo systemctl restart containerd
- id: setup1
uses: ./.github/workflows/setup
continue-on-error: true
Expand All @@ -35,10 +50,3 @@ runs:
uses: ./.github/workflows/setup
with:
is_retried: true
- name: Cache Python dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
35 changes: 18 additions & 17 deletions .github/workflows/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,24 @@ runs:
run: |
find . -type f -executable -not -perm 755 -exec chmod 755 {} \;
find . -type f -not -executable -not -perm 644 -exec chmod 644 {} \;
# build our docker image
- shell: bash
run: eval ${{ env.BUILD }}
# restore Python dependencies cache
- name: Restore Python dependencies cache
uses: actions/cache@v4
# set up containerd using ghaction-setup-containerd
- name: Set up containerd
uses: crazy-max/ghaction-setup-containerd@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
containerd-version: '1.5.5'

# save Python dependencies cache
- name: Save Python dependencies cache
if: always()
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
# use lazy loading of compatible eStargz Docker image "pages"
- name: Use lazy loading with eStargz
run: |
sudo apt-get update
sudo apt-get install -y fuse-overlayfs
sudo mkdir -p /etc/containerd
echo "version = 2" | sudo tee /etc/containerd/config.toml
echo "[plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options]" | sudo tee -a /etc/containerd/config.toml
echo " SystemdCgroup = true" | sudo tee -a /etc/containerd/config.toml
sudo systemctl restart containerd
# build our docker image
- shell: bash
run: eval ${{ env.BUILD }}

0 comments on commit 03ba97d

Please sign in to comment.