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
22 changes: 15 additions & 7 deletions .github/actions/quick-start-clean/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,28 @@ inputs:
description: Image reference to use for the MicroShift container
required: false
default: ""
type: string
run-clean:
description: Run the clean script
required: false
default: true
type: boolean
default: "true"

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
set -euo pipefail
set -x

IMAGE=""
TAG=""
image_ref="${{ inputs.image-ref }}"
if [ -n "${image_ref}" ]; then
IMAGE="${image_ref%%:*}"
TAG="${image_ref##*:}"
fi
sudo IMAGE="${IMAGE}" TAG="${TAG}" bash -xeuo pipefail < ./src/quickstart.sh

# Wait until the MicroShift service is ready and healthy
for _ in $(seq 100); do
Expand All @@ -33,10 +40,11 @@ runs:
exit 1

- name: Run the quick clean script
if: inputs.run-clean == true
if: ${{ inputs.run-clean == 'true' }}
shell: bash
run: |
set -xeuo pipefail
set -euo pipefail
set -x
sudo bash -xeuo pipefail < ./src/quickclean.sh

# Verify the container and its image are removed
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ on:
jobs:
quick-start-and-clean:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
strategy:
matrix:
runners: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.runners }}
steps:
- name: Check out MicroShift upstream repository
uses: actions/checkout@v4
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ outside the downstream Red Hat payloads.

# Operating System Support

MicroShift and its main components are available on the `x86_64` architecture.
RPM and DEB packages built in a container can be installed and run on the
following operating systems.
MicroShift and its main components are available for the `x86_64` and `aarch64`
architectures. RPM and DEB packages built in a container can be installed and
run on the following operating systems.

| OS |Package|Bootc|OVN-K|Kindnet|TopoLVM|Greenboot|Comments|
|-----------|-------|-----|-----|-------|-------|---------|--------|
Expand All @@ -29,10 +29,11 @@ following operating systems.
| Ubuntu | DEB | N | N | Y | Y | N | Latest LTS version (e.g. 24.04) |

