-
Notifications
You must be signed in to change notification settings - Fork 67
Add ubi-base based on ubi10 #237
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3e93db
feat: add ubi10-base build
akurinnoy 92af3db
chore: add workflows to build ubi10-base images
akurinnoy 713d5ae
chore: add ability to use another registry (in forks) via env variable
akurinnoy 90724d1
chore: add notes about ubi10-base images, REGISTRY variable
akurinnoy 022fc16
fixup! feat: add ubi10-base build
akurinnoy 86af502
fixup! fixup! feat: add ubi10-base build
akurinnoy a20655c
fixup! chore: add notes about ubi10-base images, REGISTRY variable
akurinnoy fab1905
fixup! fixup! fixup! feat: add ubi10-base build
akurinnoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
# | ||
# Copyright (c) 2021-2025 Red Hat, Inc. | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
|
||
name: Pull Request Check UBI 10 | ||
|
||
# Trigger the workflow on pull request | ||
on: [pull_request] | ||
|
||
env: | ||
# Use repository variable if set, otherwise fallback to default registry | ||
REGISTRY: ${{ vars.REGISTRY || 'quay.io/devfile' }} | ||
|
||
jobs: | ||
build-base-image: | ||
name: Build base image | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] | ||
runs-on: ${{matrix.runners}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set arch environment variable | ||
run: | | ||
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then | ||
echo arch="amd64" >> $GITHUB_ENV | ||
else | ||
echo arch="arm64" >> $GITHUB_ENV | ||
fi | ||
- name: Free runner space | ||
run: sudo rm -rf /usr/local/lib/android | ||
- name: Cleanup docker images | ||
run: docker system prune -af | ||
- name: Build base image | ||
run: | | ||
cd base/ubi10 && docker buildx build \ | ||
--platform linux/${{env.arch}} \ | ||
--progress=plain \ | ||
-t base-developer-image-${{env.arch}} . | ||
- name: Display docker images | ||
run: docker images | ||
- name: Login to Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
# TODO: Remove this step once UDI on UBI 10 is ready and we have proper PR workflow for UDI | ||
# This temporary step pushes base image to registry for testing purposes | ||
- name: Tag and push base image for testing | ||
run: | | ||
docker tag base-developer-image-${{env.arch}} ${{ env.REGISTRY }}/base-developer-image:${{env.arch}}-ubi10-pr-${{github.event.number}} | ||
docker push ${{ env.REGISTRY }}/base-developer-image:${{env.arch}}-ubi10-pr-${{github.event.number}} | ||
- name: Compress image to a file | ||
run: docker save base-developer-image-${{env.arch}} | gzip > base-developer-image-${{env.arch}}.tgz | ||
- name: Upload image artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: base-developer-image-${{env.arch}} | ||
path: base-developer-image-${{env.arch}}.tgz | ||
|
||
publish-base-image: | ||
name: Publish base image | ||
runs-on: ubuntu-22.04 | ||
needs: build-base-image | ||
steps: | ||
- name: Login to Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
# TODO: Remove this job once UDI on UBI 10 is ready and we have proper PR workflow for UDI | ||
# This temporary job publishes base image manifest for testing purposes | ||
- name: publish base image manifest | ||
run: | | ||
docker manifest create ${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}} \ | ||
--amend ${{ env.REGISTRY }}/base-developer-image:amd64-ubi10-pr-${{github.event.number}} \ | ||
--amend ${{ env.REGISTRY }}/base-developer-image:arm64-ubi10-pr-${{github.event.number}} | ||
|
||
docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}} \ | ||
${{ env.REGISTRY }}/base-developer-image:amd64-ubi10-pr-${{github.event.number}} \ | ||
--os linux --arch amd64 | ||
docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}} \ | ||
${{ env.REGISTRY }}/base-developer-image:arm64-ubi10-pr-${{github.event.number}} \ | ||
--os linux --arch arm64 | ||
|
||
docker manifest push ${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}} | ||
- name: 'Comment PR' | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { repo: { owner, repo } } = context; | ||
await github.rest.issues.createComment({ | ||
issue_number: ${{github.event.number}}, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `Pull Request UBI 10 images published ✨\n\nBase Image: [${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}}](https://${{ env.REGISTRY }}/base-developer-image:ubi10-pr-${{github.event.number}})` | ||
}) | ||
|
||
# build-udi: | ||
# name: Build udi | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] | ||
# runs-on: ${{matrix.runners}} | ||
# needs: build-base-image | ||
# steps: | ||
# - name: Set arch environment variable | ||
# run: | | ||
# if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then | ||
# echo arch="amd64" >> $GITHUB_ENV | ||
# else | ||
# echo arch="arm64" >> $GITHUB_ENV | ||
# fi | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# - name: Free runner space | ||
# run: sudo rm -rf /usr/local/lib/android | ||
# - name: Cleanup docker images | ||
# run: docker system prune -af | ||
# - name: Download BDI artifacts | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# pattern: base-developer-image-* | ||
# merge-multiple: true | ||
# path: . | ||
# - name: List downloaded files | ||
# run: ls -lah | ||
# - name: Load docker images | ||
# run: docker load -i base-developer-image-${{env.arch}}.tgz | ||
# - name: Display docker images | ||
# run: docker images | ||
# - name: Update UDI Dockerfile | ||
# run: sed "s|${{ env.REGISTRY }}/base-developer-image:ubi10-latest|base-developer-image-${{env.arch}}|" -i "universal/ubi10/Dockerfile" | ||
# - name: Login to Registry | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ secrets.QUAY_USERNAME }} | ||
# password: ${{ secrets.QUAY_PASSWORD }} | ||
# - name: Build udi | ||
# run: | | ||
# cd universal/ubi10 && docker buildx build \ | ||
# --platform linux/${{env.arch}} \ | ||
# --progress=plain \ | ||
# --push \ | ||
# -t ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-ubi10-pr-${{github.event.number}} . | ||
|
||
# publish-udi: | ||
# name: Publish udi | ||
# runs-on: ubuntu-22.04 | ||
# needs: build-udi | ||
# steps: | ||
# - name: Login to Registry | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ secrets.QUAY_USERNAME }} | ||
# password: ${{ secrets.QUAY_PASSWORD }} | ||
# - name: publish | ||
# run: | | ||
# docker manifest create ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}} \ | ||
# --amend ${{ env.REGISTRY }}/universal-developer-image:amd64-ubi10-pr-${{github.event.number}} \ | ||
# --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-ubi10-pr-${{github.event.number}} | ||
# | ||
# docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}} \ | ||
# ${{ env.REGISTRY }}/universal-developer-image:amd64-ubi10-pr-${{github.event.number}} \ | ||
# --os linux --arch amd64 | ||
# docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}} \ | ||
# ${{ env.REGISTRY }}/universal-developer-image:arm64-ubi10-pr-${{github.event.number}} \ | ||
# --os linux --arch arm64 | ||
# | ||
# docker manifest push ${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}} | ||
# - name: 'Comment PR' | ||
# uses: actions/github-script@v7 | ||
# with: | ||
# script: | | ||
# const { repo: { owner, repo } } = context; | ||
# await github.rest.issues.createComment({ | ||
# issue_number: ${{github.event.number}}, | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# body: `Pull Request images published ✨\n\nUDI: [${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}}](https://${{ env.REGISTRY }}/universal-developer-image:ubi10-pr-${{github.event.number}})` | ||
# }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.