Skip to content

Commit aadd3ab

Browse files
authored
[HotFix] Fix Broken CI (#175)
This PR fixes the currently broken CI. This had two reason: 1. `setuptools 82.0.0` recently removed the `pkg_resources` library which is used by GVSoC 2. The Dockerflow did not checkout git lfs files however, this is required to use the precomompiled `udma_v4_gap9_v2_impl.so` **The GAP9 check will only pass on the fork! (See below for status)** ## Changed - Use by default `devel` container for GAP9 CI - Extend Readme platforms with GAP9 shields ## Fixed - Fix Docker flow to fetch `*.so` git lfs files - Downgrade `setuptools` to `81.0.0`
1 parent a571229 commit aadd3ab

7 files changed

Lines changed: 60 additions & 33 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,17 @@ name: CI • GAP9 (Tiled)
1717
docker_image_deeploy:
1818
description: "Deeploy Image to use"
1919
required: false
20-
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
20+
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"
2121

2222
concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: true
2525

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

3332
gap9-kernels-tiled-singlebuffer-L2:
3433
needs: select-env

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: CI • GAP9
1717
docker_image_deeploy:
1818
description: "Deeploy Image to use"
1919
required: false
20-
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
20+
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"
2121

2222

2323
concurrency:
@@ -26,10 +26,9 @@ concurrency:
2626

2727
jobs:
2828
select-env:
29-
if: github.repository == 'pulp-platform/Deeploy'
3029
uses: ./.github/workflows/_select-env.yml
3130
with:
32-
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || (github.repository == 'pulp-platform/Deeploy' && 'ghcr.io/pulp-platform/deeploy-gap9:latest') }}
31+
docker_image_deeploy: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }}
3332

3433
gap9-kernels:
3534
needs: select-env

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name: Infrastructure • Generate CCache GAP9
1111
docker_image_deeploy:
1212
description: "Deeploy GAP9 Image to use"
1313
required: false
14-
default: "ghcr.io/pulp-platform/deeploy-gap9:latest"
14+
default: "ghcr.io/pulp-platform/deeploy-gap9:devel"
1515
schedule:
1616
# Runs the workflow on the default branch every day at 2AM CET to keep the cache fresh
1717
- cron: "0 2 * * *"
@@ -21,7 +21,7 @@ jobs:
2121
if: github.repository == 'pulp-platform/Deeploy'
2222
runs-on: ubuntu-latest
2323
container:
24-
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:latest' }}
24+
image: ${{ github.event.inputs.docker_image_deeploy || 'ghcr.io/pulp-platform/deeploy-gap9:devel' }}
2525
steps:
2626
- name: Checkout Repo
2727
uses: actions/checkout@v4

CHANGELOG.md

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

66

