Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use official upstream images for kmod builds #85

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading