[WIP]: Update linuxkit #129
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
| # Copyright (c) 2025, Zededa, Inc. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| --- | |
| name: Publish | |
| on: # yamllint disable-line rule:truthy | |
| push: | |
| branches: | |
| - "master" | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+-stable" | |
| paths-ignore: | |
| - '**/*.md' | |
| - '.github/**' | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+-lts" | |
| - "[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" | |
| jobs: | |
| # 1) non-ARM packages, fully parallel | |
| packages-non-arm: | |
| if: github.event.repository.full_name == 'rene/eve' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: X64 | |
| arch: amd64 | |
| platform: "generic" | |
| - os: X64 | |
| arch: riscv64 | |
| platform: "generic" | |
| steps: | |
| - name: Starting Report | |
| run: | | |
| echo Git Ref: ${{ github.ref }} | |
| echo GitHub Event: ${{ github.event_name }} | |
| echo Disk usage | |
| df -h | |
| echo Memory | |
| free -m | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Force fetch annotated tags (workaround) | |
| run: | | |
| git fetch --force --tags | |
| - name: Determine architecture prefix and ref | |
| env: | |
| REF: ${{ github.ref }} | |
| run: | | |
| echo "ARCH=${{ matrix.arch }}" >> "$GITHUB_ENV" | |
| echo "TAG=$(echo "$REF" | sed -e 's#^.*/##' -e 's#master#snapshot#' -e 's#main#snapshot#')" >> "$GITHUB_ENV" | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }} | |
| password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} | |
| - name: Build packages | |
| run: | | |
| SUCCESS= | |
| for i in 1 2 3; do | |
| if make -e V=1 REGISTRY=10.208.13.132 PLATFORM=${{ matrix.platform }} LINUXKIT_PKG_TARGET=push PRUNE=1 pkgs; then | |
| SUCCESS=true | |
| break | |
| else | |
| docker rmi -f $(docker image ls -q) || : | |
| docker system prune -f || : | |
| fi | |
| done | |
| if [ -z "$SUCCESS" ]; then echo "::error::failed to build and push packages" && exit 1; fi | |
| - name: Post package report | |
| run: | | |
| echo Disk usage | |
| df -h | |
| echo Memory | |
| free -m | |
| docker system df | |
| docker system df -v | |
| - name: Clean | |
| run: | | |
| make clean | |
| docker system prune -f -a | |
| rm -rf ~/.linuxkit | |
| # 2) ARM packages, serialized | |
| packages-arm: | |
| if: github.event.repository.full_name == 'rene/eve' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 1 | |
| matrix: | |
| include: | |
| - os: buildjet-4vcpu-ubuntu-2204-arm | |
| arch: arm64 | |
| platform: "generic" | |
| - os: buildjet-4vcpu-ubuntu-2204-arm | |
| arch: arm64 | |
| platform: "nvidia-jp5" | |
| - os: buildjet-4vcpu-ubuntu-2204-arm | |
| arch: arm64 | |
| platform: "nvidia-jp6" | |
| steps: | |
| - name: Starting Report | |
| run: | | |
| echo Git Ref: ${{ github.ref }} | |
| echo GitHub Event: ${{ github.event_name }} | |
| echo Disk usage | |
| df -h | |
| echo Memory | |
| free -m | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Force fetch annotated tags (workaround) | |
| # Workaround for https://github.com/actions/checkout/issues/290 | |
| run: | | |
| git fetch --force --tags | |
| - name: Determine architecture prefix and ref | |
| env: | |
| REF: ${{ github.ref }} | |
| run: | | |
| # some special installs when building for riscv64 | |
| if [ "${{ matrix.arch }}" = riscv64 ]; then | |
| APT_INSTALL="sudo apt install -y binfmt-support qemu-user-static" | |
| # the following weird statement is here to speed up the happy path | |
| # if the default server is responding -- we can skip apt update | |
| $APT_INSTALL || { sudo apt update && $APT_INSTALL ; } | |
| # constraining environment for riscv64 builds | |
| echo "ZARCH=riscv64" >> "$GITHUB_ENV" | |
| fi | |
| echo "ARCH=${{ matrix.arch }}" >> "$GITHUB_ENV" | |
| echo "TAG=$(echo "$REF" | sed -e 's#^.*/##' -e 's#master#snapshot#' -e 's#main#snapshot#')" >> "$GITHUB_ENV" | |
| - name: Login to Docker Hub | |
| if: ${{ github.event.repository.full_name }}== 'rene/eve' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }} | |
| password: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} | |
| - name: Build packages | |
| run: | | |
| SUCCESS= | |
| # sadly, our build sometimes times out on network access | |
| # and running out of disk space: re-trying for 3 times | |
| for i in 1 2 3; do | |
| if make -e V=1 REGISTRY=10.208.13.132 PLATFORM=${{ matrix.platform }} LINUXKIT_PKG_TARGET=push PRUNE=1 pkgs; then | |
| SUCCESS=true | |
| break | |
| else | |
| # the most likely reason for 'make pkgs' to fail is | |
| # the docker cache produced by the build exhausting | |
| # disk space. So the following can't hurt before we | |
| # retry: | |
| docker rmi -f `docker image ls -q` || : | |
| docker system prune -f || : | |
| fi | |
| done | |
| if [ -z "$SUCCESS" ]; then echo "::error::failed to build and push packages" && exit 1; fi | |
| - name: Post package report | |
| run: | | |
| echo Disk usage | |
| df -h | |
| echo Memory | |
| free -m | |
| docker system df | |
| docker system df -v | |
| - name: Clean | |
| run: | | |
| make clean | |
| docker system prune -f -a | |
| rm -rf ~/.linuxkit | |
| # 3) downstream jobs depend on both package jobs | |
| eve: | |
| if: github.event.repository.full_name == 'rene/eve' | |
| needs: [packages-non-arm, packages-arm] | |
| runs-on: X64 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [arm64, amd64] | |
| hv: [kvm, xen] | |
| platform: ["generic"] | |
| include: | |
| - arch: riscv64 | |
| hv: mini | |
| platform: "generic" | |
| - arch: arm64 | |
| hv: kvm | |
| platform: "nvidia-jp5" | |
| - arch: arm64 | |
| hv: kvm | |
| platform: "nvidia-jp6" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/run-make | |
| with: | |
| command: "V=1 REGISTRY=10.208.13.132 HV=${{ matrix.hv }} ZARCH=${{ matrix.arch }} PLATFORM=${{ matrix.platform }} LINUXKIT_PKG_TARGET=push eve" | |
| dockerhub-token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} | |
| dockerhub-account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }} | |
| - uses: ./.github/actions/run-make | |
| if: matrix.arch != 'riscv64' | |
| with: | |
| command: "V=1 REGISTRY=10.208.13.132 HV=${{ matrix.hv }} ZARCH=${{ matrix.arch }} LINUXKIT_PKG_TARGET=push sbom collected_sources compare_sbom_collected_sources publish_sources" | |
| dockerhub-token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} | |
| dockerhub-account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }} | |
| manifest: | |
| if: github.event.repository.full_name == 'rene/eve' | |
| needs: [packages-non-arm, packages-arm] | |
| runs-on: X64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/run-make | |
| with: | |
| command: "V=1 REGISTRY=10.208.13.132 LINUXKIT_PKG_TARGET=manifest pkgs" | |
| dockerhub-token: ${{ secrets.RELEASE_DOCKERHUB_TOKEN }} | |
| dockerhub-account: ${{ secrets.RELEASE_DOCKERHUB_ACCOUNT }} | |
| trigger_assets: | |
| if: ${{ (startsWith(github.ref, 'refs/tags/')) && (github.event.repository.full_name == 'rene/eve') }} | |
| needs: [manifest, eve] | |
| uses: rene/eve/.github/workflows/assets.yml@master | |
| with: | |
| tag_ref: ${{ github.ref_name }} |