Skip to content

Commit efe367b

Browse files
committed
ignore
1 parent 3fc7c6b commit efe367b

File tree

1 file changed

+25
-63
lines changed

1 file changed

+25
-63
lines changed

.github/workflows/debos.yml

Lines changed: 25 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ defaults:
2424
working-directory: debos-recipes
2525

2626
env:
27-
INCUS_IMAGE: images:debian/trixie/arm64
28-
INCUS_NAME: debos
29-
FILESERVER_DIR: /srv/gh-runners/quic-yocto/builds
30-
FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app
27+
BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
28+
FILESERVER_DIR: /efs/qli/metaqcom/gh-runners/quic-yocto/builds
29+
FILESERVER_URL: "https://artifactory-qdc-global.qualcomm.com/artifactory/pdlm-qcomlinux-generic-lv-fed/QualcommLinuxPrd/qualcomm-linux/meta-qcom/${BUILD_ID}"
3130

3231
# cancel in progress builds for this workflow triggered by the same ref
3332
concurrency:
@@ -37,6 +36,11 @@ concurrency:
3736
jobs:
3837
build-debos:
3938
runs-on: [self-hosted, arm64, debbuilder]
39+
container:
40+
image: debian:trixie
41+
volumes:
42+
- /efs/qli/metaqcom/gh-runners/quic-yocto/builds:/efs/qli/metaqcom/gh-runners/quic-yocto/builds
43+
- ./:/build
4044
steps:
4145
- uses: actions/checkout@v4
4246
with:
@@ -46,75 +50,33 @@ jobs:
4650
# avoid an automated update while we're building
4751
- name: Update OS packages
4852
run: |
49-
set -x
50-
sudo apt update
51-
sudo apt -y upgrade
52-
sudo apt -y full-upgrade
53-
54-
# this is the default in our self-hosted runners
55-
- name: Make sure Incus is setup
56-
run: |
57-
set -x
58-
sudo apt -y install incus
59-
sudo incus admin init --auto
60-
61-
# create a fresh container build environment to decouple the build
62-
# operating system from the github runner one; install debos
63-
- name: Setup build environment
64-
run: |
65-
set -x
66-
# privileged container as debos will use mounts
67-
sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \
68-
-c security.privileged=true -c security.nesting=true
69-
sudo incus start "${INCUS_NAME}"
70-
# wait for network to be up (prior to running apt)
71-
sudo incus exec "${INCUS_NAME}" \
72-
/usr/lib/systemd/systemd-networkd-wait-online
73-
(
74-
# these commands are run inside the container
75-
cat <<EOF
76-
apt update
77-
apt -y upgrade
78-
apt -y full-upgrade
79-
apt -y install debos
80-
EOF
81-
) | sudo incus exec "${INCUS_NAME}" -- sh
53+
set -ex
54+
apt update
55+
apt -y upgrade
56+
apt -y full-upgrade
57+
apt -y install debos
8258
8359
- name: Build debos recipe
8460
run: |
85-
set -x
86-
# mount current directory under /build
87-
sudo incus config device add "${INCUS_NAME}" build-dir \
88-
disk "source=${PWD}" path=/build shift=true
89-
(
90-
# these commands are run inside the container
91-
cat <<EOF
92-
cd /build
93-
# debos tries KVM and UML as backends, and falls back to building
94-
# directly on the host, but that requires loop devices; use
95-
# qemu backend explicitly even if it's slower
96-
# qemu backend also requires to set scratchsize, otherwise
97-
# the whole build is done from memory and the out of memory
98-
# killer gets triggered
99-
debos -b qemu --scratchsize 4GiB qualcomm-linux-debian.yaml
100-
EOF
101-
) | sudo incus exec "${INCUS_NAME}" -- sh
61+
set -ex
62+
cd /build
63+
# debos tries KVM and UML as backends, and falls back to building
64+
# directly on the host, but that requires loop devices; use
65+
# qemu backend explicitly even if it's slower
66+
# qemu backend also requires to set scratchsize, otherwise
67+
# the whole build is done from memory and the out of memory
68+
# killer gets triggered
69+
debos -b qemu --scratchsize 4GiB qualcomm-linux-debian.yaml
10270
103-
- name: Upload artifacts to fileserver
71+
- name: Stage image for publishing
10472
run: |
105-
set -x
106-
# curl will be used to talk to fileserver; should be installed by
107-
# default
108-
sudo apt -y install curl
73+
set -ex
10974
# github runs are only unique per repository and may also be re-run;
11075
# create an unique id with repository, run id, and run attempt
11176
id="${GITHUB_REPOSITORY}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
11277
# create a directory for the current run
11378
dir="${FILESERVER_DIR}/${id}"
11479
mkdir -vp "${dir}"
115-
# copy output files
80+
# Files placed under ${dir} will be published internally
11681
cp -v disk.img "${dir}"
117-
# instruct fileserver to publish this directory
118-
url="${FILESERVER_URL}/${id}/"
119-
curl -X POST -H 'Accept: text/event-stream' "${url}"
12082

0 commit comments

Comments
 (0)