From 94f5ff1ef74a17f57a0acfb308f16a8f80a38bd2 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 17 Oct 2025 09:01:37 +0300 Subject: [PATCH 1/5] Fix release.md instructions --- .github/workflows/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.md b/.github/workflows/release.md index 52baa375..837e4788 100644 --- a/.github/workflows/release.md +++ b/.github/workflows/release.md @@ -14,7 +14,7 @@ sudo podman pull ghcr.io/microshift-io/microshift:$TAG Or use the image with the `quickstart.sh`: ```bash -curl -s https://raw.githubusercontent.com/microshift-io/microshift/main/src/quickstart.sh | sudo TAG=$TAG bash +curl -s https://microshift-io.github.io/microshift/quickstart.sh | sudo TAG=$TAG bash ``` Review the instructions in [MicroShift Bootc Image](https://github.com/microshift-io/microshift/blob/main/docs/run.md#microshift-bootc-image) to run the image. From 0ae370fba5feb8b6626d6bdbeec6a8da939e3888 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 17 Oct 2025 09:13:20 +0300 Subject: [PATCH 2/5] Fix quick clean command in installers.yaml --- .github/workflows/installers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml index 6919bfa9..1a33952d 100644 --- a/.github/workflows/installers.yaml +++ b/.github/workflows/installers.yaml @@ -25,7 +25,7 @@ jobs: shell: bash run: | set -xeuo pipefail - sudo bash -xeuo pipefail < ./src/quickstart.sh + sudo bash -xeuo pipefail < ./src/quickclean.sh # Verify the container and its image are removed sudo podman ps -a | grep microshift-okd && exit 1 From 3bc9b05e32e56924786f7cf3339f29ae6043917a Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 17 Oct 2025 10:14:44 +0300 Subject: [PATCH 3/5] Move quick start and clean process into a separate action --- .github/actions/quick-start-clean/action.yaml | 39 +++++++++++++++++++ .github/workflows/installers.yaml | 30 ++------------ 2 files changed, 43 insertions(+), 26 deletions(-) create mode 100644 .github/actions/quick-start-clean/action.yaml diff --git a/.github/actions/quick-start-clean/action.yaml b/.github/actions/quick-start-clean/action.yaml new file mode 100644 index 00000000..49e25237 --- /dev/null +++ b/.github/actions/quick-start-clean/action.yaml @@ -0,0 +1,39 @@ +name: quick-start-clean +description: Reusable action to run the quick start and clean scripts + +inputs: + image-ref: + description: Image reference to use for the MicroShift container + required: false + default: "" + type: string + +runs: + using: "composite" + steps: + - name: Run the quick start script + shell: bash + run: | + set -xeuo pipefail + sudo IMAGE_REF=${{ inputs.image-ref }} bash -xeuo pipefail < ./src/quickstart.sh + + # Wait until the MicroShift service is ready and healthy + make run-ready + make run-healthy + + - name: Run the quick clean script + shell: bash + run: | + set -xeuo pipefail + sudo bash -xeuo pipefail < ./src/quickclean.sh + + # Verify the container and its image are removed + sudo podman ps -a | grep microshift-okd && exit 1 + sudo podman images | grep microshift-okd && exit 1 + + # Verify the LVM volume group and backing storage are removed + sudo vgs | grep myvg1 && exit 1 + if [ -e /var/lib/microshift-okd ]; then + ls -la /var/lib/microshift-okd/ + exit 1 + fi diff --git a/.github/workflows/installers.yaml b/.github/workflows/installers.yaml index 1a33952d..a5a6737e 100644 --- a/.github/workflows/installers.yaml +++ b/.github/workflows/installers.yaml @@ -11,29 +11,7 @@ jobs: - name: Check out MicroShift upstream repository uses: actions/checkout@v4 - - name: Run the quick start script - shell: bash - run: | - set -xeuo pipefail - sudo bash -xeuo pipefail < ./src/quickstart.sh - - # Wait until the MicroShift service is ready and healthy - make run-ready - make run-healthy - - - name: Run the quick clean script - shell: bash - run: | - set -xeuo pipefail - sudo bash -xeuo pipefail < ./src/quickclean.sh - - # Verify the container and its image are removed - sudo podman ps -a | grep microshift-okd && exit 1 - sudo podman images | grep microshift-okd && exit 1 - - # Verify the LVM volume group and backing storage are removed - sudo vgs | grep myvg1 && exit 1 - if [ -e /var/lib/microshift-okd ]; then - ls -la /var/lib/microshift-okd/ - exit 1 - fi + # Test the quick start and clean procedures with the latest published build + # of the MicroShift container image. + - name: Run the quick start script and clean scripts + uses: ./.github/actions/quick-start-clean From 1a29d7fa50ebd904218e4c0b145610f83d20d8e2 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 17 Oct 2025 10:22:21 +0300 Subject: [PATCH 4/5] Add local container image quick test before publishing it --- .github/workflows/release.yaml | 8 ++++++++ src/quickstart.sh | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 820da724..10cae9d7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,6 +41,14 @@ jobs: okd-version-tag: ${{ inputs.okd-version-tag }} build: ${{ inputs.build }} + # Test the local container image with the quick start and clean procedures + # before releasing the artifacts. + - name: Run the quick start script and clean scripts + if: contains(fromJSON('["all", "bootc-image"]'), inputs.build) + uses: ./.github/actions/quick-start-clean + with: + image-ref: localhost/microshift-okd:latest + # The release process consumes the RPMs and the container image # prepared by the build action. - name: Prepare the RPM archives diff --git a/src/quickstart.sh b/src/quickstart.sh index f566bcaf..14cdfa84 100755 --- a/src/quickstart.sh +++ b/src/quickstart.sh @@ -4,7 +4,7 @@ set -euo pipefail OWNER=${OWNER:-microshift-io} REPO=${REPO:-microshift} TAG=${TAG:-latest} -IMAGE_REF="ghcr.io/${OWNER}/${REPO}:${TAG}" +IMAGE_REF=${IMAGE_REF:-"ghcr.io/${OWNER}/${REPO}:${TAG}"} LVM_DISK="/var/lib/microshift-okd/lvmdisk.image" VG_NAME="myvg1" @@ -12,6 +12,11 @@ VG_NAME="myvg1" function pull_bootc_image() { local -r image_ref="$1" + # Skip pulling the local container images + if [[ "${image_ref}" == localhost/* ]]; then + echo "Skipping pull of local container image: ${image_ref}" + return 0 + fi echo "Pulling '${image_ref}'" podman pull "${image_ref}" } From 419268a340d32d068f5ea9ab156650da6c388478 Mon Sep 17 00:00:00 2001 From: Gregory Giguashvili Date: Fri, 17 Oct 2025 12:07:23 +0300 Subject: [PATCH 5/5] Implement debug-info action calling it before and after the build --- .github/actions/build/action.yaml | 33 ++++++++++++++++--------- .github/actions/debug-info/action.yaml | 34 ++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 .github/actions/debug-info/action.yaml diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml index f59fc316..a989f078 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/action.yaml @@ -46,9 +46,16 @@ runs: id: detect-cpu-arch uses: ./.github/actions/arch + - name: Collect debug information before the build + if: always() + uses: ./.github/actions/debug-info + - name: Prepare the build and run environment shell: bash run: | + set -euo pipefail + set -x + # The /dev/sdb1 partition is mounted as /mnt. sudo mkdir -p /mnt/tmp /mnt/rpms /mnt/release sudo chmod 1777 /mnt/tmp @@ -130,25 +137,29 @@ runs: # Stop the MicroShift container make stop - - name: Collect logs on failure + - name: Collect debug information after the build + if: always() + uses: ./.github/actions/debug-info + + - name: Collect MicroShift container sosreport on failure if: failure() shell: bash run: | set -euo pipefail set -x - sudo podman ps -a - sudo podman images - sudo podman logs microshift-okd || true + # Check if the MicroShift container is running + if ! sudo podman ps --format "{{.Names}}" | grep -q '^microshift-okd$' ; then + echo "Warning: MicroShift container is not running - cannot collect sos report" + exit 0 + fi # Collect sos report from the MicroShift container - if sudo podman ps --filter name=microshift-okd | grep -q . ; then - sudo podman exec -i microshift-okd microshift-sos-report - for f in $(sudo podman exec -i microshift-okd bash -c 'ls -1 /tmp/sosreport-*'); do - sudo podman cp microshift-okd:${f} /mnt/tmp/ - sudo chmod 644 "/mnt/tmp/$(basename "${f}")" - done - fi + sudo podman exec -i microshift-okd microshift-sos-report + for f in $(sudo podman exec -i microshift-okd bash -c 'ls -1 /tmp/sosreport-*'); do + sudo podman cp microshift-okd:${f} /mnt/tmp/ + sudo chmod 644 "/mnt/tmp/$(basename "${f}")" + done - name: Upload sos report to the GitHub Actions artifact if: failure() diff --git a/.github/actions/debug-info/action.yaml b/.github/actions/debug-info/action.yaml new file mode 100644 index 00000000..16fc4b7d --- /dev/null +++ b/.github/actions/debug-info/action.yaml @@ -0,0 +1,34 @@ +name: debug-info +description: Reusable action to collect debug information + +runs: + using: "composite" + steps: + - name: Collect debug information + shell: bash + run: | + set -euo pipefail + set -x + + # Collect partition, volume and disk usage information + sudo fdisk -l + sudo lsblk -a + sudo df -h + sudo vgs || true + sudo lvs || true + sudo pvs || true + + # Collect container and image information from the host + sudo podman system df + sudo podman ps -a + sudo podman images + + # Collect logs from all running containers + for container in $(sudo podman ps -a --format "{{.Names}}") ; do + sudo podman logs "${container}" || true + done + + # List the contents of the /mnt directory to debug any issues + # with the disk space + sudo ls -lah /mnt + sudo du -h -d1 /mnt