Skip to content

Commit a82161b

Browse files
committed
image builds
1 parent ba329ac commit a82161b

8 files changed

Lines changed: 180 additions & 132 deletions

File tree

.github/workflows/build-disk.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Build ISO images
2+
name: Build ISO image
33

44
on:
55
workflow_dispatch:
@@ -24,16 +24,8 @@ concurrency:
2424

2525
jobs:
2626
build:
27-
name: Build ISO (${{ matrix.variant.name }})
27+
name: Build ISO
2828
runs-on: ubuntu-24.04
29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
variant:
33-
- name: "main"
34-
tag: "latest"
35-
- name: "nvidia"
36-
tag: "latest-nvidia"
3729
permissions:
3830
contents: write
3931
packages: read
@@ -55,7 +47,7 @@ jobs:
5547
id: build
5648
uses: binarypie-dev/titanoboa@main
5749
with:
58-
image-ref: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.variant.tag }}
50+
image-ref: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
5951
iso-dest: ${{ github.workspace }}/output.iso
6052
builder-distro: fedora
6153
livesys: true
@@ -68,7 +60,7 @@ jobs:
6860
run: |
6961
set -x
7062
mkdir -p output
71-
NEW_NAME="${{ env.IMAGE_NAME }}-${{ matrix.variant.name }}.iso"
63+
NEW_NAME="${{ env.IMAGE_NAME }}.iso"
7264
mv "${{ steps.build.outputs.iso-dest }}" "output/$NEW_NAME"
7365
(cd output && sha256sum "$NEW_NAME" | tee "$NEW_NAME.sha256")
7466
echo "iso-path=output/$NEW_NAME" >> $GITHUB_OUTPUT
@@ -77,7 +69,7 @@ jobs:
7769
- name: Upload ISO as artifact
7870
uses: actions/upload-artifact@v6
7971
with:
80-
name: ${{ env.IMAGE_NAME }}-${{ matrix.variant.name }}-iso
72+
name: ${{ env.IMAGE_NAME }}-iso
8173
path: output/
8274
if-no-files-found: error
8375
retention-days: 7

.github/workflows/build.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ on:
1515

1616
env:
1717
IMAGE_DESC: "Hypercube - A developer workstation with Hyprland built on Universal Blue"
18-
IMAGE_KEYWORDS: "bootc,ublue,universal-blue,hyprland,hypercube,wayland,developer"
18+
IMAGE_KEYWORDS: "bootc,ublue,universal-blue,hyprland,hypercube,wayland,developer,nvidia"
1919
IMAGE_LOGO_URL: "https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/main/branding/hypercube-logo.png"
2020
IMAGE_NAME: "${{ github.event.repository.name }}"
2121
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
2222
DEFAULT_TAG: "latest"
2323
FEDORA_VERSION: "43"
24+
AKMODS_FLAVOR: "coreos-stable"
2425

2526
concurrency:
2627
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
@@ -36,19 +37,6 @@ jobs:
3637
packages: write
3738
id-token: write
3839

39-
strategy:
40-
fail-fast: false
41-
matrix:
42-
variant:
43-
- flavor: "main"
44-
source_image: "base"
45-
source_suffix: "-main"
46-
tag_suffix: ""
47-
- flavor: "nvidia"
48-
source_image: "base"
49-
source_suffix: "-nvidia"
50-
tag_suffix: "-nvidia"
51-
5240
steps:
5341
- name: Prepare environment
5442
run: |
@@ -73,11 +61,12 @@ jobs:
7361
id: metadata
7462
with:
7563
tags: |
76-
type=raw,value=${{ env.DEFAULT_TAG }}${{ matrix.variant.tag_suffix }}
77-
type=raw,value=${{ env.DEFAULT_TAG }}${{ matrix.variant.tag_suffix }}.{{date 'YYYYMMDD'}}
78-
type=raw,value={{date 'YYYYMMDD'}}${{ matrix.variant.tag_suffix }}
79-
type=sha,enable=${{ github.event_name == 'pull_request' }},suffix=${{ matrix.variant.tag_suffix }}
80-
type=ref,event=pr,suffix=${{ matrix.variant.tag_suffix }}
64+
type=raw,value=${{ env.DEFAULT_TAG }}
65+
type=raw,value=${{ env.DEFAULT_TAG }}.{{date 'YYYYMMDD'}}
66+
type=raw,value=${{ env.FEDORA_VERSION }}
67+
type=raw,value={{date 'YYYYMMDD'}}
68+
type=sha,enable=${{ github.event_name == 'pull_request' }}
69+
type=ref,event=pr
8170
labels: |
8271
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}/refs/heads/main/README.md
8372
org.opencontainers.image.created=${{ steps.date.outputs.date }}
@@ -107,12 +96,10 @@ jobs:
10796
tags: ${{ steps.metadata.outputs.tags }}
10897
labels: ${{ steps.metadata.outputs.labels }}
10998
build-args: |
110-
SOURCE_IMAGE=${{ matrix.variant.source_image }}
111-
SOURCE_SUFFIX=${{ matrix.variant.source_suffix }}
11299
FEDORA_VERSION=${{ env.FEDORA_VERSION }}
113100
IMAGE_NAME=${{ env.IMAGE_NAME }}
114101
IMAGE_VENDOR=${{ github.repository_owner }}
115-
IMAGE_FLAVOR=${{ matrix.variant.flavor }}
102+
AKMODS_FLAVOR=${{ env.AKMODS_FLAVOR }}
116103
oci: false
117104

