Skip to content

Commit 7a2b3a0

Browse files
authored
Merge pull request #1 from redhat-et/tegra
Add initial workflow for building tegra base image
2 parents 6ba9130 + bfbad11 commit 7a2b3a0

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Reference: https://github.com/redhat-cop/redhat-image-mode-actions
2+
name: Build RHEL bootc image
3+
on:
4+
workflow_call:
5+
inputs:
6+
containerfile:
7+
type: string
8+
required: true
9+
dest-image:
10+
type: string
11+
required: true
12+
tag-list:
13+
type: string
14+
required: true
15+
runs-on:
16+
type: string
17+
default: ubuntu-24.04-arm
18+
19+
jobs:
20+
rhel-bootc-image-build:
21+
name: Build RHEL bootc image
22+
runs-on: ${{ inputs.runs-on }}
23+
env:
24+
# Disable Subscription Manager container passthrough
25+
SMDEV_CONTAINER_OFF: 1
26+
27+
# Source registry for base image
28+
SOURCE_REGISTRY_HOST: "registry.redhat.io"
29+
30+
# Destination registry for built images
31+
DEST_REGISTRY_HOST: "quay.io"
32+
33+
# Destination image namespace and name (eg: myrepo/myimage)
34+
DEST_IMAGE: ${{ inputs.dest-image }}
35+
36+
# List of tags to publish
37+
TAGLIST: ${{ inputs.tag-list }}
38+
39+
# Containerfile to build
40+
CONTAINERFILE: ${{ inputs.containerfile }}
41+
42+
container:
43+
image: registry.access.redhat.com/ubi9/ubi
44+
options: --privileged
45+
permissions:
46+
contents: write
47+
packages: write
48+
49+
steps:
50+
- name: Clone the repository
51+
uses: actions/checkout@v4
52+
53+
- name: Get container tools in UBI builder
54+
run: dnf -y install podman buildah skopeo
55+
56+
- name: Access a subscription via activation key
57+
run: subscription-manager register --org=${{ secrets.RHT_ORGID }} --activationkey=${{ secrets.RHT_ACT_KEY }}
58+
59+
# workaround for https://github.com/redhat-actions/podman-login/issues/42 since the docker config from the host doesn't come up to the container
60+
- name: Workaround open podman-login action issue
61+
env:
62+
auth: "{ \"auths\": {} }"
63+
run: |
64+
mkdir -p $HOME/.docker
65+
echo $auth > $HOME/.docker/config.json
66+
67+
- name: Log in to the RHT terms based registry
68+
uses: redhat-actions/podman-login@v1
69+
with:
70+
registry: ${{ env.SOURCE_REGISTRY_HOST }}
71+
username: ${{ secrets.SOURCE_REGISTRY_USER }}
72+
password: ${{ secrets.SOURCE_REGISTRY_PASSWORD }}
73+
auth_file_path: /run/containers/0/auth.json
74+
75+
- name: Use buildah bud to create the image
76+
id: build-image
77+
uses: redhat-actions/buildah-build@v2
78+
with:
79+
image: ${{ env.DEST_IMAGE }}
80+
tags: ${{ env.TAGLIST }}
81+
containerfiles: ${{ env.CONTAINERFILE }}
82+
83+
- name: Log in to the Container registry
84+
uses: redhat-actions/podman-login@v1
85+
with:
86+
registry: ${{ env.DEST_REGISTRY_HOST }}
87+
username: ${{ secrets.DEST_REGISTRY_USER }}
88+
password: ${{ secrets.DEST_REGISTRY_PASSWORD }}
89+
auth_file_path: /run/containers/0/auth.json
90+
91+
- name: Push to Container Repository
92+
id: push-to-ghcr
93+
uses: redhat-actions/push-to-registry@v2
94+
with:
95+
image: ${{ steps.build-image.outputs.image }}
96+
tags: ${{ steps.build-image.outputs.tags }}
97+
registry: ${{ env.DEST_REGISTRY_HOST }}
98+
99+
- name: Clean up the subscription
100+
if: always()
101+
run: subscription-manager unregister

.github/workflows/tegra.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Build RHEL bootc image for Nvidia Tegra
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
paths:
7+
- "tegra/**"
8+
jobs:
9+
build-tegra-base:
10+
uses: ./.github/workflows/build-rhel-bootc-image.yml
11+
secrets: inherit
12+
with:
13+
containerfile: tegra/Containerfile.base
14+
dest-image: "redhat-et/rhel-bootc-tegra"
15+
tag-list: "base"

tegra/Containerfile.base

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM registry.redhat.io/rhel9/rhel-bootc:9.4-1730828483
2+
3+
RUN curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | \
4+
sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo && \
5+
curl -s -L https://repo.download.nvidia.com/jetson/rhel-9.4/jp6.1/nvidia-l4t.repo | \
6+
sudo tee /etc/yum.repos.d/nvidia-l4t.repo && \
7+
sudo dnf -y install \
8+
nvidia-jetpack-kmod \
9+
nvidia-jetpack-all \
10+
nvidia-container-toolkit && \
11+
sudo dnf clean all

0 commit comments

Comments
 (0)