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

Add UBI image #85

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ceccf82
add ubi
JasonN3 Mar 19, 2024
110e9d0
allow running from dispatch
JasonN3 Mar 19, 2024
01c011d
no token
JasonN3 Mar 19, 2024
17a35fc
remove arg
JasonN3 Mar 19, 2024
38d304f
use format
JasonN3 Mar 19, 2024
97f8fce
just use entitlement
JasonN3 Mar 19, 2024
79d7381
mount to run
JasonN3 Mar 19, 2024
1391088
just secrets
JasonN3 Mar 19, 2024
2d4d804
debug
JasonN3 Mar 19, 2024
e7d6621
hardcode
JasonN3 Mar 19, 2024
578c751
pass secrets
JasonN3 Mar 19, 2024
97ea650
is ssh key and remove debug
JasonN3 Mar 19, 2024
298998d
debug
JasonN3 Mar 19, 2024
4805939
debug
JasonN3 Mar 19, 2024
a564132
debug
JasonN3 Mar 19, 2024
ac39db1
debug
JasonN3 Mar 19, 2024
61ca52d
disable ubi repos
JasonN3 Mar 19, 2024
07a5252
replace coreutils-single with coreutils
JasonN3 Mar 19, 2024
1e6b2d5
missing ;
JasonN3 Mar 19, 2024
f7d0f5b
don't create a separate ubi container
JasonN3 Mar 20, 2024
1a9354f
set base image
JasonN3 Mar 20, 2024
a38f8a8
consistent var names and refresh repos
JasonN3 Mar 20, 2024
05fd98f
set image_tag
JasonN3 Mar 20, 2024
3f560ce
rhel specific items
JasonN3 Mar 20, 2024
a45a01d
add missing var
JasonN3 Mar 20, 2024
9e199f9
fix location
JasonN3 Mar 20, 2024
b4159cf
debug
JasonN3 Mar 20, 2024
9ef7c37
create symlinks
JasonN3 Mar 20, 2024
274ab64
debug
JasonN3 Mar 20, 2024
c3a90e9
use repolist instead
JasonN3 Mar 20, 2024
9dcb61b
must use dnf command to generate redhat.repo
JasonN3 Mar 20, 2024
d5873a6
ignore everything
JasonN3 Mar 20, 2024
b8f5022
exclude flatpak in rhel
JasonN3 Mar 20, 2024
2205004
exclude 7
JasonN3 Mar 20, 2024
63a9b8c
better check
JasonN3 Mar 20, 2024
8dfa233
first entry can't be empty
JasonN3 Mar 20, 2024
72dc306
remove else
JasonN3 Mar 20, 2024
8a906ec
build separate ubi container
JasonN3 Mar 20, 2024
1bf30ea
replace coreutils-single
JasonN3 Mar 20, 2024
b39bc92
what's in results
JasonN3 Mar 20, 2024
1a4a224
remove 9
JasonN3 Mar 20, 2024
eab4f7e
non-EFI moved in rhel
JasonN3 Mar 20, 2024
99b9945
only add if found
JasonN3 Mar 20, 2024
fb8a91c
remove noupgrade
JasonN3 Mar 21, 2024
5422832
Merge branch 'main' into ubi
JasonN3 Apr 4, 2024
11f3bec
add secrets
JasonN3 Apr 4, 2024
dcda4a8
use branch for rhel
JasonN3 Apr 4, 2024
e9544dc
export var to submakes
JasonN3 Apr 5, 2024
39ef9ee
fix case
JasonN3 Apr 5, 2024
4debc90
debug
JasonN3 Apr 8, 2024
ae2dff3
check if file exists
JasonN3 Apr 8, 2024
67c9098
ensure file exists
JasonN3 Apr 8, 2024
a483dc9
separate tests
JasonN3 Apr 8, 2024
3638e94
load right file
JasonN3 Apr 8, 2024
3f08dd5
split tests
JasonN3 Apr 8, 2024
ef44295
use separate tests
JasonN3 Apr 8, 2024
d75b605
set product
JasonN3 Apr 8, 2024
8658db4
only use variant if it's defined
JasonN3 Apr 9, 2024
40e0d37
remove squashfs-only
JasonN3 Apr 9, 2024
8c15653
use squashfs-only when not rhel
JasonN3 Apr 9, 2024
6543a59
fix needs
JasonN3 Apr 9, 2024
a547996
set repos for iso test
JasonN3 Apr 10, 2024
73b32f2
rhel uses isolinux
JasonN3 Apr 10, 2024
1584dde
boot is only for non-rhel
JasonN3 Apr 10, 2024
54a89bb
only use major part of version
JasonN3 Apr 10, 2024
d3d40c2
expand context
JasonN3 Apr 10, 2024
1a23a96
add ubi input
JasonN3 Apr 10, 2024
8420f93
replace major version
JasonN3 Apr 10, 2024
25c669e
remove quotes
JasonN3 Apr 10, 2024
6941e9c
fix destination path
JasonN3 Apr 10, 2024
45d9b42
remove live dir
JasonN3 Apr 10, 2024
597054a
based on rhel var instead of dir existing
JasonN3 Apr 10, 2024
f091703
change duplicate job name
JasonN3 Apr 11, 2024
f7dab0a
change to 9
JasonN3 Apr 11, 2024
a652267
update to ubi9
JasonN3 Apr 11, 2024
aacfcdc
update ubi version
JasonN3 Apr 11, 2024
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
36 changes: 28 additions & 8 deletions .github/workflows/bot_commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/workflows/build_vars.yml

