From 692780fd5dabbcf9e4781dac3b9d080ec332a4a2 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Tue, 14 Nov 2023 17:14:22 -0500 Subject: [PATCH] openshift-hack/images/os: delete All the logic there is geared towards `machine-os-content` which is no longer used at all in the cluster. Nowadays, the container to modify is `rhel-coreos`, which is what is already being done in CI: https://github.com/openshift/release/blob/463a8f244ba0f807e76e6fdf974f98d24efd1ced/ci-operator/config/openshift/kubernetes/openshift-kubernetes-master.yaml#L87-L97 --- REBASE.openshift.md | 8 +++--- openshift-hack/images/os/Dockerfile | 27 ------------------- openshift-hack/images/os/install.sh | 40 ----------------------------- 3 files changed, 4 insertions(+), 71 deletions(-) delete mode 100644 openshift-hack/images/os/Dockerfile delete mode 100755 openshift-hack/images/os/install.sh diff --git a/REBASE.openshift.md b/REBASE.openshift.md index 7ccdce02e132a..68e185b3342bb 100644 --- a/REBASE.openshift.md +++ b/REBASE.openshift.md @@ -228,10 +228,10 @@ kubernetes. ## Update base-os and test images -To be able to use the latest kubelet from a pull request, in this repository -we build [machine-os-content image](openshift-hack/images/os/Dockerfile). -Make sure that both `FROM` and `curl` operation in `RUN` command use appropriate -OCP version which corresponds with what we have in the [hyperkube image](openshift-hack/images/hyperkube/Dockerfile.rhel). +To be able to use the latest kubelet from a pull request, the openshift/release +job layers the built RPM [on top of the `rhel-coreos` image](https://github.com/openshift/release/blob/78568fbde1ee9a15bc6ab08c7c49ae3539d3e302/ci-operator/config/openshift/kubernetes/openshift-kubernetes-master.yaml#L102-L113). +Make sure that the `FROM` uses the appropriate OCP version which corresponds +with what we have in the [hyperkube image](openshift-hack/images/hyperkube/Dockerfile.rhel). Similarly, update `FROM` in [test image](openshift-hack/images/tests/Dockerfile.rhel) to match the one from [hyperkube image](openshift-hack/images/hyperkube/Dockerfile.rhel). diff --git a/openshift-hack/images/os/Dockerfile b/openshift-hack/images/os/Dockerfile deleted file mode 100644 index eb19c615dbf21..0000000000000 --- a/openshift-hack/images/os/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# this should match whatever we have in https://github.com/openshift/release/blob/master/ci-operator/config/openshift/kubernetes/openshift-kubernetes-master.yaml -# - context_dir: openshift-hack/images/os/ -# from: base -# inputs: -# base-machine-with-rpms: -# as: -# - centos:stream9 <-- here -# machine-os-content-base: -# as: -# - registry.svc.ci.openshift.org/openshift/origin-v4.0:machine-os-content -# to: machine-os-content -FROM centos:stream9 As build - -# the registry is defined here: -# https://github.com/openshift/release/blob/b45a09d248b8cdb8fe3bf5f3cfa0b4fee57d04c8/ci-operator/config/openshift/kubernetes/openshift-kubernetes-release-4.10.yaml#L68 -COPY --from=registry.svc.ci.openshift.org/openshift/origin-v4.0:machine-os-content /srv/ /srv/ -COPY --from=registry.svc.ci.openshift.org/openshift/origin-v4.0:machine-os-content /extensions/ /extensions/ -WORKDIR / -COPY install.sh . -RUN ./install.sh - -FROM scratch -COPY --from=build /srv/ /srv/ -COPY --from=build /extensions/ /extensions/ - -LABEL io.openshift.build.version-display-names="machine-os=rhcos image for testing openshift kubernetes kubelet only- if you see this outside of PR runs for openshift kubernetes- you found an urgent blocker bug" -LABEL io.openshift.build.versions="machine-os=1.2.3-testing-if-you-see-this-outside-of-PR-runs-for-openshift-kubernetes-you-found-an-urgent-blocker-bug" diff --git a/openshift-hack/images/os/install.sh b/openshift-hack/images/os/install.sh deleted file mode 100755 index c7995dd1f220f..0000000000000 --- a/openshift-hack/images/os/install.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -set -xeou pipefail - -yum install -y ostree rpm-ostree yum-utils selinux-policy-targeted xfsprogs -curl http://base-4-15-rhel9.ocp.svc > /etc/yum.repos.d/rhel9.repo - -commit=$( find /srv -name *.commit | sed -Ee 's|.*objects/(.+)/(.+)\.commit|\1\2|' | head -1 ) -mkdir /tmp/working && cd /tmp/working -rpm-ostree db list --repo /srv/repo $commit > /tmp/packages - -PACKAGES=(openshift-hyperkube) -yumdownloader -y --disablerepo=* --enablerepo=built --destdir=/tmp/rpms "${PACKAGES[@]}" -if ! grep -q cri-o /tmp/packages; then - yumdownloader -y --disablerepo=* --enablerepo=rhel-9* --destdir=/tmp/rpms cri-o cri-tools -fi - -ls /tmp/rpms/ && (cd /tmp/rpms/ && ls ${PACKAGES[@]/%/*}) -for i in $(find /tmp/rpms/ -name *.rpm); do - echo "Extracting $i ..."; rpm2cpio $i | cpio -div -done - -if [[ -d etc ]]; then - mv etc usr/ -fi - -mkdir -p /tmp/tmprootfs/etc - -ostree --repo=/srv/repo checkout \ - -U $commit \ - --subpath /usr/etc/selinux \ - /tmp/tmprootfs/etc/selinux - -ostree --repo=/srv/repo commit \ - --parent=$commit \ - --tree=ref=$commit \ - --tree=dir=. \ - --selinux-policy /tmp/tmprootfs \ - -s "origin-ci-dev overlay RPMs" \ - --branch=origin-ci-dev