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: add nvidia-open images #69

Merged
merged 2 commits into from
Jan 2, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/build-image-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
matrix:
brand_name: ["aurora"]
with:
image_flavors: '["main", "nvidia", "hwe", "hwe-nvidia"]'
image_flavors: '["main", "nvidia", "nvidia-open", "hwe", "hwe-nvidia", "hwe-nvidia-open"]'
brand_name: ${{ matrix.brand_name }}
stream_name: latest
# This needs splitting, right now a kernel pin will not work due to hwe kernel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-iso-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
matrix:
brand_name: ${{ fromJson(inputs.brand_name || '["aurora"]') }}
with:
image_flavors: '["main", "nvidia", "hwe", "hwe-nvidia"]'
image_flavors: '["main", "nvidia", "nvidia-open", "hwe", "hwe-nvidia", "hwe-nvidia-open"]'
brand_name: ${{ matrix.brand_name }}
stream_name: latest
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
inputs:
image_flavors:
description: "JSON string of flavors to build, '[main, nvidia, hwe, hwe-nvidia]'"
default: "['main', 'nvidia']"
default: "['main', 'nvidia', 'nvidia-open']"
type: string
brand_name:
description: "The Brand Name: aurora"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
inputs:
image_flavors:
description: "JSON string of flavors to build, '[main, nvidia, hwe, hwe-nvidia]'"
default: "['main', 'nvidia']"
default: "['main', 'nvidia', 'nvidia-open']"
type: string
brand_name:
description: "The Brand Name: aurora"
Expand Down
46 changes: 14 additions & 32 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ images := '(
flavors := '(
[main]=main
[nvidia]=nvidia
[nvidia-open]=nvidia-open
[hwe]=hwe
[hwe-nvidia]=hwe-nvidia
[hwe-nvidia-open]=hwe-nvidia-open
[asus]=asus
[asus-nvidia]=asus-nvidia
[asus-nvidia-open]=asus-nvidia-open
[surface]=surface
[surface-nvidia]=surface-nvidia
[surface-nvidia-open]=surface-nvidia-open
)'
tags := '(
[stable]=stable
Expand Down Expand Up @@ -67,17 +71,13 @@ sudo-clean:
# Check if valid combo
[group('Utility')]
[private]
validate image="" tag="" flavor="":
validate $image $tag $flavor:
#!/usr/bin/bash
set -eou pipefail
declare -A images={{ images }}
declare -A tags={{ tags }}
declare -A flavors={{ flavors }}

image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Handle Stable Daily
if [[ "${tag}" == "stable-daily" ]]; then
tag="stable"
Expand Down Expand Up @@ -125,12 +125,9 @@ sudoif command *args:

# Build Image
[group('Image')]
build image="aurora" tag="latest" flavor="main" rechunk="0" ghcr="0" pipeline="0" kernel_pin="":
build $image="aurora" $tag="latest" $flavor="main" rechunk="0" ghcr="0" pipeline="0" $kernel_pin="":
#!/usr/bin/bash
set -eoux pipefail
image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"
Expand Down Expand Up @@ -169,7 +166,6 @@ build image="aurora" tag="latest" flavor="main" rechunk="0" ghcr="0" pipeline="0
just verify-container "${base_image_name}-main:${fedora_version}"

