-
Notifications
You must be signed in to change notification settings - Fork 60
feat: build Fedora images #4066
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
base: main
Are you sure you want to change the base?
Changes from all commits
de44167
dc0ec85
bab5119
0ff92de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,12 +10,10 @@ on: | |
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| guest-fedora-amd64: | ||
| guest-fedora: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 | ||
| FEDORA_VERSION: 41 | ||
| CPU_ARCH: amd64 | ||
| FULL_EMULATION: "true" | ||
| DEBIAN_FRONTEND: noninteractive | ||
| steps: | ||
|
|
@@ -26,15 +24,23 @@ jobs: | |
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| qemu-system-x86 \ | ||
| qemu-system-s390x \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should install only one, based on arch
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are publishing here. To achieve this, the proposed approach is to build everything on the same amd64 host before pushing and creating the manifests together. This avoids the need to sync across different jobs |
||
| libvirt-daemon-system \ | ||
| virtinst cloud-image-utils \ | ||
| libguestfs-tools | ||
| - name: Tweak hosted runner to enable 'virt-sysprep' | ||
| # https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725 | ||
| run: sudo chmod 0644 /boot/vmlinuz* | ||
| - name: Fetch base Fedora image | ||
| - name: Fetch base Fedora amd64 image | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about using tools like https://github.com/qoomon/actions--parallel-steps to have steps run in parallel, or use gh matrix yo avoid code duplication
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reducing code duplication: +1 |
||
| working-directory: ./containers/fedora | ||
| run: wget -q "https://download.fedoraproject.org/pub/fedora/linux/releases/41/Cloud/x86_64/images/${{ env.FEDORA_IMAGE }}" | ||
| env: | ||
| FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we have these as vars at the top for easier updating (and they are repeated in the code)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch, we can create a env variable for the actual Fedora base name. In this case "Fedora-Cloud-Base-Base-Generic-41-1.4" |
||
| - name: Fetch base Fedora s390x image | ||
| working-directory: ./containers/fedora | ||
| run: wget -q "https://download.fedoraproject.org/pub/fedora-secondary/releases/41/Cloud/s390x/images/${{ env.FEDORA_IMAGE }}" | ||
| env: | ||
| FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.s390x.qcow2 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
|
|
@@ -45,17 +51,31 @@ jobs: | |
| PYTHONPATH: ${{ github.workspace }} | ||
| ORGANIZATION_ID: ${{ secrets.BITWARDEN_ORGANIZATION_ID }} | ||
| ACCESS_TOKEN: ${{ secrets.BITWARDEN_ACCESS_TOKEN }} | ||
| FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.x86_64.qcow2 | ||
| CPU_ARCH: amd64 | ||
| run: ./build.sh | ||
| - name: Create s390x VM | ||
| working-directory: ./containers/fedora | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }} | ||
| ORGANIZATION_ID: ${{ secrets.BITWARDEN_ORGANIZATION_ID }} | ||
| ACCESS_TOKEN: ${{ secrets.BITWARDEN_ACCESS_TOKEN }} | ||
| FEDORA_IMAGE: Fedora-Cloud-Base-Generic-41-1.4.s390x.qcow2 | ||
| CPU_ARCH: s390x | ||
| run: ./build.sh | ||
| - name: Logging to quay.io | ||
| run: podman login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io | ||
| - name: Tag & Push image to staging | ||
| env: | ||
| local_repository: "localhost/fedora" | ||
| remote_repository: "quay.io/openshift-cnv/qe-cnv-tests-fedora-staging" | ||
| arch_tag: "${{ env.FEDORA_VERSION }}-${{ env.CPU_ARCH }}" | ||
| arch_tag_amd64: "${{ env.FEDORA_VERSION }}-amd64" | ||
| arch_tag_s390x: "${{ env.FEDORA_VERSION }}-s390x" | ||
| remote_tag: "${{ env.FEDORA_VERSION }}-dev" | ||
| run: | | ||
| podman tag "${local_repository}":"${arch_tag}" "${remote_repository}":"${arch_tag}" | ||
| podman push "${remote_repository}":"${arch_tag}" | ||
| podman manifest create --log-level=debug "${remote_repository}":"${remote_tag}" "${remote_repository}":"${arch_tag}" | ||
| podman tag "${local_repository}":"${arch_tag_amd64}" "${remote_repository}":"${arch_tag_amd64}" | ||
| podman tag "${local_repository}":"${arch_tag_s390x}" "${remote_repository}":"${arch_tag_s390x}" | ||
| podman push "${remote_repository}":"${arch_tag_amd64}" | ||
| podman push "${remote_repository}":"${arch_tag_s390x}" | ||
| podman manifest create --log-level=debug "${remote_repository}":"${remote_tag}" "${remote_repository}":"${arch_tag_amd64}" "${remote_repository}":"${arch_tag_s390x}" | ||
| podman manifest push "${remote_repository}":"${remote_tag}" --all --format=v2s2 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flow here should be to promote the built images in component-builder to production -i.e not re-build again.
we need also arm support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Regarding arm support, I do not have access to test on arm machines. What about adding ARM support once this changes get merged?