Notes:
- MicroShift Bootc container images can be run on any operating system supported
by [Podman](https://podman.io/).
- The support for the `aarch64` architecture depends on
[OKD Build of OpenShift on Arm](https://issues.redhat.com/browse/OKD-215).
- MicroShift Bootc container images can be run on `x86_64` and `aarch64` systems
using any OS supported by [Podman](https://podman.io/).
- OKD builds for the `aarch64` architecture are performed using MicroShift-specific
build procedure until [OKD Build of OpenShift on Arm](https://issues.redhat.com/browse/OKD-215)
is implemented by the OKD team.

## Quick Start

Expand Down
120 changes: 81 additions & 39 deletions docs/workflows.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,98 @@
## GitHub Workflows

The following GitHub workflows are defined at the `.github/workflows` folder:
* `MicroShift RPM and Container Image Builder` in `build-rpms.yaml`
The GitHub Workflows are defined at the `.github/workflows` folder, including
pre-submit tests and software release procedures.

These workflows can be run under the [Actions](https://github.com/microshift-io/microshift/actions)
tab by the repository maintainers. Other contributors can
[create a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository)
from the [MicroShift Upstream](https://github.com/microshift-io/microshift) repository
and run existing or create new workflows in their private repository branches.
* Pre-submit tests are run automatically before a pull request can be merged
* Software release procedures can be run under the [Actions](https://github.com/microshift-io/microshift/actions)
tab by the repository maintainers, or scheduled for regular automatic execution

> Note: Contributors can create a fork from the [MicroShift Upstream](https://github.com/microshift-io/microshift)
> repository and run software release workflows in their private repository branches.

The remainder of this document describes the existing workflows and their functionality.

### Release MicroShift RPMs and Container Images
### Pre-submit Workflows

The workflows described in this section are run as a prerequisite for merging a
pull request into the main branch. If any of these procedures exit with errors,
the pull request cannot be merged before all the errors are fixed.

#### Builders

Build a MicroShift Bootc image from the `main` MicroShift source branch and the
latest published OKD version tag. Run this image to verify that all the MicroShift
services are functional.

The following operating systems are tested:
* Fedora, CentOS 9 and CentOS 10 for RPM packages and Bootc images
* Ubuntu for DEB packages

The following configurations are tested:
* The `x86_64` and `aarch64` architectures
* Isolated network for OVN-K and Kindnet CNI

#### Installers

Run the [Quick Start](../README.md#quick-start) procedure followed by the
[quick clean](./quickclean.sh) script invocation.

#### Linters

Run [ShellCheck](https://github.com/koalaman/shellcheck) on all shell scripts and
[hadolint](https://github.com/hadolint/hadolint) on all container files in the repository.

### Software Release Procedures

#### MicroShift

The workflow implements a build process producing MicroShift RPM packages and Bootc
container image artifacts. It is executed manually by the repository maintainers -
no scheduled runs are configured at this time.

The following parameters determine the MicroShift source code branch and the OKD
container image dependencies used during the build process.
* [MicroShift (OpenShift) branch](https://github.com/openshift/microshift/branches)
* [OKD version tag](https://quay.io/repository/okd/scos-release?tab=tags)

The workflow implements a build process producing MicroShift RPM and Bootc
container image artifacts.
The following actions are supported:
* `rpms`: Build MicroShift RPM packages
* `bootc-image`: Build a MicroShift Bootc container image
* `all`: Build all of the above

The following parameters determine the MicroShift source code branch and OKD
container dependencies used during the build process.
* MicroShift branch from https://github.com/openshift/microshift/branches
* OKD version tag from https://quay.io/repository/okd/scos-release?tab=tags
> Note: After the Bootc container image is built, a workflow step checks it by
> attempting to run the container image and verifying that all the MicroShift
> services are functional.

The following actions are suppported.
* `rpms`: Builds the MicroShift RPM packages
* `bootc-image`: Builds the Bootc container images
* `okd-release-arm`: Builds an OKD release for the ARM architecture
* `all`: Builds all of the above
If the build job finishes successfully, the artifact download and installation
instructions are available at [Releases](https://github.com/microshift-io/microshift/releases).

Note: When the Bootc container images are built, one of the workflow steps tests
the validity of the produced artifacts by attempting to run the container image
and making sure all the MicroShift services are functional.
> Note: The available container images can be listed at [Packages](https://github.com/microshift-io/microshift/packages)
> and pulled from the `ghcr.io/microshift-io` registry.

If the build job finishes successfully, the build artifacts are available for
download in the following locations:
* [Releases](https://github.com/microshift-io/microshift/releases) for RPMs
* [Packages](https://github.com/microshift-io/microshift/packages) for container images
#### OKD on ARM

The container images can be pulled directly from the `ghcr.io/microshift-io` registry.
The workflow implements a build process producing a subset of OKD container image
artifacts that are required by MicroShift on the `aarch64` architecture. It runs
every day at 03:00 UTC to make sure ARM artifacts are available for the latest
OKD releases.

### Presubmit Pull Request Verification
> Note: OKD `aarch64` builds are performed using MicroShift-specific build procedure
> until [OKD Build of OpenShift on Arm](https://issues.redhat.com/browse/OKD-215)
> is implemented by the OKD team.

The workflow is run as a prerequisite for merging a pull request into the main
branch.
The following parameters determine the MicroShift source code branch and the OKD
container image dependencies used during the build process.
* [MicroShift (OpenShift) branch](https://github.com/openshift/microshift/branches)
* [OKD version tag](https://quay.io/repository/okd/scos-release?tab=tags)

It implements the following verification procedures:
* Run `shellcheck` on all scripts in the repository
* Run `hadolint` on all container files in the repository
* Build and test MicroShift Bootc image on selected configurations
* Build and test MicroShift Debian Packages on Ubuntu
The default target registry for publishing OKD container image artifacts is
`ghcr.io/microshift-io/okd`.

Note: The Bootc image build is performed on the `main` MicroShift branch and the
latest published OKD version tag.
> Note: After the OKD container images are built, a workflow step checks them by
> creating a MicroShift Bootc image with the new artifacts, attempting to run it,
> and verifying that all the MicroShift services work.

If any of these procedures exit with errors, the pull request cannot be merged
before all the errors are fixed.
If the build job finishes successfully, the available container images can be listed
at [Packages](https://github.com/microshift-io/microshift/packages) and pulled from
the `ghcr.io/microshift-io` registry.
15 changes: 12 additions & 3 deletions src/quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -euo pipefail

OWNER=${OWNER:-microshift-io}
REPO=${REPO:-microshift}
IMAGE=${IMAGE:-"ghcr.io/${OWNER}/${REPO}"}
Comment thread
ggiguash marked this conversation as resolved.
TAG=${TAG:-latest}
IMAGE_REF=${IMAGE_REF:-"ghcr.io/${OWNER}/${REPO}:${TAG}"}

LVM_DISK="/var/lib/microshift-okd/lvmdisk.image"
VG_NAME="myvg1"
Expand Down Expand Up @@ -81,10 +81,19 @@ if [ "$(id -u)" -ne 0 ]; then
exit 1
fi

# Update the tag for the latest version
if [ "${TAG}" == "latest" ] ; then
TAG="$(curl -s "https://api.github.com/repos/${OWNER}/${REPO}/releases/latest" | jq -r .tag_name)"
Comment thread
pacevedom marked this conversation as resolved.
if [ -z "${TAG}" ] || [ "${TAG}" == "null" ] ; then
echo "ERROR: Could not determine the latest release tag from GitHub"
exit 1
fi
fi
Comment thread
ggiguash marked this conversation as resolved.

# Run the procedures
pull_bootc_image "${IMAGE_REF}"
pull_bootc_image "${IMAGE}:${TAG}"
prepare_lvm_disk "${LVM_DISK}" "${VG_NAME}"
run_bootc_image "${IMAGE_REF}"
run_bootc_image "${IMAGE}:${TAG}"

# Follow-up instructions
echo
Expand Down