diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30b35de..b8759ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} - runs-on: edera-large + runs-on: "${{ matrix.builds.runner }}"" env: KERNEL_PUBLISH: "${{ inputs.publish }}" KERNEL_VERSION: "${{ matrix.builds.version }}" diff --git a/README.md b/README.md index 19c0d09..c50793b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# linux-kernel-oci (testing) +# linux-kernel-oci Build the Linux kernel into OCI images. diff --git a/config.yaml b/config.yaml index fb601df..3e6971a 100644 --- a/config.yaml +++ b/config.yaml @@ -60,3 +60,8 @@ images: - target: sdk name: "[flavor]-kernel-sdk" format: kernel.sdk +runners: +- name: edera-large + flavors: + - host +- name: ubuntu-latest diff --git a/hack/build/generate-matrix.py b/hack/build/generate-matrix.py index 973d035..f7c9ddb 100644 --- a/hack/build/generate-matrix.py +++ b/hack/build/generate-matrix.py @@ -75,6 +75,7 @@ def construct_manual_matrix(exact_versions): final_matrix = matrix.filter_matrix(final_matrix, constraint) matrix.validate_produce_conflicts(final_matrix) +matrix.fill_runners(final_matrix) print("generated %s builds" % len(final_matrix["builds"])) matrix.summarize_matrix(final_matrix) diff --git a/hack/build/matrix.py b/hack/build/matrix.py index 7cee2fa..9562e97 100644 --- a/hack/build/matrix.py +++ b/hack/build/matrix.py @@ -270,13 +270,14 @@ def summarize_matrix(matrix): image_names.append(image_name) tags.sort() print( - "build %s %s for %s with tags %s on %s" + "build %s %s for %s with tags %s to %s on %s" % ( build["flavor"], build["version"], ", ".join(build["architectures"]), ", ".join(tags), ", ".join(image_names), + build["runner"], ) ) @@ -369,3 +370,20 @@ def generate_backbuild_matrix(): if major_minor in tags: tags.pop(major_minor) return generate_matrix(tags) + + +def pick_runner(build) -> str: + version = build["version"] + version_info = parse(version) + flavor = build["flavor"] + for runner in CONFIG["runners"]: + if matches_constraints( + version_info, flavor, runner, is_current_release=is_release_current(version) + ): + return runner["name"] + raise Exception("No runner found for build %s" % build) + + +def fill_runners(matrix): + for build in matrix["builds"]: + build["runner"] = pick_runner(build) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5f481a3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +pyyaml +packaging