From bb30e339f63590a6b5e9f2ed82941d6ddf1e3683 Mon Sep 17 00:00:00 2001 From: Patrick Dillon Date: Wed, 3 May 2023 11:34:58 -0400 Subject: [PATCH 1/2] CORS-2785: images: decouple installer and installer-artifacts The installer-artifacts image depends on the installer image, which means they cannot be built in parallel. The effect of this dependency is that the installer-artifacts image contains the linux amd64 builds in addition to the mac/linux amd64/arm64 builds present in the installer-artifacts image. Breaking the dependency results in a more efficient build process because they can be built in parallel as well as no duplication of the linux amd64 binary in the release image (before this change the binary would be present in both images within the release image). The risk, though, is that clients are inconsistently grabbing the linux amd64 binary from either image, rather than only the installer image, in which case we would break any client trying to get that binary from the installer-artifacts image. --- images/installer-artifacts/Dockerfile.rhel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/images/installer-artifacts/Dockerfile.rhel b/images/installer-artifacts/Dockerfile.rhel index 8ab0d8dc340..f8d121b5d84 100644 --- a/images/installer-artifacts/Dockerfile.rhel +++ b/images/installer-artifacts/Dockerfile.rhel @@ -25,8 +25,11 @@ WORKDIR /go/src/github.com/openshift/installer COPY . . RUN GOOS=linux GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh -FROM registry.ci.openshift.org/ocp/4.15:installer +FROM registry.ci.openshift.org/ocp/4.15:base COPY --from=macbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac/openshift-install COPY --from=macarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac_arm64/openshift-install COPY --from=linuxbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_amd64/openshift-install COPY --from=linuxarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_arm64/openshift-install + +# We're not really an operator, we're just getting some data into the release image. +LABEL io.openshift.release.operator=true From f5c4035dd74271f2bf12b4a33eb93f0d1a05979e Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Wed, 29 Nov 2023 20:56:34 +0100 Subject: [PATCH 2/2] images: installer-artifacts: add generated manifests yaml This is the last missing piece to decouple installer-artifacts from installer --- images/installer-artifacts/Dockerfile.rhel | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/images/installer-artifacts/Dockerfile.rhel b/images/installer-artifacts/Dockerfile.rhel index f8d121b5d84..fc7a59992f8 100644 --- a/images/installer-artifacts/Dockerfile.rhel +++ b/images/installer-artifacts/Dockerfile.rhel @@ -25,11 +25,18 @@ WORKDIR /go/src/github.com/openshift/installer COPY . . RUN GOOS=linux GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh +FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.20-openshift-4.15 AS builder +ARG TAGS="" +WORKDIR /go/src/github.com/openshift/installer +COPY . . +RUN go run -mod=vendor hack/build-coreos-manifest.go + FROM registry.ci.openshift.org/ocp/4.15:base COPY --from=macbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac/openshift-install COPY --from=macarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac_arm64/openshift-install COPY --from=linuxbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_amd64/openshift-install COPY --from=linuxarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_arm64/openshift-install +COPY --from=builder /go/src/github.com/openshift/installer/bin/manifests/ /manifests/ # We're not really an operator, we're just getting some data into the release image. LABEL io.openshift.release.operator=true