diff --git a/Containerfile b/Containerfile new file mode 100644 index 000000000..a514c9ea7 --- /dev/null +++ b/Containerfile @@ -0,0 +1,33 @@ +# This builds the final OCP node image on top of the base RHCOS image. The +# latter may be RHEL or CentOS Stream-based. This is currently only buildable +# using podman/buildah as it uses some mounting options only available there. +# +# To build this, you will want to pass `--security-opt=label=disable` to avoid +# having to relabel the context directory. Any repos found in `/run/yum.repos.d` +# will be imported into `/etc/yum.repos.d/` and then removed in the same step (so +# as to not end up in the final image). +# +# Use `--from` to override the base RHCOS image. E.g.: +# +# podman build --from quay.io/openshift-release-dev/ocp-v4.0-art-dev:rhel-coreos-base-9.4 ... +# +# Or to use a locally built OCI archive: +# +# podman build --from oci-archive:builds/latest/x86_64/scos-9-20240416.dev.0-ostree.x86_64.ociarchive ... + +# If consuming from repos hosted within the RH network, you'll want to mount in +# certs too: +# +# podman build -v /etc/pki/ca-trust:/etc/pki-ca-trust:ro ... +# +# Example invocation: +# +# podman build --from oci-archive:$(ls builds/latest/x86_64/*.ociarchive) \ +# -v rhel-9.4.repo:/run/yum.repos.d/rhel-9.4.repo:ro \ +# -v /etc/pki/ca-trust:/etc/pki/ca-trust:ro \ +# --security-opt label=disable -t localhost/openshift-node-c9s \ +# src/config + +FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev:rhel-coreos-base-c9s +RUN --mount=type=bind,target=/run/src /run/src/scripts/apply-manifest /run/src/packages-openshift.yaml && \ + ostree container commit diff --git a/README.md b/README.md index 4663763c9..e978b729d 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,17 @@ To support building both a RHEL-based and a CentOS Stream-based CoreOS, the coreos-assembler concept of [variants] is used. The following variants are supported: -- `rhel-9.4`: RHEL 9.4-based CoreOS; including OpenShift components. -- `c9s`: CentOS Stream-based CoreOS, including OpenShift components. This +- `rhel-9.4`: RHEL 9.4-based CoreOS; without OpenShift components. +- `ocp-rhel-9.4`: RHEL 9.4-based CoreOS; including OpenShift components. +- `c9s`: CentOS Stream-based CoreOS, without OKD components. +- `okd-c9s`: CentOS Stream-based CoreOS, including OpenShift components. This currently includes some packages from RHEL because not all packages required by OpenShift are provided in CentOS Stream. -The default variant is `rhel-9.4`. +In the future, the `ocp-*` variants will be removed. Instead, OpenShift +components will be layered by deriving from the `rhel-9.4`/`c9s` images. + +The default variant is `ocp-rhel-9.4`. ## Reporting issues diff --git a/ci/prow-entrypoint.sh b/ci/prow-entrypoint.sh index eaffd0704..78c6d3060 100755 --- a/ci/prow-entrypoint.sh +++ b/ci/prow-entrypoint.sh @@ -305,36 +305,36 @@ main() { prepare_repos ;; "build" | "init-and-build-default") # TODO: change prow job to use init-and-build-default - cosa_init "rhel-9.4" + cosa_init "ocp-rhel-9.4" cosa_build ;; "rhcos-cosa-prow-pr-ci") setup_user - cosa_init "rhel-9.4" + cosa_init "ocp-rhel-9.4" cosa_build kola_test_qemu ;; "rhcos-9-build-test-qemu") setup_user - cosa_init "rhel-9.4" + cosa_init "ocp-rhel-9.4" cosa_build kola_test_qemu ;; "rhcos-9-build-test-metal") setup_user - cosa_init "rhel-9.4" + cosa_init "ocp-rhel-9.4" cosa_build kola_test_metal ;; "scos-9-build-test-qemu") setup_user - cosa_init "c9s" + cosa_init "okd-c9s" cosa_build kola_test_qemu ;; "scos-9-build-test-metal") setup_user - cosa_init "c9s" + cosa_init "okd-c9s" cosa_build kola_test_metal ;; diff --git a/common.yaml b/common.yaml index 2af9c5037..2439281e5 100644 --- a/common.yaml +++ b/common.yaml @@ -43,6 +43,21 @@ conditional-include: documentation: false postprocess: + # Mark the OS as of the CoreOS variant. + # XXX: should be part of a centos/redhat-release subpackage instead + - | + #!/usr/bin/bash + set -euo pipefail + cat >> /usr/lib/os-release <" -# This ensures we're semver-compatible which OpenShift wants -automatic-version-suffix: "-" -# Keep this is sync with the version in postprocess -mutate-os-release: "4.17" - -postprocess: - - | - #!/usr/bin/env bash - set -xeo pipefail - # Tweak /usr/lib/os-release - grep -v -e "OSTREE_VERSION" -e "OPENSHIFT_VERSION" /etc/os-release > /usr/lib/os-release.stream - ( - . /etc/os-release - cat > /usr/lib/os-release <" - # Tweak /etc/system-release, /etc/system-release-cpe & /etc/redhat-release - ( - . /etc/os-release - cat > /usr/lib/system-release-cpe < /usr/lib/system-release < /usr/lib/issue <" +# This ensures we're semver-compatible which OpenShift wants +automatic-version-suffix: "-" +# Keep this is sync with the version in postprocess +mutate-os-release: "4.17" + +postprocess: + - | + #!/usr/bin/env bash + set -xeo pipefail + + # Tweak /usr/lib/os-release + grep -v -e "OSTREE_VERSION" -e "OPENSHIFT_VERSION" /etc/os-release > /usr/lib/os-release.rhel + ( + . /etc/os-release + cat > /usr/lib/os-release < /usr/lib/system-release-cpe < /usr/lib/system-release < /usr/lib/issue <" +# This ensures we're semver-compatible which OpenShift wants +automatic-version-suffix: "-" +# Keep this is sync with the version in postprocess +mutate-os-release: "4.17" + +postprocess: + - | + #!/usr/bin/env bash + set -xeo pipefail + + # Tweak /usr/lib/os-release + grep -v -e "OSTREE_VERSION" -e "OPENSHIFT_VERSION" /etc/os-release > /usr/lib/os-release.stream + ( + . /etc/os-release + cat > /usr/lib/os-release < /usr/lib/system-release-cpe < /usr/lib/system-release < /usr/lib/issue <" -# This ensures we're semver-compatible which OpenShift wants -automatic-version-suffix: "-" -# Keep this is sync with the version in postprocess -mutate-os-release: "4.17" - -postprocess: - - | - #!/usr/bin/env bash - set -xeo pipefail - # Tweak /usr/lib/os-release - grep -v -e "OSTREE_VERSION" -e "OPENSHIFT_VERSION" /etc/os-release > /usr/lib/os-release.rhel - ( - . /etc/os-release - cat > /usr/lib/os-release <" - # Tweak /etc/system-release, /etc/system-release-cpe & /etc/redhat-release - ( - . /etc/os-release - cat > /usr/lib/system-release-cpe < /usr/lib/system-release < /usr/lib/issue <