Skip to content

Commit 60e94d7

Browse files
Run Debusine builds inside GHCR container
Switch the reusable Debusine build workflow from Incus orchestration to a job-level container image, execute source package generation directly in the mounted workspace, and expand builder image coverage for bookworm and forky. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 68bb7a5 commit 60e94d7

8 files changed

Lines changed: 64 additions & 48 deletions

File tree

.github/workflows/qcom-build-pkg-reusable-workflow.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ jobs:
6060
build:
6161
name: Build
6262
runs-on: ubuntu-latest
63+
container:
64+
image: ghcr.io/qualcomm-linux/debusine-pkg-builder:${{ inputs.suite == 'unstable' && 'sid' || inputs.suite }}
65+
credentials:
66+
username: ${{ github.actor }}
67+
password: ${{ secrets.GITHUB_TOKEN }}
6368

6469
outputs:
6570
workspace: ${{ steps.build.outputs.workspace }}
@@ -97,35 +102,23 @@ jobs:
97102
run: |
98103
set -ex
99104
100-
qcom-build-utils/scripts/ci/prepare-incus
101-
qcom-build-utils/scripts/ci/prepare-debusine
102-
103105
if [ "${{ inputs.release }}" = "true" ]; then
104106
echo "::group::Prepare release"
105-
sudo apt-get install --update --no-install-recommends -y devscripts dpkg-dev git-buildpackage
106107
SUITE=${{ inputs.suite }} qcom-build-utils/scripts/ci/prepare-release
107108
echo "::endgroup::"
108109
fi
109110
110-
echo "::group::Generate source package"
111-
sudo apt-get install --update --no-install-recommends -y devscripts dctrl-tools
112111
SUITE=${{ inputs.suite }} qcom-build-utils/scripts/ci/generate-source-package
113-
# Push the files referenced by the source package Debusine imports
114-
# (.dsc + orig tarball + Debian tarball), not just the .changes set.
115-
dcmd sudo incus file push *.dsc debusine/root/
116-
echo "::endgroup::"
117-
118-
sudo incus exec debusine env \
112+
env \
119113
"GITHUB_REPOSITORY_ID=${{ github.repository_id }}" \
120114
"GITHUB_RUN_ID=${{ github.run_id }}" \
121115
"GITHUB_RUN_ATTEMPT=${{ github.run_attempt }}" \
122116
"DEBUSINE_HOST=${{ vars.DEBUSINE_HOST }}" \
123117
"DEBUSINE_SCOPE=${{ vars.DEBUSINE_SCOPE }}" \
124-
"DEBUSINE_USER=${{ secrets.DEBUSINE_USER }}" \
125118
"DEBUSINE_TOKEN=${{ secrets.DEBUSINE_TOKEN }}" \
126119
"SUITE=${{ inputs.suite }}" \
127-
lib/ci/build
128-
sudo incus exec debusine cat output >> "$GITHUB_OUTPUT"
120+
qcom-build-utils/scripts/ci/build
121+
cat output >> "$GITHUB_OUTPUT"
129122
130123
# Place this in the release workflow
131124
# - name: Upload release bundle