# Kernel Release/Pin
kernel_pin="{{ kernel_pin }}"
if [[ -z "${kernel_pin:-}" ]]; then
kernel_release=$(skopeo inspect --retry-times 3 docker://ghcr.io/ublue-os/${akmods_flavor}-kernel:"${fedora_version}" | jq -r '.Labels["ostree.linux"]')
else
Expand All @@ -182,7 +178,9 @@ build image="aurora" tag="latest" flavor="main" rechunk="0" ghcr="0" pipeline="0
if [[ "${akmods_flavor}" =~ coreos ]]; then
just verify-container "akmods-zfs:${akmods_flavor}-${fedora_version}-${kernel_release}"
fi
if [[ "${flavor}" =~ nvidia ]]; then
if [[ "${flavor}" =~ nvidia-open ]]; then
just verify-container "akmods-nvidia-open:${akmods_flavor}-${fedora_version}-${kernel_release}"
elif [[ "${flavor}" =~ nvidia ]]; then
just verify-container "akmods-nvidia:${akmods_flavor}-${fedora_version}-${kernel_release}"
fi

Expand Down Expand Up @@ -260,14 +258,10 @@ build-pipeline image="aurora" tag="latest" flavor="main" kernel_pin="":
# Rechunk Image
[group('Image')]
[private]
rechunk image="aurora" tag="latest" flavor="main" ghcr="0" pipeline="0":
rechunk $image="aurora" $tag="latest" $flavor="main" ghcr="0" pipeline="0":
#!/usr/bin/bash
set -eoux pipefail

image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"

Expand Down Expand Up @@ -411,12 +405,9 @@ load-rechunk image="aurora" tag="latest" flavor="main":

# Run Container
[group('Image')]
run image="aurora" tag="latest" flavor="main":
run $image="aurora" $tag="latest" $flavor="main":
#!/usr/bin/bash
set -eoux pipefail
image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"
Expand All @@ -435,12 +426,9 @@ run image="aurora" tag="latest" flavor="main":

# Build ISO
[group('ISO')]
build-iso image="aurora" tag="latest" flavor="main" ghcr="0" pipeline="0":
build-iso $image="aurora" $tag="latest" $flavor="main" ghcr="0" pipeline="0":
#!/usr/bin/bash
set -eoux pipefail
image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"
Expand Down Expand Up @@ -570,12 +558,9 @@ build-iso-ghcr image="aurora" tag="latest" flavor="main":

# Run ISO
[group('ISO')]
run-iso image="aurora" tag="latest" flavor="main":
run-iso $image="aurora" $tag="latest" $flavor="main":
#!/usr/bin/bash
set -eoux pipefail
image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"
Expand Down Expand Up @@ -654,12 +639,9 @@ verify-container container="" registry="ghcr.io/ublue-os" key="":

# Secureboot Check
[group('Utility')]
secureboot image="aurora" tag="latest" flavor="main":
secureboot $image="aurora" $tag="latest" $flavor="main":
#!/usr/bin/bash
set -eoux pipefail
image={{ image }}
tag={{ tag }}
flavor={{ flavor }}

# Validate
just validate "${image}" "${tag}" "${flavor}"
Expand Down
11 changes: 8 additions & 3 deletions build_files/base/03-install-kernel-akmods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ rpm-ostree install \

# RPMFUSION Dependent AKMODS
rpm-ostree install \
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-"$(rpm -E %fedora)".noarch.rpm \
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-"$(rpm -E %fedora)".noarch.rpm
rpm-ostree install \
broadcom-wl /tmp/akmods/kmods/*wl*.rpm \
v4l2loopback /tmp/akmods/kmods/*v4l2loopback*.rpm
Expand All @@ -46,7 +46,11 @@ rpm-ostree uninstall rpmfusion-free-release rpmfusion-nonfree-release
# Nvidia AKMODS
if [[ "${IMAGE_NAME}" =~ nvidia ]]; then
# Fetch Nvidia RPMs
skopeo copy --retry-times 3 docker://ghcr.io/ublue-os/akmods-nvidia:"${AKMODS_FLAVOR}"-"$(rpm -E %fedora)"-"${KERNEL}" dir:/tmp/akmods-rpms
if [[ "${IMAGE_NAME}" =~ open ]]; then
skopeo copy --retry-times 3 docker://ghcr.io/ublue-os/akmods-nvidia-open:"${AKMODS_FLAVOR}"-"$(rpm -E %fedora)"-"${KERNEL}" dir:/tmp/akmods-rpms
else
skopeo copy --retry-times 3 docker://ghcr.io/ublue-os/akmods-nvidia:"${AKMODS_FLAVOR}"-"$(rpm -E %fedora)"-"${KERNEL}" dir:/tmp/akmods-rpms
fi
NVIDIA_TARGZ=$(jq -r '.layers[].digest' < /tmp/akmods-rpms/manifest.json | cut -d : -f 2)
tar -xvzf /tmp/akmods-rpms/"$NVIDIA_TARGZ" -C /tmp/
mv /tmp/rpms/* /tmp/akmods-rpms/
Expand All @@ -56,6 +60,7 @@ if [[ "${IMAGE_NAME}" =~ nvidia ]]; then
chmod +x /tmp/nvidia-install.sh
IMAGE_NAME="${BASE_IMAGE_NAME}" RPMFUSION_MIRROR="" /tmp/nvidia-install.sh
rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json
ln -sf libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so
fi

# ZFS for stable
Expand Down
Loading