This repository has been archived by the owner on May 31, 2024. It is now read-only.
forked from siderolabs/talos
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the kernel and hack the Talos `Makefile` slightly to pass the board and optionally a specific kernel commit via a context override. (This isn't done using the standard Talos approach for custom kernels where you re-pack the initfs since we have a forked installer anyway, this is faster because we can do it in a single pack and `xz` takes forever.) All commits get Docker images for the kernel + installer. Tags get `metal-rock_5b-arm64.img.xz` generated from the commit image (and the installer re-tagged with the Git tag) and attached to a GitHub release.
- Loading branch information
Showing
8 changed files
with
1,559 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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,60 @@ | ||
name: Kernel | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: ['release-1.4'] | ||
paths: | ||
- docker-bake.hcl | ||
- hack/boards/defconfig | ||
- .github/workflows/kernel.yaml | ||
schedule: | ||
- cron: '15 18 * * 2' # 18:15 UTC on Tuesday | ||
|
||
jobs: | ||
kernel: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
packages: none | ||
|
||
outputs: | ||
digest: ${{ steps.docker.outputs.digest }} | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: docker.io | ||
username: milas | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
# we need the local repo contents to get files from `./hack/boards` | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- uses: docker/metadata-action@v4 | ||
id: meta | ||
with: | ||
images: docker.io/milas/rock5-talos-kernel | ||
flavor: latest=false | ||
tags: | | ||
type=schedule,pattern={{date 'YYYYMMDD'}} | ||
type=schedule,pattern=latest | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- uses: docker/bake-action@v2 | ||
with: | ||
push: true | ||
pull: true | ||
targets: kernel | ||
files: | | ||
./docker-bake.hcl | ||
${{ steps.meta.outputs.bake-file }} | ||
set: | | ||
*.cache-from=type=gha | ||
*.cache-to=type=gha,mode=max | ||
*.attest=type=provenance,mode=max |
This file contains 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,97 @@ | ||
name: Talos Images | ||
|
||
on: | ||
push: | ||
branches: [ 'main', 'release-*' ] | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
# REGISTRY is used by Talos makefile targets | ||
REGISTRY: docker.io | ||
# USERNAME is used by Talos makefile targets | ||
USERNAME: milas | ||
|
||
jobs: | ||
talos-installer-image: | ||
runs-on: ubuntu-22.04 | ||
|
||
permissions: | ||
contents: read | ||
packages: none | ||
|
||
strategy: | ||
matrix: | ||
board: [rock-5a, rock-5b] | ||
|
||
steps: | ||
- uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
# ^^^ populated from mandatory vars for Talos makefile | ||
# just done to keep in sync, not for flexibility | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
# need history for `git describe` to work for Talos `Makefile` | ||
fetch-depth: 0 | ||
|
||
- name: Build and push Talos installer image | ||
run: make installer | ||
env: | ||
PUSH: '1' | ||
IMAGE_NAME: rock5-talos | ||
ROCK5_BOARD: ${{ matrix.board }} | ||
PLATFORM: linux/arm64 | ||
PROGRESS: plain | ||
|
||
# TODO(milas): refactor to split release from eMMC image & use matrix strategy | ||
talos-emmc-image: | ||
runs-on: ubuntu-22.04 | ||
needs: talos-installer-image | ||
|
||
if: contains(github.ref, 'refs/tags/') | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Build Flashable Image for Rock 5B | ||
run: | | ||
mkdir -p _out/ | ||
make sbc-rock_5b | ||
env: | ||
IMAGE_NAME: rock5-talos | ||
IMAGE_TAG: ${{ github.ref_name }}-rock-5b | ||
ROCK5_BOARD: rock-5b | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
fail_on_unmatched_files: true | ||
files: _out/metal-rock_5b-arm64.img.xz | ||
generate_release_notes: true |
This file contains 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
This file contains 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
This file contains 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,38 @@ | ||
# virtual target for CI | ||
# https://github.com/docker/metadata-action#bake-definition | ||
target "docker-metadata-action" {} | ||
|
||
target kernel { | ||
inherits = ["docker-metadata-action"] | ||
context = "https://github.com/milas/rock5-toolchain.git" | ||
target = "kernel" | ||
platforms = ["linux/arm64"] | ||
contexts = { | ||
defconfig = "./hack/boards/defconfig" | ||
} | ||
} | ||
|
||
// TODO: this doesn't work because there's still more build args needed | ||
#target "talos-installer" { | ||
# tags = ["ghcr.io/milas/rock5-talos:${BOARD}"] | ||
# target = "talos-installer" | ||
# platforms = ["linux/arm64"] | ||
# args = { | ||
# TOOLS = "ghcr.io/siderolabs/tools:v1.3.0-1-g712379c" | ||
# PKGS = "v1.3.0-9-g9543590" | ||
# EXTRAS = "v1.3.0-1-g3773d71" | ||
# GOFUMPT_VERSION = "v0.4.0" | ||
# GOIMPORTS_VERSION = "v0.1.11" | ||
# STRINGER_VERSION = "v0.1.12" | ||
# ENUMER_VERSION = "v1.1.2" | ||
# DEEPCOPY_GEN_VERSION = "v0.21.3" | ||
# VTPROTOBUF_VERSION = "v0.2.0" | ||
# GOLANGCILINT_VERSION = "v1.50.0" | ||
# DEEPCOPY_VERSION = "v0.5.5" | ||
# IMPORTVET = "ghcr.io/siderolabs/importvet:1549a5c" | ||
# } | ||
# contexts = { | ||
# "ghcr.io/milas/rock5-talos-kernel:${BOARD}" = "target:kernel" | ||
# # "ghcr.io/milas/${BOARD}-u-boot" = "target:_u-boot" | ||
# } | ||
#} |
Oops, something went wrong.