Skip to content

Commit 62e5f1a

Browse files
authored
Add GAP9 Container Support (pulp-platform#163)
This PR adds comprehensive GAP9 container support with ARM64 compatibility. It uses the latest GAP SDK version (`v5.21.2`). ## Added - GAP9 Container Support with ARM64 architecture support - GAP9 Container with GAP9 SDK (`v5.21.1-staging-1`) - GAP9 Docker GitHub Build Flow (`.github/workflows/docker-build-deeploy-gap9.yml`) - GAP9 Run script for real hardware (`scripts/gap9-run.sh`) - Shell Format pre-commit hook - zsh and oh-my-zsh plugin installation in containers - New GAP9 README documentation (`README_GAP9.md`) - GAP9-specific Docker patches for AMD64 and ARM64 ## Changed - Cleaned up Docker flow to use a temporary build folder - Memory usage is now printed by default on GAP9 - Temporarily disabled GAP9 on forks for CI ## Fixed - Spelling mistakes in documentation - Missing version link
1 parent a55a05b commit 62e5f1a

23 files changed

Lines changed: 1195 additions & 49 deletions

.github/workflows/_runner-gap9-tiled.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
source /app/install/gap9-sdk/.gap9-venv/bin/activate
4646
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
4747
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
48-
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
4948
cd DeeployTest
5049
mkdir -p /app/.ccache
5150
export CCACHE_DIR=/app/.ccache

.github/workflows/_runner-gap9.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
source /app/install/gap9-sdk/.gap9-venv/bin/activate
4646
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
4747
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
48-
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
4948
cd DeeployTest
5049
mkdir -p /app/.ccache
5150
export CCACHE_DIR=/app/.ccache

.github/workflows/ci-platform-gap9-tiled.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ concurrency:
2525

2626
jobs:
2727
select-env:
28+
if: github.repository == 'pulp-platform/Deeploy'
2829
uses: ./.github/workflows/_select-env.yml
2930
with:
3031
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest'}}

.github/workflows/ci-platform-gap9.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ concurrency:
2626

2727
jobs:
2828
select-env:
29+
if: github.repository == 'pulp-platform/Deeploy'
2930
uses: ./.github/workflows/_select-env.yml
3031
with:
3132
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest') }}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
---
6+
name: Docker • Build Deeploy GAP9 Container
7+
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
docker_image_deeploy:
12+
description: "Deeploy Image to use"
13+
required: false
14+
default: "ghcr.io/pulp-platform/deeploy:latest"
15+
16+
jobs:
17+
prepare:
18+
name: Fetch branch name or tag
19+
runs-on: ubuntu-latest
20+
outputs:
21+
docker_tag: ${{ steps.generate_tag.outputs.docker_tag }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up environment variables
26+
run: |
27+
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
28+
echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
29+
echo "IS_TAG=${GITHUB_REF_TYPE}" >> $GITHUB_ENV
30+
31+
- name: Set Docker tag
32+
id: generate_tag
33+
run: |
34+
if [[ "${{ env.IS_TAG }}" == "tag" ]]; then
35+
echo "docker_tag=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT
36+
else
37+
echo "docker_tag=${{ env.BRANCH_NAME }}" >> $GITHUB_OUTPUT
38+
fi
39+
40+
build-deeploy-gap9:
41+
name: Build Deeploy GAP9 Image
42+
needs: [prepare]
43+
runs-on: ${{ matrix.runner }}
44+
outputs:
45+
digest-amd64: ${{ steps.digest.outputs.digest-amd64 }}
46+
digest-arm64: ${{ steps.digest.outputs.digest-arm64 }}
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
platform: [amd64, arm64]
51+
include:
52+
- platform: amd64
53+
runner: ubuntu-latest
54+
- platform: arm64
55+
runner: ubuntu-22.04-arm
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Free up disk space
60+
uses: jlumbroso/free-disk-space@v1.3.1
61+
with:
62+
tool-cache: true
63+
android: true
64+
dotnet: true
65+
haskell: true
66+
large-packages: true
67+
68+
- uses: docker/setup-buildx-action@v3
69+
70+
- name: GHCR Log-in
71+
uses: docker/login-action@v3
72+
with:
73+
registry: ghcr.io
74+
username: ${{ github.actor }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- name: Build Cache for Docker
78+
id: cache
79+
uses: actions/cache@v4
80+
with:
81+
path: var-ccache
82+
key: ${{ runner.os }}-${{ matrix.platform }}-build-cache-deeploy-gap9
83+
84+
- name: Inject build-cache
85+
uses: reproducible-containers/buildkit-cache-dance@v3.1.0
86+
with:
87+
cache-map: |
88+
{
89+
"var-ccache": "/ccache"
90+
}
91+
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
92+
93+
- name: Lower Case Repository Name
94+
run: |
95+
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
96+
env:
97+
OWNER: "${{ github.repository_owner }}"
98+
99+
- name: Load SSH key
100+
uses: webfactory/ssh-agent@v0.9.0
101+
with:
102+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
103+
104+
- name: Build and push final Deeploy image
105+
id: build
106+
uses: docker/build-push-action@v6
107+
with:
108+
platforms: linux/${{ matrix.platform }}
109+
context: .
110+
cache-from: type=gha
111+
cache-to: type=gha,mode=min
112+
file: Container/Dockerfile.deeploy-gap9
113+
push: true
114+
build-args: |
115+
DEEPLOY_IMAGE=${{ github.event.inputs.docker_image_deeploy }}
116+
ssh: default
117+
outputs: type=image,name=ghcr.io/${{ env.OWNER_LC }}/deeploy-gap9,annotation-index=true,name-canonical=true,push=true
118+
119+
- name: Extract image digest
120+
id: digest
121+
run: echo "digest-${{ matrix.platform }}=${{ steps.build.outputs.digest }}" >> $GITHUB_OUTPUT
122+
123+
merge-deeploy-gap9-images:
124+
name: Merge Deeploy GAP9 Images
125+
runs-on: ubuntu-latest
126+
needs: [prepare, build-deeploy-gap9]
127+
steps:
128+
- name: GHCR Log-in
129+
uses: docker/login-action@v3
130+
with:
131+
registry: ghcr.io
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
134+
135+
- name: Lower Case Repository Name
136+
run: |
137+
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
138+
env:
139+
OWNER: "${{ github.repository_owner }}"
140+
141+
- name: Merge Deeploy GAP9 Images
142+
uses: Noelware/docker-manifest-action@v1
143+
with:
144+
inputs: |
145+
ghcr.io/${{ env.OWNER_LC }}/deeploy-gap9@${{ needs.build-deeploy-gap9.outputs.digest-amd64 }},
146+
ghcr.io/${{ env.OWNER_LC }}/deeploy-gap9@${{ needs.build-deeploy-gap9.outputs.digest-arm64 }}
147+
tags: |
148+
ghcr.io/${{ env.OWNER_LC }}/deeploy-gap9:latest,
149+
ghcr.io/${{ env.OWNER_LC }}/deeploy-gap9:${{ needs.prepare.outputs.docker_tag }}
150+
push: true

.github/workflows/docker-build-deeploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
env:
110110
OWNER: "${{ github.repository_owner }}"
111111

112-
- name: Build and push final deploy image
112+
- name: Build and push final Deeploy image
113113
id: build
114114
uses: docker/build-push-action@v6
115115
with:

.github/workflows/infra-generate-ccache-gap9.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ name: Infrastructure • Generate CCache GAP9
1818

1919
jobs:
2020
generate-ccache-gap9:
21+
if: github.repository == 'pulp-platform/Deeploy'
2122
runs-on: ubuntu-latest
2223
container:
2324
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:latest' }}
@@ -39,7 +40,6 @@ jobs:
3940
source /app/install/gap9-sdk/.gap9-venv/bin/activate
4041
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh || true
4142
export GVSOC_INSTALL_DIR=/app/install/gap9-sdk/install/workstation
42-
export GAP_RISCV_GCC_TOOLCHAIN=/app/install/gcc/gap9
4343
cd DeeployTest
4444
mkdir -p /app/.ccache
4545
export CCACHE_DIR=/app/.ccache

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ install/
2424
compile_commands.json
2525
toolchain/**/*/
2626

27+
2728
# Node
2829
package.json
2930
package-lock.json
@@ -52,3 +53,7 @@ DeeployTest/Tests/**/generateTest.py
5253
DeeployTest/out.txt
5354

5455
CHANGELOG_GEN.md
56+
57+
# Container Artifacts
58+
.pyusbip/
59+
.cache/

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exclude: |
1313
| .*TEST_.*
1414
| .*TestFiles.*
1515
| .*runtime.*
16+
| .*\.patch
1617
| .*prebuilt/.*
1718
)
1819
@@ -71,3 +72,7 @@ repos:
7172
- id: yamllint
7273
name: Lint YAML Files
7374
stages: [pre-commit, pre-merge-commit, pre-push, manual]
75+
- repo: https://github.com/scop/pre-commit-shfmt
76+
rev: v3.12.0-2
77+
hooks:
78+
- id: shfmt

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,22 @@ This file contains the changelog for the Deeploy project. The changelog is divid
55

66

77
### List of Pull Requests
8+
- Add GAP9 Container Support [#163](https://github.com/pulp-platform/Deeploy/pull/163)
89
- Extend Codeowners [#164](https://github.com/pulp-platform/Deeploy/pull/164)
910
- Support for MaxPool1D and RQSConv1D for PULPOpen [#146](https://github.com/pulp-platform/Deeploy/pull/146)
1011
- Use Pre-Commit in CI [#159](https://github.com/pulp-platform/Deeploy/pull/159)
1112
- Deeploy-GAP9 Platform [#143](https://github.com/pulp-platform/Deeploy/pull/143)
1213
- Update CLI interface Across Project, Fix Tutorial, and Remove Legacy Test [#157](https://github.com/pulp-platform/Deeploy/pull/157)
1314

1415
### Added
16+
- GAP9 Container Support with ARM64 architecture support
17+
- `zsh` and `oh-my-zsh` plugin installation in containers
18+
- Shell Format pre-commit hook
1519
- Add integer MaxPool1D for Generic platform and RQSConv1D support for PULPOpen, with corresponding kernel tests.
1620
- Added GAP9 Platform Support: Deployer, Bindings, Templates, Tiler, DMA (L3Dma/MchanDma), target library, CI workflows
1721

1822
### Changed
23+
- Cleaned up Docker flow to use a temporary build folder
1924
- Switch CI to use pre-commit for linting
2025
- Update `pulp-nnx` and `pulp-nn-mixed` submodules to their latest versions
2126
- PULP-NN moved to TargetLibraries third-party folder

0 commit comments

Comments
 (0)