77
### List of Pull Requests
8+
- Fix Broken CI [#175](https://github.com/pulp-platform/Deeploy/pull/175)
89
- Improve Docstring and Debugging [#160](https://github.com/pulp-platform/Deeploy/pull/160)
910
- Add GAP9 Container Support [#163](https://github.com/pulp-platform/Deeploy/pull/163)
1011
- Extend Codeowners [#164](https://github.com/pulp-platform/Deeploy/pull/164)
@@ -23,6 +24,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
2324
- Added GAP9 Platform Support: Deployer, Bindings, Templates, Tiler, DMA (L3Dma/MchanDma), target library, CI workflows
2425

2526
### Changed
27+
- Use by default `devel` container for GAP9 CI
28+
- Extend Readme platforms with GAP9 shields
2629
- Move `MemoryAwareClosureGeneration` pass to `MemoryLevelExtension`
2730
- Move `MemoryAwarePrint*` passes to `MemoryLevelExtension`
2831
- Make `sizeInBytes` a class property instead of a function
@@ -35,6 +38,8 @@ This file contains the changelog for the Deeploy project. The changelog is divid
3538
- Added @runwangdl as a code owner
3639

3740
### Fixed
41+
- Fix Docker flow to fetch `*.so` git lfs files
42+
- Downgrade `setuptools` to `81.0.0`
3843
- im2col buffer size in Conv1d template
3944
- Fix missing dependency in pre-commit-config
4045
- Fix test paths in Deeploy 101 tutorial

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ Now you can open the generated code in `DeeployTest/TEST_SIRACUSA/Tests/testMatM
9090
| **Snitch Cluster** | [Snitch paper](https://arxiv.org/abs/2002.10143) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Snitch](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch.yml) [![CI • Snitch (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-snitch-tiled.yml)
9191
| **SoftHier** | [Repo](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [GVSoC](https://github.com/gvsoc/gvsoc/tree/soft_hier_release) | [![CI • SoftHier](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-softhier.yml)
9292
| **Chimera** | [Repo](https://github.com/pulp-platform/chimera) | [GVSoC](https://github.com/gvsoc/gvsoc) | [![CI • Chimera](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-chimera.yml)
93+
| **GAP9** | [Repo](https://github.com/pulp-platform/gap-sdk) | [GVSoC](https://github.com/pulp-platform/gap-sdk) | [![CI • GAP9](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9.yml) [![CI • GAP9 (Tiled)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml/badge.svg)](https://github.com/pulp-platform/Deeploy/actions/workflows/ci-platform-gap9-tiled.yml)
94+
9395

9496
## Publications
9597

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ readme = "README.md"
1818

1919
requires-python = ">=3.10"
2020
dependencies = [
21+
'setuptools==81.0.0',
2122
'protobuf==4.23.3',
2223
'numpy<2.0.0',
2324
'onnx',

scripts/gap9-build_sdk.sh

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,49 @@
55
# SPDX-License-Identifier: Apache-2.0
66

77
# gap9-build_sdk.sh
8-
# Helper script to clone, patch and build the GAP9 SDK. Intended to be
9-
# invoked from the Makefile with environment variables set:
10-
# GAP9_SDK_INSTALL_DIR (required)
11-
# GAP9_SDK_COMMIT_HASH (optional, fallback provided)
12-
# ROOT_DIR (optional, defaults to script dir)
8+
#
9+
# Clone, prepare, patch, and build a GAP9 SDK checkout in place.
10+
# This script is intended to be called from the project Makefile.
11+
#
12+
# Environment variables:
13+
# GAP9_SDK_INSTALL_DIR Required. Target directory for the SDK checkout/build.
14+
# GAP9_SDK_COMMIT_HASH Required. Commit to checkout.
15+
# GAP_SDK_URL Required. Git remote used for fetching the SDK.
16+
# ROOT_DIR Optional. Base directory for patch lookup.
17+
# Default: directory of this script.
1318

1419
ROOT_DIR="${ROOT_DIR:-$(cd "$(dirname "$0")" && pwd)}"
1520
GAP9_SDK_INSTALL_DIR="${GAP9_SDK_INSTALL_DIR:?GAP9_SDK_INSTALL_DIR must be set}"
16-
GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:-897955d7ab326bd31684429eb16a2e485ab89afb}"
17-
GAP_SDK_URL="${GAP_SDK_URL:-git@iis-git.ee.ethz.ch:wiesep/gap9_sdk.git}"
21+
GAP9_SDK_COMMIT_HASH="${GAP9_SDK_COMMIT_HASH:?GAP9_SDK_COMMIT_HASH must be set}"
22+
GAP_SDK_URL="${GAP_SDK_URL:?GAP_SDK_URL must be set}"
1823

1924
echo "Preparing GAP9 SDK in: ${GAP9_SDK_INSTALL_DIR}"
25+
mkdir -p "${GAP9_SDK_INSTALL_DIR}"
26+
# Fail if CD fails, e.g. due to missing permissions or if the path is a file.
27+
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
2028

21-
if [ -d "${GAP9_SDK_INSTALL_DIR}/.git" ]; then
22-
echo "Directory ${GAP9_SDK_INSTALL_DIR} already exists and looks like a git repo. Updating remote URL and fetching latest changes..."
23-
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
24-
git remote set-url origin "${GAP_SDK_URL}" || true
29+
if [ ! -d ".git" ]; then
30+
# Support reusing a pre-created directory that is not yet a git repo.
31+
echo "Directory exists but .git folder is missing. Reinitializing git repository..."
32+
git init
33+
git remote add origin "${GAP_SDK_URL}"
34+
git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH}
35+
GIT_LFS_SKIP_SMUDGE=1 git reset --hard "${GAP9_SDK_COMMIT_HASH}"
2536
else
26-
echo "Cloning GAP9 SDK..."
27-
GIT_LFS_SKIP_SMUDGE=1 git clone "${GAP_SDK_URL}" "${GAP9_SDK_INSTALL_DIR}"
37+
# Keep local uncommitted changes out of the way before checkout.
38+
echo "Setting remote URL and fetching latest changes..."
39+
git remote set-url origin "${GAP_SDK_URL}"
40+
git fetch --depth=1 origin ${GAP9_SDK_COMMIT_HASH}
41+
git add .
42+
git stash || true # Stash may fail if there are no changes, ignore that.
2843
fi
2944

30-
cd "${GAP9_SDK_INSTALL_DIR}" || exit 1
3145
echo "Checking out commit ${GAP9_SDK_COMMIT_HASH} (stash and fetch if necessary)"
32-
git fetch --all --tags || true
33-
git stash || true
3446
GIT_LFS_SKIP_SMUDGE=1 git checkout "${GAP9_SDK_COMMIT_HASH}"
3547
git submodule update --init --recursive
48+
git lfs pull --include="*.so"
3649

37-
# Platform specific patch
50+
# Select platform patch by Debian arch first, then uname fallback.
3851
ARCH=$(dpkg --print-architecture 2>/dev/null || true)
3952
if [ -z "$ARCH" ]; then
4053
ARCH=$(uname -m)
@@ -45,14 +58,22 @@ arm64 | aarch64) PATCH=gap9-arm64.patch ;;
4558
*) PATCH= ;;
4659
esac
4760

48-
set -e # Enable strict error handling for the build process
49-
if [ -n "$PATCH" ] && [ -f "${ROOT_DIR}/${PATCH}" ]; then
50-
echo "Applying platform patch: $PATCH"
51-
git apply "${ROOT_DIR}/${PATCH}"
61+
set -e # Fail fast for patch/build operations.
62+
if [ -n "$PATCH" ]; then
63+
if [ -f "${ROOT_DIR}/${PATCH}" ]; then
64+
echo "Applying platform patch from ${ROOT_DIR}: $PATCH"
65+
git apply "${ROOT_DIR}/${PATCH}"
66+
elif [ -f "${ROOT_DIR}/Container/${PATCH}" ]; then
67+
echo "Applying platform patch from ${ROOT_DIR}/Container: $PATCH"
68+
git apply "${ROOT_DIR}/Container/${PATCH}"
69+
else
70+
echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH} and ${ROOT_DIR}/Container/${PATCH})"
71+
fi
5272
else
53-
echo "No platform-specific patch to apply for architecture '$ARCH' (looked for ${ROOT_DIR}/${PATCH})"
73+
echo "No platform-specific patch to apply for architecture '$ARCH'"
5474
fi
55-
set +e # Disable strict error handling to allow deactivation even if build fails
75+
76+
set +e # Relax mode so cleanup/deactivate still runs on non-critical failures.
5677

5778
echo "Setting up Python virtual environment and installing dependencies"
5879
python -m venv .gap9-venv
@@ -62,9 +83,9 @@ echo "Sourcing GAP9 SDK environment"
6283
. configs/gap9_evk_audio.sh || true
6384

6485
echo "Invoking make install_dependency cmake_sdk.build"
65-
set -e # Enable strict error handling for the build process
86+
set -e # Build must stop immediately on errors.
6687
make install_dependency cmake_sdk.build openocd.all autotiler.all
67-
set +e # Disable strict error handling to allow deactivation even if build fails
88+
set +e # Allow deactivation even if previous step failed.
6889

6990
deactivate
7091

0 commit comments

Comments
 (0)