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 a bluefin-framework image #279

Merged
merged 5 commits into from
Jun 19, 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
30 changes: 28 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
fail-fast: false
matrix:
image_flavor: [main, nvidia]
base_name: [bluefin, bluefin-dx, bluefin-dx-framework]
base_name: [bluefin, bluefin-dx, bluefin-framework, bluefin-dx-framework]
major_version: [37, 38]
exclude:
- base_name: bluefin-dx-framework
image_flavor: nvidia
major_version: [37, 38]
- base_name: bluefin-framework
image_flavor: nvidia
include:
- base_name: bluefin-framework
target_base: bluefin
target_name: framework
- base_name: bluefin-dx-framework
target_base: bluefin-dx
target_name: framework
- major_version: 37
is_latest_version: false
is_stable_version: false
Expand Down Expand Up @@ -109,6 +117,20 @@ jobs:
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/bluefin/bluefin/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4

# Update FROM lines for variants that have their own matrix via SED
# This is due to limitations in buildah using interpreted values as registry
# images and not image targets in file:
# `FROM ${TARGET_BASE} as framework`
# evalutates to `FROM bluefin as framework` but buildah then looks for quay.io/bluefin
# vs the existing containerfile target.
# TODO(GH-280): Find an alternative for this rather than using sed.
- name: Build Image
id: sed_workaround
if: matrix.target_base
shell: bash
run: |
sed -i 's/FROM bluefin AS bluefin-framework/FROM ${{ matrix.target_base }} AS ${{ matrix.base_name }}/' Containerfile

# Build image using Buildah action
- name: Build Image
id: build_image
Expand All @@ -123,8 +145,12 @@ jobs:
IMAGE_NAME=${{ env.IMAGE_NAME }}
IMAGE_FLAVOR=${{ matrix.image_flavor }}
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
TARGET_BASE=${{ matrix.target_base }}
labels: ${{ steps.meta.outputs.labels }}
oci: false
# TODO(GH-280)
# extra-args: |
# --target=${{ matrix.target_name || matrix.base_name }}
extra-args: |
--target=${{ matrix.base_name }}

Expand Down
3 changes: 2 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$IMAGE_FLAVOR}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
ARG TARGET_BASE="${TARGET_BASE:-bluefin}"

FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bluefin

Expand Down Expand Up @@ -88,7 +89,7 @@ RUN rm -rf /tmp/* /var/*
RUN ostree container commit

# Image for Framework laptops
FROM bluefin-dx as bluefin-dx-framework
FROM bluefin AS bluefin-framework

COPY framework/usr /usr

Expand Down