-
Notifications
You must be signed in to change notification settings - Fork 22
ci: add workflow to build debos recipe #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| name: Build debos recipe | ||
|
|
||
| on: | ||
| # run on pull requests to the main branch | ||
| pull_request: | ||
| branches: [main] | ||
| # run on pushes to the main branch | ||
| push: | ||
| branches: [main] | ||
| # run daily at 8:30am | ||
| schedule: | ||
| - cron: '30 8 * * *' | ||
| # allow manual runs | ||
| workflow_dispatch: | ||
|
|
||
| # only need permission to read repository; implicitely set all other | ||
| # permissions to none | ||
| permissions: | ||
| contents: read | ||
|
|
||
| defaults: | ||
| # run all commands from the debos-recipes directory | ||
| run: | ||
| working-directory: debos-recipes | ||
|
|
||
| env: | ||
| INCUS_IMAGE: images:debian/trixie/arm64 | ||
| INCUS_NAME: debos | ||
|
|
||
| # cancel in progress builds for this workflow triggered by the same ref | ||
ndechesne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build-debos: | ||
| runs-on: [self-hosted, arm64, debbuilder] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # this is the default in our self-hosted runners | ||
| - name: Make sure Incus is setup | ||
| run: | | ||
| set -x | ||
| sudo apt -y install incus | ||
| sudo incus admin init --auto | ||
|
|
||
| # create a fresh container build environment to decouple the build | ||
| # operating system from the github runner one; install debos | ||
| - name: Setup build environment | ||
| run: | | ||
| set -x | ||
| # privileged container as debos will use mounts | ||
| sudo incus init "${INCUS_IMAGE}" "${INCUS_NAME}" \ | ||
| -c security.privileged=true -c security.nesting=true | ||
| sudo incus start "${INCUS_NAME}" | ||
| # wait for network to be up (prior to running apt) | ||
| sudo incus exec "${INCUS_NAME}" \ | ||
| /usr/lib/systemd/systemd-networkd-wait-online | ||
| ( | ||
| # these commands are run inside the container | ||
| cat <<EOF | ||
| apt update | ||
| apt upgrade -y | ||
| apt install -y debos | ||
| EOF | ||
| ) | sudo incus exec "${INCUS_NAME}" -- sh | ||
|
|
||
| - name: Build debos recipe | ||
| run: | | ||
| set -x | ||
| # mount current directory under /build | ||
| sudo incus config device add "${INCUS_NAME}" build-dir \ | ||
| disk "source=${PWD}" path=/build shift=true | ||
| ( | ||
| # these commands are run inside the container | ||
| cat <<EOF | ||
| cd /build | ||
| # debos tries KVM and UML as backends, and falls back to building | ||
| # directly on the host, but that requires loop devices; use | ||
| # qemu backend explicitly even if it's slower | ||
| # qemu backend also requires to set scratchsize, otherwise | ||
| # the whole build is done from memory and the out of memory | ||
| # killer gets triggered | ||
| debos -b qemu --scratchsize 4GiB qualcomm-linux-debian.yaml | ||
| EOF | ||
| ) | sudo incus exec "${INCUS_NAME}" -- sh | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.