Trigger Microshift upstream build #4
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
name: Trigger Microshift upstream build | |
on: | |
workflow_dispatch: | |
inputs: | |
okd-version: | |
default: "4.18.0-okd-scos.4" | |
description: okd release from https://quay.io/repository/okd/scos-release?tab=tags | |
type: string | |
action: | |
type: choice | |
description: what to do? | |
default: run-in-bootc-container | |
options: | |
- build-upstream-rpms | |
- run-in-bootc-container | |
jobs: | |
build: | |
strategy: | |
matrix: | |
#disabled arm runner because images for arm no available in okd payload- see USHIFT-5570 | |
runners: [ubuntu-24.04] | |
name: build microshift upstream | |
runs-on: ${{ matrix.runners }} | |
steps: | |
- name: Check out microshift-upstream CI repository | |
uses: actions/checkout@v4 | |
- name: Check out microshift repository | |
uses: actions/checkout@v4 | |
with: | |
repository: openshift/microshift | |
path: microshift | |
ref: main | |
- name: Add cwd to path for kubectl. | |
run: echo `pwd` >> $GITHUB_PATH | |
- name: Build Microshift RPMs and Container | |
shell: bash | |
run: | | |
# /dev/sdb1 is mounted as /mnt - disk space needed for the podman build containers layers. | |
sudo mkdir -p /mnt/tmp/output | |
cd ${GITHUB_WORKSPACE}/ | |
sudo apt-get install podman -y | |
export OKD_REPO=quay.io/okd/scos-release | |
# podman version applies bad ulimits default causing "too many open files" errors so we override ulimits. | |
TMPDIR=/mnt/tmp sudo podman build --layers=false --ulimit nofile=65536:65536 \ | |
--build-arg OKD_VERSION_TAG=${{ inputs.okd-version }} \ | |
--build-arg OKD_REPO=${OKD_REPO} \ | |
--env WITH_TOPOLVM=1 \ | |
--env WITH_FLANNEL=1 \ | |
--env OUTPUT_DIR=/output \ | |
-f microshift-okd-multi-build.Containerfile \ | |
-t microshift-okd \ | |
-v /mnt/tmp/output:/output:z . | |
- name: run test verifying that Microshift is running | |
if: inputs.action == 'run-in-bootc-container' | |
shell: bash | |
run: | | |
sudo apt-get -y install lvm2 | |
sudo truncate --size=20G /tmp/lvmdisk | |
sudo losetup -f /tmp/lvmdisk | |
device_name=$(losetup -j /tmp/lvmdisk | cut -d: -f1) | |
sudo vgcreate -f -y myvg1 ${device_name} | |
sudo lvcreate -T myvg1/thinpool -L 6G | |
sudo podman run --privileged --rm --name microshift-okd --volume /dev:/dev:rslave --hostname 127.0.0.1.nip.io -d microshift-okd | |
sleep 3 | |
# wait until everything is running | |
sudo podman exec -ti microshift-okd bash -c 'microshift healthcheck --namespace topolvm-system --deployments topolvm-controller' | |
- name: prepare release acrhive | |
shell: bash | |
run : | | |
cd /mnt/tmp/output/rpmbuild/RPMS/ | |
sudo zip microshift-release.zip \ | |
x86_64/microshift-[0-9]*.rpm \ | |
x86_64/microshift-topolvm-*.rpm \ | |
x86_64/microshift-networking-*.rpm \ | |
x86_64/microshift-flannel-*.rpm \ | |
noarch/microshift-release-info-*.rpm \ | |
noarch/microshift-greenboot-*.rpm \ | |
noarch/microshift-selinux-*.rpm \ | |
noarch/microshift-topolvm-*.rpm \ | |
noarch/microshift-flannel-*.rpm | |
- name: Release if the previous test passed | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: 4.19.0 | |
files: | | |
/mnt/tmp/output/rpmbuild/RPMS/microshift-x86_64.zip |