From 9216bb208a86319b60e620d2c06676a8ede56261 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 31 Oct 2023 22:47:14 -0500 Subject: [PATCH] feat: use official upstream images for kmod builds (#85) --- .github/workflows/build.yml | 19 +++++++++++++++---- Containerfile.common | 3 ++- Containerfile.nvidia | 3 ++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cabcd672..fc65dcf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,16 +3,15 @@ on: pull_request: merge_group: schedule: - - cron: '0 6 * * *' # 6am everyday (1h after 'config') + - cron: '0 14 * * *' # 2pm UTC everyday (timed against official fedora container pushes, and after 'config') workflow_dispatch: env: IMAGE_NAME: akmods IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} - SOURCE_IMAGE: base jobs: push-ghcr: - name: Build and push akmods image + name: akmods image runs-on: ubuntu-22.04 permissions: contents: read @@ -43,6 +42,17 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v4 + - name: Matrix Variables + shell: bash + run: | + if [[ "${{ matrix.major_version }}" -ge "39" ]]; then + echo "SOURCE_IMAGE=fedora-silverblue" >> $GITHUB_ENV + echo "SOURCE_ORG=fedora" >> $GITHUB_ENV + else + echo "SOURCE_IMAGE=base" >> $GITHUB_ENV + echo "SOURCE_ORG=fedora-ostree-desktops" >> $GITHUB_ENV + fi + - name: Generate tags id: generate-tags shell: bash @@ -97,7 +107,7 @@ jobs: - name: Get current versions id: labels run: | - skopeo inspect docker://quay.io/fedora-ostree-desktops/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }} > inspect.json + skopeo inspect docker://quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }} > inspect.json version=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json) linux=$(jq -r '.Labels["ostree.linux"]' inspect.json) echo "VERSION=$version" >> $GITHUB_OUTPUT @@ -130,6 +140,7 @@ jobs: ${{ steps.generate-tags.outputs.alias_tags }} build-args: | SOURCE_IMAGE=${{ env.SOURCE_IMAGE }} + SOURCE_ORG=${{ env.SOURCE_ORG }} KERNEL_FLAVOR=${{ matrix.kernel_flavor }} FEDORA_MAJOR_VERSION=${{ matrix.major_version }} NVIDIA_MAJOR_VERSION=${{ matrix.nvidia_version }} diff --git a/Containerfile.common b/Containerfile.common index a29d22e3..dc592fc1 100644 --- a/Containerfile.common +++ b/Containerfile.common @@ -4,7 +4,8 @@ #Build from base, simpley because it's the smallest image ARG SOURCE_IMAGE="${SOURCE_IMAGE:-base}" -ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${SOURCE_IMAGE}" +ARG SOURCE_ORG="${SOURCE_ORG:-fedora-ostree-desktops}" +ARG BASE_IMAGE="quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}" FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder diff --git a/Containerfile.nvidia b/Containerfile.nvidia index f6fd0343..9659a181 100644 --- a/Containerfile.nvidia +++ b/Containerfile.nvidia @@ -4,7 +4,8 @@ #Build from base, simpley because it's the smallest image ARG SOURCE_IMAGE="${SOURCE_IMAGE:-base}" -ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${SOURCE_IMAGE}" +ARG SOURCE_ORG="${SOURCE_ORG:-fedora-ostree-desktops}" +ARG BASE_IMAGE="quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}" FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder