Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: multi-arch must-gather image #1494

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 2 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
10 changes: 6 additions & 4 deletions must-gather/Dockerfile
rayfordj marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ ARG TARGETOS
ARG TARGETARCH
ARG RESTIC_BRANCH=konveyor-0.15.0
ARG VELERO_BRANCH=konveyor-dev

WORKDIR /build

RUN curl --location --output velero.tgz https://github.com/openshift/velero/archive/refs/heads/${VELERO_BRANCH}.tar.gz && \
tar -xzvf velero.tgz && cd velero-${VELERO_BRANCH} && \
VELERO_COMMIT=$(git ls-remote https://github.com/openshift/velero HEAD | awk '{printf $1}') && \
Expand All @@ -13,21 +15,21 @@ RUN curl --location --output velero.tgz https://github.com/openshift/velero/arch
curl --location --output restic.tgz https://github.com/openshift/restic/archive/refs/heads/${RESTIC_BRANCH}.tar.gz && \
tar -xzvf restic.tgz && cd restic-${RESTIC_BRANCH} && \
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /restic github.com/restic/restic/cmd/restic && \
cd .. && rm -rf restic.tgz restic-${RESTIC_BRANCH}
cd .. && rm -rf restic.tgz restic-${RESTIC_BRANCH} && \
curl --location --output oc.tgz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.16/openshift-client-linux-${TARGETARCH}-rhel9.tar.gz && \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could use stable (which is currently 4.16), this way we won't need to update once 4.17 is there:

curl --location --output oc.tgz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-${TARGETARCH}-rhel9.tar.gz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like automatically updates

how does prod handles updates for oc @rayfordj ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, manually, until we have an oc available from an el9/ubi9 base image at which time we'll then resume updating via follow_tag as the base image is updated. I'm guessing this likely won't happen until >=v4.17.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I lean towards stable to ensure it isn't later forgotten and doesn't rot as has been observed to occur over the years across our repos. I've no objection for upstream to use either a) latest stable or b) latest versioned (such as, stable-v4.16). However, the former will continue to be updated over releases, while the latter will eventually stop being maintained. Regardless, it isn't something that will be carried downstream.
😬

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could copy oc from container image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to stable

there is a handy image for that, Tiger? ones I found, where not in registry.access, so needed auth

tar -xzvf oc.tgz -C . oc && rm -rf oc.tgz

FROM registry.access.redhat.com/ubi9/go-toolset:latest AS gobuilder

RUN go install -v github.com/google/pprof@latest

FROM quay.io/openshift/origin-must-gather:latest AS builder

FROM registry.access.redhat.com/ubi9-minimal:latest

RUN echo -ne "[centos-9-appstream]\nname = CentOS 9 (RPMs) - AppStream\nbaseurl = https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/\nenabled = 1\ngpgcheck = 0" > /etc/yum.repos.d/centos-9-appstream.repo
RUN microdnf -y install rsync tar gzip graphviz findutils

COPY --from=gobuilder /opt/app-root/src/go/bin/pprof /usr/bin/pprof
COPY --from=builder /usr/bin/oc /usr/bin/oc
COPY --from=konveyor-builder /build/oc /usr/bin/oc
COPY --from=konveyor-builder /velero /usr/bin/velero
COPY --from=konveyor-builder /restic /usr/bin/restic

Expand Down