diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index 8665124791..f9b2bea77c 100755 --- a/test/bin/ci_phase_iso_build.sh +++ b/test/bin/ci_phase_iso_build.sh @@ -65,9 +65,8 @@ update_build_cache() { # Build the composer-cli base layer to be cached $(dry_run) bash -x ./bin/build_images.sh -l ./image-blueprints/layer1-base - # Build the bootc base groups to be cached - $(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints/layer5-bootc/group0 - $(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints/layer5-bootc/group1 + # Build the bootc base layer to be cached + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base # Upload the images and update the 'last' setting ./bin/manage_build_cache.sh upload -b "${SCENARIO_BUILD_BRANCH}" -t "${SCENARIO_BUILD_TAG}" @@ -102,7 +101,8 @@ run_image_build() { # Run bootc image build run_bootc_image_build() { - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints/layer5-bootc + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer2-source } cat /etc/os-release diff --git a/test/image-blueprints-bootc/README.md b/test/image-blueprints-bootc/README.md new file mode 100644 index 0000000000..30869e2c8d --- /dev/null +++ b/test/image-blueprints-bootc/README.md @@ -0,0 +1,35 @@ +The following guiding principles should be used when adding more artifacts to +each layer or group under `test/image-blueprints-bootc` directory. + +> Important: Keep balanced build times within each group and maximize caching +> of artifacts independent of the current source code. + +## Bootc Base Layer + +Artifacts built in this layer are cached. + +|Group |Build Time|Description| +|------|----------|-----------| +|group1| Short | Basic prerequisites +|group2| Long | Artifacts independent of current sources + +The `.container-encapsulate` files depend on the `rpm-ostree` commits built in +the `image-blueprints/layer1-base` layer. These commits must be downloaded from +cache or pre-built locally for `bootc` base layer builds to be successful. + +> Note: Total build times are up to 15 minutes. + +## Bootc Source Layer + +Artifacts built in this layer cannot be cached as they depend on the current sources. + +|Group |Build Time|Description| +|------|----------|-----------| +|group1| Average | Current source prerequisites (RHEL and CentOS) +|group2| Average | Current source artifacts on RHEL +|group3| Average | Current source artifacts on CentOS (with 1 exception) + +The `rhel94-bootc-source-isolated.image-bootc` file is an exception in `group3` +as it uses RHEL. This helps avoid creation of another group with a single file. + +> Note: Total build times are up to 15 minutes. diff --git a/test/image-blueprints/layer5-bootc/group0/rhel94-bootc-base.containerfile b/test/image-blueprints-bootc/layer1-base/group1/rhel94-bootc-base.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group0/rhel94-bootc-base.containerfile rename to test/image-blueprints-bootc/layer1-base/group1/rhel94-bootc-base.containerfile diff --git a/test/image-blueprints/layer5-bootc/group0/rhel94-test-agent.containerfile b/test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group0/rhel94-test-agent.containerfile rename to test/image-blueprints-bootc/layer1-base/group1/rhel94-test-agent.containerfile diff --git a/test/image-blueprints/layer5-bootc/group1/centos9-bootc.image-bootc b/test/image-blueprints-bootc/layer1-base/group2/centos9-bootc.image-bootc similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/centos9-bootc.image-bootc rename to test/image-blueprints-bootc/layer1-base/group2/centos9-bootc.image-bootc diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-crel-optionals.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-crel-optionals.containerfile new file mode 100644 index 0000000000..2264c53894 --- /dev/null +++ b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-crel-optionals.containerfile @@ -0,0 +1,31 @@ +FROM localhost/rhel94-test-agent:latest + +# Copy repository configuration +COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \ + /etc/yum.repos.d/ + +# Print repository configuration contents. +# Install MicroShift with optional components and cleanup. +RUN dnf repoinfo --enabled && \ + dnf install -y firewalld \ + "microshift-{{ .Env.CURRENT_RELEASE_VERSION }}" "microshift-release-info-{{ .Env.CURRENT_RELEASE_VERSION }}" \ + "microshift-olm-{{ .Env.CURRENT_RELEASE_VERSION }}" "microshift-multus-{{ .Env.CURRENT_RELEASE_VERSION }}" && \ + systemctl enable microshift && \ + rm -vf /etc/yum.repos.d/microshift-*.repo && \ + dnf clean all + +# Extend Greenboot wait timeout to 10m for MicroShift to be ready. +# Greenboot configuration must come after RPM install to avoid +# /etc/greenboot/greenboot.conf overwrite by the package update. +RUN printf "\nMICROSHIFT_WAIT_TIMEOUT_SEC=600\n" >> /etc/greenboot/greenboot.conf + +# Configure firewall +RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \ + firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \ + firewall-offline-cmd --zone=trusted --add-source=169.254.169.1 && \ + firewall-offline-cmd --zone=public --add-port=80/tcp && \ + firewall-offline-cmd --zone=public --add-port=443/tcp && \ + firewall-offline-cmd --zone=public --add-port=5353/udp && \ + firewall-offline-cmd --zone=public --add-port=6443/tcp && \ + firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \ + firewall-offline-cmd --zone=public --add-port=30000-32767/udp diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-bootc-crel.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-crel.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-bootc-crel.containerfile rename to test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-crel.containerfile diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-bootc-prel.containerfile b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-prel.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-bootc-prel.containerfile rename to test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc-prel.containerfile diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-bootc.image-bootc b/test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc.image-bootc similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-bootc.image-bootc rename to test/image-blueprints-bootc/layer1-base/group2/rhel94-bootc.image-bootc diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-ostree-microshift-previous-minor.container-encapsulate b/test/image-blueprints-bootc/layer1-base/group2/rhel94-ostree-microshift-previous-minor.container-encapsulate similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-ostree-microshift-previous-minor.container-encapsulate rename to test/image-blueprints-bootc/layer1-base/group2/rhel94-ostree-microshift-previous-minor.container-encapsulate diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-ostree-microshift-yminus2.container-encapsulate b/test/image-blueprints-bootc/layer1-base/group2/rhel94-ostree-microshift-yminus2.container-encapsulate similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-ostree-microshift-yminus2.container-encapsulate rename to test/image-blueprints-bootc/layer1-base/group2/rhel94-ostree-microshift-yminus2.container-encapsulate diff --git a/test/image-blueprints/layer5-bootc/group1/cos9-bootc-source.containerfile b/test/image-blueprints-bootc/layer2-source/group1/cos9-bootc-source.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/cos9-bootc-source.containerfile rename to test/image-blueprints-bootc/layer2-source/group1/cos9-bootc-source.containerfile diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-bootc-source-base.containerfile b/test/image-blueprints-bootc/layer2-source/group1/rhel94-bootc-source-base.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-bootc-source-base.containerfile rename to test/image-blueprints-bootc/layer2-source/group1/rhel94-bootc-source-base.containerfile diff --git a/test/image-blueprints/layer5-bootc/group1/rhel94-bootc-source.containerfile b/test/image-blueprints-bootc/layer2-source/group1/rhel94-bootc-source.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group1/rhel94-bootc-source.containerfile rename to test/image-blueprints-bootc/layer2-source/group1/rhel94-bootc-source.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/microshift-imagestore-config.sh.template b/test/image-blueprints-bootc/layer2-source/group2/microshift-imagestore-config.sh.template similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/microshift-imagestore-config.sh.template rename to test/image-blueprints-bootc/layer2-source/group2/microshift-imagestore-config.sh.template diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-aux.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-aux.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-aux.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-aux.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-fake-next-minor.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-fake-next-minor.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-fake-next-minor.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-fake-next-minor.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-fips.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-fips.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-fips.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-fips.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-isolated.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-isolated.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-isolated.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-isolated.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-optionals.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-optionals.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-optionals.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-optionals.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-ostree-parent-previous-minor.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-ostree-parent-previous-minor.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-ostree-parent-previous-minor.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-ostree-parent-previous-minor.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-ostree-parent-yminus2.containerfile b/test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-ostree-parent-yminus2.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/rhel94-bootc-source-ostree-parent-yminus2.containerfile rename to test/image-blueprints-bootc/layer2-source/group2/rhel94-bootc-source-ostree-parent-yminus2.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-fips.containerfile b/test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-fips.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-fips.containerfile rename to test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-fips.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-flannel.containerfile b/test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-flannel.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-flannel.containerfile rename to test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-flannel.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-isolated.containerfile b/test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-isolated.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-isolated.containerfile rename to test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-isolated.containerfile diff --git a/test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-optionals.containerfile b/test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-optionals.containerfile similarity index 100% rename from test/image-blueprints/layer5-bootc/group2/cos9-bootc-source-optionals.containerfile rename to test/image-blueprints-bootc/layer2-source/group3/cos9-bootc-source-optionals.containerfile diff --git a/test/image-blueprints/layer5-bootc/group3/rhel94-bootc-source-isolated.image-bootc b/test/image-blueprints-bootc/layer2-source/group3/rhel94-bootc-source-isolated.image-bootc similarity index 100% rename from test/image-blueprints/layer5-bootc/group3/rhel94-bootc-source-isolated.image-bootc rename to test/image-blueprints-bootc/layer2-source/group3/rhel94-bootc-source-isolated.image-bootc diff --git a/test/image-blueprints/README.md b/test/image-blueprints/README.md new file mode 100644 index 0000000000..e50d14650c --- /dev/null +++ b/test/image-blueprints/README.md @@ -0,0 +1,44 @@ +The following guiding principles should be used when adding more artifacts to +each layer or group under `test/image-blueprints` directory. + +> Important: Keep balanced build times within each group and maximize caching +> of artifacts independent of the current source code. + +## OSTree Base Layer + +Artifacts built in this layer are cached. + +Groups 1-to-3 enforce an ordered build chain, necessary to satisfy a mandatory +layer dependency of `rhel94 os-only -> rhel94 y-2 -> rhel94 y-1`, which is needed +for testing upgrades. + +|Group |Build Time|Description| +|------|----------|-----------| +|group1| Short | RHEL 9.4 OS-only base layer +|group2| Short | RHEL 9.4 layer with MicroShift `y-2` packages +|group3| Short | RHEL 9.4 layer with MicroShift `y-1` packages +|group4| Average | Other artifacts independent of current sources + +> Note: Total build times are up to 30 minutes. + +## OSTree Presubmit Layer + +Artifacts built in this layer cannot be cached as they depend on the current sources. +The artifacts are used by pre-submit and periodic CI jobs. + +|Group |Build Time|Description| +|------|----------|-----------| +|group1| Average | Current source prerequisites used in pre-submits and periodics + +> Note: Total build times are up to 10 minutes. + +## OSTree Periodic Layer + +Artifacts built in this layer cannot be cached as they depend on the current sources. +The artifacts are only used by periodic CI jobs. + +|Group |Build Time|Description| +|------|----------|-----------| +|group1| Average | Current source prerequisites used only in periodics + +> Note: Total build times are up to 15 minutes. diff --git a/test/image-blueprints/layer1-base/group3/rhel94-microshift-previous-minor.image-installer b/test/image-blueprints/layer1-base/group4/rhel94-microshift-previous-minor.image-installer similarity index 100% rename from test/image-blueprints/layer1-base/group3/rhel94-microshift-previous-minor.image-installer rename to test/image-blueprints/layer1-base/group4/rhel94-microshift-previous-minor.image-installer diff --git a/test/image-blueprints/layer1-base/group1/rhel94.image-installer b/test/image-blueprints/layer1-base/group4/rhel94.image-installer similarity index 100% rename from test/image-blueprints/layer1-base/group1/rhel94.image-installer rename to test/image-blueprints/layer1-base/group4/rhel94.image-installer diff --git a/test/image-blueprints/layer3-periodic/group1/rhel94-source-with-optionals.toml b/test/image-blueprints/layer3-periodic/group1/rhel94-source-with-optionals.toml deleted file mode 100644 index c0a0f589e3..0000000000 --- a/test/image-blueprints/layer3-periodic/group1/rhel94-source-with-optionals.toml +++ /dev/null @@ -1,65 +0,0 @@ -name = "rhel-9.4-microshift-source-optionals" -description = "A RHEL 9.4 image with MicroShift and OLM built from source." -version = "0.0.1" -modules = [] -groups = [] -distro = "rhel-94" - -[[packages]] -name = "microshift" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-greenboot" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-networking" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-selinux" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-olm" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-multus" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-gateway-api" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-test-agent" -version = "*" - -[[packages]] -name = "systemd-resolved" -version = "*" - -[customizations.services] -enabled = ["microshift", "microshift-test-agent"] - -[customizations.firewall] -ports = ["22:tcp", "80:tcp", "443:tcp", "5353:udp", "6443:tcp", "30000-32767:tcp", "30000-32767:udp"] - -[customizations.firewall.services] -enabled = ["mdns", "ssh", "http", "https"] - -[[customizations.firewall.zones]] -name = "trusted" -sources = ["10.42.0.0/16", "169.254.169.1"] - -# Extend Greenboot wait timeout to 10m for MicroShift to be ready. -# Greenboot configuration must come after RPM install to avoid -# /etc/greenboot/greenboot.conf overwrite by the package update. -[[customizations.files]] -path = "/etc/greenboot/greenboot.conf" -data = """ -GREENBOOT_WATCHDOG_CHECK_ENABLED=true -MICROSHIFT_WAIT_TIMEOUT_SEC=600 -""" diff --git a/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.image-installer b/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.image-installer deleted file mode 100644 index bc9c593a49..0000000000 --- a/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.image-installer +++ /dev/null @@ -1 +0,0 @@ -rhel-94-microshift-ext diff --git a/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.toml b/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.toml deleted file mode 100644 index 96e2664844..0000000000 --- a/test/image-blueprints/layer4-ext/group1/rhel94_microshift-ext.toml +++ /dev/null @@ -1,67 +0,0 @@ -name = "rhel-94-microshift-ext" -description = "A RHEL 9.4 image built from external RPMs." -version = "0.0.1" -modules = [] -groups = [] -distro = "rhel-94" - -[[packages]] -name = "microshift" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-greenboot" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-networking" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "microshift-selinux" -version = "{{ .Env.SOURCE_VERSION }}" - -[[packages]] -name = "systemd-resolved" -version = "*" - -[[packages]] -name = "iputils" -version = "*" - -[[packages]] -name = "bind-utils" -version = "*" - -[[packages]] -name = "net-tools" -version = "*" - -[[packages]] -name = "iotop" -version = "*" - -[[packages]] -name = "strace" -version = "*" - -[[packages]] -name = "iproute-tc" -version = "*" - -[[packages]] -name = "kernel-modules-extra" -version = "*" - -[customizations.services] -enabled = ["microshift"] - -[customizations.firewall] -ports = ["22:tcp", "80:tcp", "443:tcp", "5353:udp", "6443:tcp", "30000-32767:tcp", "30000-32767:udp"] - -[customizations.firewall.services] -enabled = ["mdns", "ssh", "http", "https"] - -[[customizations.firewall.zones]] -name = "trusted" -sources = ["10.42.0.0/16", "169.254.169.1"] diff --git a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-crel-optionals.containerfile b/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-crel-optionals.containerfile deleted file mode 100644 index 5c7673a38d..0000000000 --- a/test/image-blueprints/layer5-bootc/group2/rhel94-bootc-crel-optionals.containerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM localhost/rhel94-bootc-crel:latest - -# Copy repository configuration -COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \ - /etc/yum.repos.d/ - -# Print repository configuration contents. -# Install MicroShift and cleanup. -RUN dnf repoinfo --enabled && \ - dnf install -y "microshift-olm-{{ .Env.CURRENT_RELEASE_VERSION }}" "microshift-multus-{{ .Env.CURRENT_RELEASE_VERSION }}" && \ - rm -vf /etc/yum.repos.d/microshift-*.repo && \ - dnf clean all