run-all_tests:
name: Run All Tests
name: All Tests
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run tests')
Expand All @@ -36,6 +36,9 @@ jobs:
with:
pr: ${{ github.event.issue.number }}
parent_job_name: Run All Tests
secrets:
RH_REPO: ${{ secrets.RH_REPO }}
RH_ENT: ${{ secrets.RH_ENT }}

run_build_container:
name: Run Build Container
Expand All @@ -52,6 +55,9 @@ jobs:
with:
pr: ${{ github.event.issue.number }}
parent_job_name: Run Build Container
secrets:
RH_REPO: ${{ secrets.RH_REPO }}
RH_ENT: ${{ secrets.RH_ENT }}

run_build_iso:
name: Run Build ISO
Expand All @@ -69,36 +75,50 @@ jobs:
pr: ${{ github.event.issue.number }}
parent_job_name: Run Build ISO

run_test_iso:
name: Run ISO Tests
run_build_iso_rhel:
name: Run Build RHEL ISO
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run test iso')
contains(github.event.comment.body, '/run build iso')
permissions:
contents: read
packages: write
statuses: write
needs:
- permissions
uses: ./.github/workflows/build_iso_rhel.yml
with:
pr: ${{ github.event.issue.number }}
parent_job_name: Run Build ISO
secrets:
RH_REPO: ${{ secrets.RH_REPO }}
RH_ENT: ${{ secrets.RH_ENT }}

run_test_iso:
name: Run ISO Tests
permissions:
contents: read
packages: write
statuses: write
needs:
- permissions
- load_vars
- run_build_iso
uses: ./.github/workflows/test_iso.yml
with:
pr: ${{ github.event.issue.number }}
parent_job_name: Run ISO Tests

run_test_deployment:
name: Run ISO Deployment Tests
if: >
github.event.issue.pull_request &&
contains(github.event.comment.body, '/run test iso')
permissions:
contents: read
packages: write
statuses: write
needs:
- permissions
- load_vars
- run_test_iso
- run_build_iso
uses: ./.github/workflows/test_deployment.yml
with:
pr: ${{ github.event.issue.number }}
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ on:
parent_job_name:
required: true
type: string
secrets:
RH_REPO:
required: true
RH_ENT:
required: true



jobs:
build-container:
if: >
github.event_name == 'push' ||
github.event_name == 'issue_comment' ||
github.event_name == 'issue_comment' ||
github.event_name == 'workflow_dispatch'
name: Build Container Image
env:
Expand All @@ -24,6 +31,19 @@ jobs:
contents: read
packages: write
statuses: write
continue-on-error: false
strategy:
fail-fast: false
matrix:
os:
- registry.fedoraproject.org/fedora
- registry.access.redhat.com/ubi9/ubi
include:
- os: registry.fedoraproject.org/fedora
tag: 39
- os: registry.access.redhat.com/ubi9/ubi
tag: latest
append: ubi
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -67,7 +87,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -81,17 +101,31 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
ghcr.io/${{ github.repository }}${{ matrix.append && format('-{0}', matrix.append) }}
tags: |
pr-${{ inputs.pr }}

- name: Get UBI Subs
if: matrix.append == 'ubi'
uses: actions/checkout@v4
with:
repository: ${{ secrets.RH_REPO }}
ssh-key: ${{ secrets.RH_ENT }}
persist-credentials: false
path: ubi