.github/workflows/qcom-debusine-container-build-and-upload.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
suite:
45+
- bookworm
46+
- forky
4547
- trixie
4648
- sid
4749

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM debian:bookworm
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
COPY base-packages.txt /tmp/base-packages.txt
6+
COPY bookworm-backports.sources /etc/apt/sources.list.d/bookworm-backports.sources
7+
8+
RUN apt-get update && \
9+
apt-get install --no-install-recommends -y \
10+
$(tr '\n' ' ' < /tmp/base-packages.txt) \
11+
debusine-client/bookworm-backports \
12+
python3-debusine/bookworm-backports && \
13+
apt-get clean && \
14+
rm -rf /var/lib/apt/lists/* /tmp/base-packages.txt
15+
16+
WORKDIR /workspace
17+
18+
CMD ["bash"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM debian:forky
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
COPY base-packages.txt /tmp/base-packages.txt
6+
7+
RUN apt-get update && \
8+
apt-get install --no-install-recommends -y \
9+
$(tr '\n' ' ' < /tmp/base-packages.txt) \
10+
debusine-client \
11+
python3-debusine && \
12+
apt-get clean && \
13+
rm -rf /var/lib/apt/lists/* /tmp/base-packages.txt
14+
15+
WORKDIR /workspace
16+
17+
CMD ["bash"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Types: deb
2+
URIs: http://deb.debian.org/debian
3+
Suites: bookworm-backports
4+
Components: main
5+
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ See [pkg-example](https://github.com/qualcomm-linux/pkg-example) for a complete
141141

142142
| Component | Details |
143143
|-----------|---------|
144-
| **Container images** | `ghcr.io/qualcomm-linux/pkg-builder:{arch}-{distro}` — pre-built for `arm64`/`amd64` across `noble`, `questing`, `resolute`, `trixie`, `sid` |
144+
| **Container images** | `ghcr.io/qualcomm-linux/debusine-pkg-builder:{suite}` for Debusine-based package workflow execution, with suites such as `bookworm`, `forky`, `trixie`, and `sid` |
145145
| **Staging APT repo** | [pkg-oss-staging-repo](https://github.com/qualcomm-linux/pkg-oss-staging-repo) served via GitHub Pages |
146-
| **Runners** | Self-hosted ARM64 runners (`lecore-prd-u2404-arm64-xlrg-od-ephem`) |
146+
| **Runners** | Standard GitHub-hosted runners (`ubuntu-latest`) for the Debusine build path; Debusine performs the actual package compilation remotely |
147147
| **Artifact storage** | S3 for release builds |
148148

149149
## Build & Utility Scripts

scripts/ci/build

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ set -o pipefail
44

55
# Send a source package to Debusine for building and wait for build completion
66

7-
# Run inside the container created with `lib/ci/prepare-debusine`
8-
97
# Dependencies:
10-
# `debusine` incus container (Debusine will be configured)
8+
# debusine client packages available in the current execution environment
119

1210
# Inputs:
1311
# GITHUB_REPOSITORY_ID
@@ -24,6 +22,8 @@ set -o pipefail
2422

2523
echo "::group::Build in Debusine"
2624

25+
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
26+
2727
child_ci_suffix=gh-${GITHUB_REPOSITORY_ID}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}
2828
workspace="ci-${child_ci_suffix}"
2929

@@ -41,7 +41,7 @@ EOF
4141
)
4242

4343
workflow_id=$(echo "suffix: $child_ci_suffix"|debusine workflow start -w ci --yaml create-child-workspace|yq -r .id)
44-
lib/ci/poll_workflow.py "$workflow_id"
44+
"$script_dir/poll_workflow.py" "$workflow_id"
4545
debusine archive suite create --architecture all --architecture amd64 --architecture arm64 ${SUITE}
4646
debusine workflow-template create debian_pipeline debian-pipeline <<END
4747
static_parameters:
@@ -66,7 +66,7 @@ debusine_pipeline_output=$(echo "source_artifact: ${artifact_id}@artifacts" | de
6666
echo "debusine workflow start (debian-pipeline) output: $debusine_pipeline_output"
6767
workflow_id=$(echo "$debusine_pipeline_output" | yq -r .id)
6868
echo "workflow_id: $workflow_id"
69-
lib/ci/poll_workflow.py "$workflow_id"
69+
"$script_dir/poll_workflow.py" "$workflow_id"
7070

7171
echo "workspace=$workspace" > output
7272
echo "::endgroup::"

scripts/ci/generate-source-package

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,14 @@ set -ex
99
# achieve. This script should contain all the knowledge required to build
1010
# source packages from these exceptional source trees.
1111

12-
# The `dpkg-buildpackage -S` step is specifically done inside a container that
13-
# matches the target suite in case there are nuances that break when not done
14-
# this way.
15-
16-
# This script should run from a host system with Incus available. It will do
17-
# the work inside a container as needed.
18-
19-
# Run on the host
20-
2112
# Dependencies:
22-
# incus (configured)
2313
# devscripts
2414
# dctrl-tools
15+
# git-buildpackage
2516

2617
# Inputs:
27-
# $PWD/srcpkg/: checked out source tree
28-
# $SUITE: target suite to prepare in (eg. 'trixie')
18+
# Current working directory contains srcpkg/ checked out from the package repo
19+
# Execution environment already matches the target Debian suite
2920

3021
# Outputs:
3122
# Parent directory: .changes files for source package together with all
@@ -37,28 +28,18 @@ set -ex
3728
# 2. Install build dependencies before building the source package
3829

3930
echo "::group::Prepare source package"
40-
sudo incus launch "images:debian/$SUITE" srcbuild
41-
# incus file push -r skips hidden directories (e.g. .git), so use tar to
42-
# transfer the full source tree including .git into the container.
43-
tar -C . -czf - srcpkg | sudo incus exec srcbuild -- tar -xzf - -C /root/
44-
sudo incus exec srcbuild -- sh - <<END
45-
set -ex
46-
apt-get install --update --no-install-recommends -y devscripts dpkg-dev git-buildpackage
47-
# The transferred files are owned by the runner UID rather than root, which
48-
# causes git to refuse the repository (safe.directory). Mark it as trusted.
49-
git config --global --add safe.directory /root/srcpkg
5031
cd srcpkg
32+
# GitHub Actions job containers mount the workspace from the host, so mark the
33+
# repository as trusted before invoking git-buildpackage.
34+
git config --global --add safe.directory "$(pwd)"
5135
# For non-native packages (3.0 quilt), the orig tarball must exist before
5236
# dpkg-buildpackage -S can produce the source package. Export it from the
5337
# upstream git tree (upstream/VERSION tag, falling back to upstream/latest).
5438
if grep -q "quilt" debian/source/format 2>/dev/null; then
5539
gbp export-orig
5640
fi
5741
dpkg-buildpackage -S -d -nc
58-
END
59-
for artifact_file in $(sudo incus exec srcbuild -- sh -c 'cd /root && dcmd echo *.changes'); do
60-
sudo incus file pull "srcbuild/root/$artifact_file" .
61-
done
42+
cd ..
6243

6344
cat >> "$GITHUB_OUTPUT" <<END
6445
srcpkg_name=$(grep-dctrl -nsSource . *.dsc)

0 commit comments

Comments
 (0)