Skip to content

Commit

Permalink
feat: use official upstream images for kmod builds (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman authored Nov 1, 2023
1 parent 1767205 commit 9216bb2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Containerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9216bb2

Please sign in to comment.