- name: Buildah Build
id: build-image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: Containerfile
tags: ${{ steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
labels: ${{ steps.meta.outputs.labels || steps.meta_pr.outputs.labels }}
build-args: |
BASE_IMAGE=${{ matrix.os }}
IMAGE_VERSION=${{ matrix.tag }}
extra-args: |
${{ matrix.append == 'ubi' && format('--volume={0}/ubi:/run/secrets', github.workspace) || ''}}

- name: Push image
uses: redhat-actions/push-to-registry@v2
Expand All @@ -109,4 +143,4 @@ jobs:
status: ${{ job.status }}
context: ${{ env.JOB_NAME }}
sha: ${{ env.sha }}
targetUrl: ${{ steps.jobs.outputs.html_url }}
targetUrl: ${{ steps.jobs.outputs.html_url }}
5 changes: 3 additions & 2 deletions .github/workflows/build_iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
sha: ${{ env.sha }}
targetUrl: ${{ steps.jobs.outputs.html_url }}

Expand Down Expand Up @@ -124,6 +124,7 @@ jobs:
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
iso_name: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
repos: '/etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo'

- name: Upload ISO as artifact
id: upload
Expand All @@ -144,7 +145,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
sha: ${{ env.sha }}
targetUrl: ${{ steps.jobs.outputs.html_url }}

158 changes: 158 additions & 0 deletions .github/workflows/build_iso_rhel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: Build ISO

on:
workflow_call:
inputs:
pr:
required: false
type: string
parent_job_name:
required: true
type: string
suffix:
required: false
type: string
secrets:
RH_REPO:
required: true
RH_ENT:
required: true

jobs:
load_vars:
name: Load Variables
uses: ./.github/workflows/build_vars_rhel.yml

build_iso:
name: Build ISO
env:
JOB_NAME: Build ISO
runs-on: ubuntu-latest
needs:
- load_vars
permissions:
contents: read
packages: write
statuses: write
continue-on-error: false
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Switch branch
if: inputs.pr
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
run: |
sudo apt-get update
sudo apt-get install -y hub
hub pr checkout ${{ inputs.pr }}
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Get Current Job Log URL
if: inputs.pr && always()
uses: Tiryoh/gha-jobid-action@v1
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"

- name: Set status
if: inputs.pr && always()
uses: myrotvorets/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: pending
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
sha: ${{ env.sha }}
targetUrl: ${{ steps.jobs.outputs.html_url }}

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ needs.load_vars.outputs.IMAGE_REPO }}

- name: Get image version
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=ref,event=branch
type=ref,event=pr

- name: Login to Registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Get UBI Subs
uses: actions/checkout@v4
with:
repository: ${{ secrets.RH_REPO }}
ssh-key: ${{ secrets.RH_ENT }}
persist-credentials: false
path: ubi

- name: Build ISO
uses: ./
id: build
with:
arch: ${{ needs.load_vars.outputs.ARCH }}
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
image_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}
image_repo: ${{ needs.load_vars.outputs.IMAGE_REPO }}
image_tag: ${{ needs.load_vars.outputs.IMAGE_TAG }}
iso_name: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
repos: '/etc/yum.repos.d/redhat.repo'
secrets_dir: ${{ format('{0}/ubi', github.workspace) }}
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
ubi: "true"
variant: ${{ needs.load_vars.outputs.VARIANT }}
version: ${{ matrix.version }}

- name: Upload ISO as artifact
id: upload
uses: actions/upload-artifact@v4
with:
name: ${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}
path: |
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso-CHECKSUM
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true

- name: Set status
if: inputs.pr && always()
uses: myrotvorets/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
context: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
sha: ${{ env.sha }}
targetUrl: ${{ steps.jobs.outputs.html_url }}

31 changes: 31 additions & 0 deletions .github/workflows/build_vars_rhel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build Vars

on:
workflow_call:
outputs:
ARCH:
value: 'x86_64'
BUILD_VERSIONS:
value: '[9.3]'
IMAGE_NAME:
value: 'fedora-bootc'
IMAGE_REPO:
value: 'quay.io/centos-bootc'
IMAGE_TAG:
value: 'eln'
VARIANT:
value: 'Server'
SECURE_BOOT_KEY_URL:
value: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der'
ENROLLMENT_PASSWORD:
value: 'container-installer'


jobs:
load-vars:
name: Load Variables
runs-on: ubuntu-latest
steps:
- name: Sucess
run:
echo "Vars loaded"
Loading
Loading