Skip to content

Commit

Permalink
build: Use new CI/CD conventions, update all actions and use runners …
Browse files Browse the repository at this point in the history
…explicitly
  • Loading branch information
pojntfx committed Jun 28, 2024
1 parent c1e74b6 commit ab78bb9
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 17 deletions.
47 changes: 37 additions & 10 deletions .github/workflows/kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-oci-image:
runs-on: ubuntu-latest
runs-on: ${{ matrix.target.runner }}
permissions:
contents: read
packages: write
Expand All @@ -16,28 +16,29 @@ jobs:
- src: .
image: ghcr.io/loopholelabs/linux-pvm-ci-build-base
arch: "linux/amd64" # linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/386,linux/s390x,linux/mips64le,linux/ppc64le
runner: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: ${{ matrix.target.image }}
tags: type=semver,pattern={{version}}
- name: Build image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ${{ matrix.target.src }}
file: ${{ matrix.target.src }}/Dockerfile
Expand All @@ -49,7 +50,7 @@ jobs:
cache-to: type=gha,mode=max
- name: Push pre-release image to registry
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ${{ matrix.target.src }}
file: ${{ matrix.target.src }}/Dockerfile
Expand All @@ -61,7 +62,7 @@ jobs:
cache-to: type=gha,mode=max
- name: Push release image to registry
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: ${{ matrix.target.src }}
file: ${{ matrix.target.src }}/Dockerfile
Expand All @@ -73,7 +74,7 @@ jobs:
cache-to: type=gha,mode=max

build-kernel:
runs-on: depot-ubuntu-22.04-32
runs-on: ${{ matrix.target.runner }}
needs: build-oci-image
permissions:
contents: read
Expand All @@ -85,133 +86,159 @@ jobs:
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora baremetal
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-hetzner
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora hetzner
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-digitalocean
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora digitalocean
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-aws
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora aws
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-gcp
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora gcp
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-ovh
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora ovh
dst: out/*
runner: depot-ubuntu-22.04-32
- id: fedora-linode
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile fedora linode
dst: out/*
runner: depot-ubuntu-22.04-32

- id: rocky-baremetal
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky baremetal
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-hetzner
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky hetzner
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-digitalocean
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky digitalocean
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-aws
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky aws
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-gcp
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky gcp
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-equinix
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky equinix
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-ovh
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky ovh
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-azure
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky azure
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-civo
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky civo
dst: out/*
runner: depot-ubuntu-22.04-32
- id: rocky-linode
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile rocky linode
dst: out/*
runner: depot-ubuntu-22.04-32

- id: alma-baremetal
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma baremetal
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-hetzner
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma hetzner
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-digitalocean
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma digitalocean
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-aws
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma aws
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-gcp
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma gcp
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-equinix
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma equinix
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-ovh
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma ovh
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-azure
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma azure
dst: out/*
runner: depot-ubuntu-22.04-32
- id: alma-linode
src: .
os: ghcr.io/loopholelabs/linux-pvm-ci-build-base:master
cmd: ./Hydrunfile alma linode
dst: out/*
runner: depot-ubuntu-22.04-32

steps:
- name: Checkout
Expand Down Expand Up @@ -244,7 +271,7 @@ jobs:
path: ${{ matrix.target.dst }}

publish-kernel:
runs-on: depot-ubuntu-22.04-32
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

To build the kernel packages locally, see the [Hydrunfile](./Hydrunfile), [CI/CD configuration](.github/workflows/kernel.yaml) and [Dockerfile](./Dockerfile).

Linux PVM CI uses GitHub to manage reviews of pull requests.

- If you have a trivial fix or improvement, go ahead and create a pull request,
addressing (with `@...`) the maintainer of this repository (see
[MAINTAINERS.md](./MAINTAINERS.md)) in the description of the pull request.

- If you plan to do something more involved, first discuss your ideas
on our [Discord](https://loopholelabs.io/discord).
This will avoid unnecessary work and surely give you and us a good deal
of inspiration.

- Relevant coding style guidelines are the [Go Code Review
Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)
and the _Formatting and style_ section of Peter Bourgon's [Go: Best
Practices for Production
Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style).

- Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works)
1 change: 1 addition & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Felicitas Pojtinger <felicitaspojtinger@loopholelabs.io> @pojntfx
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Kernel package CI for Linux with PVM patches applied

## Overview

🚧 This project is a work-in-progress! Instructions will be added as soon as it is usable. 🚧
This project builds the Linux kernel as RPM packages for various Linux distros and cloud-provider specific configurations with the [PVM patches](https://github.com/virt-pvm/linux) applied. It also adds a few [custom patches](./patches) to allow snapshot/restore across heterogeneous systems, such as between different cloud providers.

**Interested in using PVM to live migrate VMs between cloud providers or need guest kernel builds?** Check out [Loophole Labs Architect](https://architect.run/) and [Loophole Labs Drafter](https://github.com/loopholelabs/drafter)!

## Installation

Expand Down Expand Up @@ -73,7 +75,7 @@ lsmod | grep pvm # Check if PVM is available

## Contributing

Bug reports and pull requests are welcome on GitHub at [https://github.com/loopholelabs/linux-pvm-ci][gitrepo]. For more contribution information check out [the contribution guide](https://github.com/loopholelabs/linux-pvm-ci/blob/master/CONTRIBUTING.md).
Bug reports and pull requests are welcome on GitHub at [https://github.com/loopholelabs/linux-pvm-ci](https://github.com/loopholelabs/linux-pvm-ci). For more contribution information check out [the contribution guide](./CONTRIBUTING.md).

## License

Expand All @@ -85,8 +87,4 @@ Everyone interacting in the Linux PVM CI project's codebases, issue trackers, ch

## Project Managed By:

[![https://loopholelabs.io][loopholelabs]](https://loopholelabs.io)

[gitrepo]: https://github.com/loopholelabs/linux-pvm-ci
[loopholelabs]: https://cdn.loopholelabs.io/loopholelabs/LoopholeLabsLogo.svg
[loophomepage]: https://loopholelabs.io
[![https://loopholelabs.io](https://cdn.loopholelabs.io/loopholelabs/LoopholeLabsLogo.svg)](https://loopholelabs.io)

0 comments on commit ab78bb9

Please sign in to comment.