118105
- name: Login to GitHub Container Registry

Containerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# Hypercube v2 Container Build
2-
# Built from ublue-os/base-main (pure Hyprland, no GNOME)
1+
# Hypercube Container Build
2+
# Built from ublue-os/base-main with NVIDIA support included
3+
# Single unified image for all hardware configurations
34

45
# ============================================
56
# Build Arguments
67
# ============================================
7-
ARG SOURCE_IMAGE="base"
8-
ARG SOURCE_SUFFIX="-main"
98
ARG FEDORA_VERSION="43"
109
ARG IMAGE_NAME=hypercube
1110
ARG IMAGE_VENDOR=binarypie-dev
12-
ARG IMAGE_FLAVOR="main"
1311
ARG SHA_HEAD_SHORT=""
12+
ARG AKMODS_FLAVOR="coreos-stable"
1413

1514
# ============================================
1615
# Stage 1: Context Aggregation
@@ -23,20 +22,20 @@ COPY build_files /build_files
2322
# ============================================
2423
# Stage 2: Main Build
2524
# ============================================
26-
FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${FEDORA_VERSION}
25+
FROM ghcr.io/ublue-os/base-main:${FEDORA_VERSION}
2726

2827
# Re-declare ARGs after FROM (they don't persist across stages)
2928
ARG IMAGE_NAME
3029
ARG IMAGE_VENDOR
31-
ARG IMAGE_FLAVOR
3230
ARG SHA_HEAD_SHORT
3331
ARG FEDORA_VERSION
32+
ARG AKMODS_FLAVOR
3433

3534
# Export build-time environment variables
3635
ENV IMAGE_NAME=${IMAGE_NAME}
3736
ENV IMAGE_VENDOR=${IMAGE_VENDOR}
38-
ENV IMAGE_FLAVOR=${IMAGE_FLAVOR}
3937
ENV FEDORA_VERSION=${FEDORA_VERSION}
38+
ENV AKMODS_FLAVOR=${AKMODS_FLAVOR}
4039

4140
# Copy dot_files (config templates) into the image
4241
COPY dot_files /usr/share/hypercube/config

Justfile

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Hypercube Build System
2+
# Single unified image with NVIDIA support included
23

34
# Configuration
45
export repo_organization := env("REPO_ORGANIZATION", "binarypie-dev")
56
export image_name := env("IMAGE_NAME", "hypercube")
6-
export base_image := env("BASE_IMAGE", "ghcr.io/ublue-os/base-main")
7-
export base_image_nvidia := env("BASE_IMAGE_NVIDIA", "ghcr.io/ublue-os/base-nvidia")
8-
export default_tag := env("DEFAULT_TAG", "stable-daily")
7+
export fedora_version := env("FEDORA_VERSION", "43")
8+
export akmods_flavor := env("AKMODS_FLAVOR", "coreos-stable")
99

1010
# Runtime detection
1111
export SUDO := if `id -u` == "0" { "" } else { "sudo" }
@@ -21,30 +21,22 @@ default:
2121

