Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
ggiguash marked this conversation as resolved.

# The /dev/sdb1 partition is mounted as /mnt.
sudo mkdir -p /mnt/tmp /mnt/rpms /mnt/release
sudo chmod 1777 /mnt/tmp
Expand Down Expand Up @@ -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()
Expand Down
34 changes: 34 additions & 0 deletions .github/actions/debug-info/action.yaml
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions .github/actions/quick-start-clean/action.yaml
Original file line number Diff line number Diff line change
@@ -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
30 changes: 4 additions & 26 deletions .github/workflows/installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/quickstart.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
2 changes: 1 addition & 1 deletion .github/workflows/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
8 changes: 8 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
ggiguash marked this conversation as resolved.

# The release process consumes the RPMs and the container image
# prepared by the build action.
- name: Prepare the RPM archives
Expand Down
7 changes: 6 additions & 1 deletion src/quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ 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"

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}"
}
Expand Down