2222
# Build container image
2323
[group('Build')]
24-
build flavor="main" ghcr="0":
24+
build ghcr="0":
2525
#!/usr/bin/env bash
2626
set -euo pipefail
2727
28-
# Determine base image based on flavor
29-
if [[ "{{ flavor }}" == "nvidia" ]]; then
30-
BASE="{{ base_image_nvidia }}:{{ default_tag }}"
31-
TAG="{{ default_tag }}-nvidia"
32-
else
33-
BASE="{{ base_image }}:{{ default_tag }}"
34-
TAG="{{ default_tag }}"
35-
fi
36-
37-
IMAGE_FULL="{{ image_name }}:${TAG}"
28+
IMAGE_FULL="{{ image_name }}:{{ fedora_version }}"
3829
3930
echo "========================================"
4031
echo "Building: ${IMAGE_FULL}"
41-
echo "Base: ${BASE}"
32+
echo "Base: ghcr.io/ublue-os/base-main:{{ fedora_version }}"
4233
echo "========================================"
4334
4435
BUILD_ARGS=()
45-
BUILD_ARGS+=("--build-arg" "BASE_IMAGE=${BASE}")
36+
BUILD_ARGS+=("--build-arg" "FEDORA_VERSION={{ fedora_version }}")
4637
BUILD_ARGS+=("--build-arg" "IMAGE_NAME={{ image_name }}")
4738
BUILD_ARGS+=("--build-arg" "IMAGE_VENDOR={{ repo_organization }}")
39+
BUILD_ARGS+=("--build-arg" "AKMODS_FLAVOR={{ akmods_flavor }}")
4840
4941
if [[ -z "$(git status -s)" ]]; then
5042
BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=$(git rev-parse --short HEAD)")
@@ -72,33 +64,18 @@ build flavor="main" ghcr="0":
7264
7365
# Build for GHCR push (rootful)
7466
[group('Build')]
75-
build-ghcr flavor="main":
76-
@just build {{ flavor }} 1
77-
78-
# Build both flavors
79-
[group('Build')]
80-
build-all:
81-
@echo "Building main flavor..."
82-
@just build main
83-
@echo ""
84-
@echo "Building nvidia flavor..."
85-
@just build nvidia
67+
build-ghcr:
68+
@just build 1
8669

8770
# Run container interactively for testing
8871
[group('Build')]
89-
run flavor="main":
72+
run:
9073
#!/usr/bin/env bash
9174
set -euo pipefail
9275
93-
if [[ "{{ flavor }}" == "nvidia" ]]; then
94-
TAG="{{ default_tag }}-nvidia"
95-
else
96-
TAG="{{ default_tag }}"
97-
fi
98-
9976
{{ PODMAN }} run -it --rm \
10077
--privileged \
101-
"localhost/{{ image_name }}:${TAG}" \
78+
"localhost/{{ image_name }}:{{ fedora_version }}" \
10279
/bin/bash
10380
10481
# ============================================
@@ -205,21 +182,14 @@ _titanoboa-setup:
205182

206183
# Build ISO from local image using a temporary local registry
207184
[group('ISO')]
208-
build-iso-local flavor="main": _titanoboa-setup
185+
build-iso-local: _titanoboa-setup
209186
#!/usr/bin/bash
210187
set -euo pipefail
211188

212189
REGISTRY_PORT=5000
213190
REGISTRY_NAME="hypercube-registry"
214-
215-
if [[ "{{ flavor }}" == "nvidia" ]]; then
216-
TAG="{{ default_tag }}-nvidia"
217-
ISO_NAME="{{ image_name }}-nvidia.iso"
218-
else
219-
TAG="{{ default_tag }}"
220-
ISO_NAME="{{ image_name }}.iso"
221-
fi
222-
191+
TAG="{{ fedora_version }}"
192+
ISO_NAME="{{ image_name }}.iso"
223193
LOCAL_IMAGE="localhost/{{ image_name }}:${TAG}"
224194

225195
# Get the host IP address that the chroot can reach
@@ -237,7 +207,7 @@ build-iso-local flavor="main": _titanoboa-setup
237207
# Check if image exists in user storage
238208
ID=$({{ PODMAN }} images --filter reference="${LOCAL_IMAGE}" --format "{{{{.ID}}}}")
239209
if [[ -z "$ID" ]]; then
240-
echo "Error: Image ${LOCAL_IMAGE} not found. Run 'just build {{ flavor }}' first."
210+
echo "Error: Image ${LOCAL_IMAGE} not found. Run 'just build' first."
241211
exit 1
242212
fi
243213

@@ -324,21 +294,12 @@ build-iso-local flavor="main": _titanoboa-setup
324294

325295
# Build ISO from GHCR image
326296
[group('ISO')]
327-
build-iso-ghcr flavor="main": _titanoboa-setup
297+
build-iso-ghcr: _titanoboa-setup
328298
#!/usr/bin/bash
329299
set -euo pipefail
330300

331-
REGISTRY="ghcr.io/{{ repo_organization }}"
332-
333-
if [[ "{{ flavor }}" == "nvidia" ]]; then
334-
TAG="latest-nvidia"
335-
ISO_NAME="{{ image_name }}-nvidia.iso"
336-
else
337-
TAG="latest"
338-
ISO_NAME="{{ image_name }}.iso"
339-
fi
340-
341-
IMAGE_FULL="${REGISTRY}/{{ image_name }}:${TAG}"
301+
IMAGE_FULL="ghcr.io/{{ repo_organization }}/{{ image_name }}:latest"
302+
ISO_NAME="{{ image_name }}.iso"
342303

343304
echo "Building ISO for ${IMAGE_FULL}..."
344305

0 commit comments

Comments
 (0)