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

Tinify artifacts image #1768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joepvd
Copy link

@joepvd joepvd commented May 16, 2024

Currently, the cli-artifacts image compiles all of make-crossbuild targts on all arches. This means that on, say, the s390x image, the mac-arm and ppc64le artifacts are present.

This change also proposes to not depend on the cli image, which will make image builds run in parallel.

To have a look at the /usr/share/openshift directory of the current image. In the end result, e.g. current/amd64/ means the contents of the linux/amd64 version of the multi-arch brew image.

Current contents of cli-artifacts images
image=registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cli-artifacts-rhel9:v4.16.0-202405130811.p0.ge63d210.assembly.stream.el9
rm -rf current
for arch in amd64 arm64 ppc64le s390x; do
  mkdir -p current/$arch
  oc image extract --filter-by-os linux/$arch --path /usr/share/openshift/:$(pwd)/current/$arch $image
done
find current -type f | sort
current/amd64/LICENSE
current/amd64/linux_amd64/oc
current/amd64/linux_amd64/oc.rhel8
current/amd64/linux_amd64/oc.rhel9
current/amd64/linux_arm64/oc
current/amd64/linux_arm64/oc.rhel8
current/amd64/linux_arm64/oc.rhel9
current/amd64/linux_ppc64le/oc
current/amd64/linux_ppc64le/oc.rhel8
current/amd64/linux_ppc64le/oc.rhel9
current/amd64/linux_s390x/oc
current/amd64/mac_arm64/oc
current/amd64/mac/oc
current/amd64/windows/oc.exe
current/arm64/LICENSE
current/arm64/linux_amd64/oc
current/arm64/linux_amd64/oc.rhel8
current/arm64/linux_amd64/oc.rhel9
current/arm64/linux_arm64/oc
current/arm64/linux_arm64/oc.rhel8
current/arm64/linux_arm64/oc.rhel9
current/arm64/linux_ppc64le/oc
current/arm64/linux_ppc64le/oc.rhel8
current/arm64/linux_ppc64le/oc.rhel9
current/arm64/linux_s390x/oc
current/arm64/mac_arm64/oc
current/arm64/mac/oc
current/arm64/windows/oc.exe
current/ppc64le/LICENSE
current/ppc64le/linux_amd64/oc
current/ppc64le/linux_amd64/oc.rhel8
current/ppc64le/linux_amd64/oc.rhel9
current/ppc64le/linux_arm64/oc
current/ppc64le/linux_arm64/oc.rhel8
current/ppc64le/linux_arm64/oc.rhel9
current/ppc64le/linux_ppc64le/oc
current/ppc64le/linux_ppc64le/oc.rhel8
current/ppc64le/linux_ppc64le/oc.rhel9
current/ppc64le/linux_s390x/oc
current/ppc64le/mac_arm64/oc
current/ppc64le/mac/oc
current/ppc64le/windows/oc.exe
current/s390x/LICENSE
current/s390x/linux_amd64/oc
current/s390x/linux_amd64/oc.rhel8
current/s390x/linux_amd64/oc.rhel9
current/s390x/linux_arm64/oc
current/s390x/linux_arm64/oc.rhel8
current/s390x/linux_arm64/oc.rhel9
current/s390x/linux_ppc64le/oc
current/s390x/linux_ppc64le/oc.rhel8
current/s390x/linux_ppc64le/oc.rhel9
current/s390x/linux_s390x/oc
current/s390x/mac_arm64/oc
current/s390x/mac/oc
current/s390x/windows/oc.exe

This PR proposes to change that. It runs make-cross-build-linux$(arch) for rhel8 and rhel9, the windows and mac targets are only run when appropriately. Test build.

The new layout on disk with this change
image=registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-cli-artifacts-rhel9:v4.16.0-202405160620.p0.gb12057f.assembly.test.el9
rm -rf tinified
for arch in amd64 arm64 ppc64le s390x; do
  mkdir -p tinified/$arch  oc image extract --filter-by-os linux/$arch --path /usr/share/openshift/:$(pwd)/tinified/$arch $image
done
find tinified -type f | sort
tinified/amd64/LICENSE
tinified/amd64/linux_amd64/oc
tinified/amd64/linux_amd64/oc.rhel8
tinified/amd64/linux_amd64/oc.rhel9
tinified/amd64/mac_amd64/oc
tinified/amd64/windows/oc.exe
tinified/arm64/LICENSE
tinified/arm64/linux_arm64/oc
tinified/arm64/linux_arm64/oc.rhel8
tinified/arm64/linux_arm64/oc.rhel9
tinified/arm64/mac_arm64/oc
tinified/ppc64le/LICENSE
tinified/ppc64le/linux_ppc64le/oc
tinified/ppc64le/linux_ppc64le/oc.rhel8
tinified/ppc64le/linux_ppc64le/oc.rhel9
tinified/s390x/LICENSE
tinified/s390x/linux_s390x/oc
tinified/s390x/linux_s390x/oc.rhel8
tinified/s390x/linux_s390x/oc.rhel9

With this, the combined size of the images gets reduced with more than half:

du -hs */*
1.7G	current/amd64
1.7G	current/arm64
1.7G	current/ppc64le
1.6G	current/s390x
701M	tinified/amd64
601M	tinified/arm64
455M	tinified/ppc64le
474M	tinified/s390x

Only have artifacts relevant to the arch of the image. Also, do not
depend on the cli image to have image builds run in parallel.
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2024
@openshift-ci openshift-ci bot requested review from mfojtik and soltysh May 16, 2024 08:41
Copy link
Contributor

openshift-ci bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: joepvd
Once this PR has been reviewed and has the lgtm label, please assign mfojtik for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@joepvd joepvd changed the title WIP: Tinify artifacts WIP: Tinify artifacts image May 16, 2024
@joepvd
Copy link
Author

joepvd commented May 16, 2024

A possible further optimization is to have /usr/share/.../oc be a symlink of oc.rhel9, but unsure if that'd break something.

@joepvd
Copy link
Author

joepvd commented May 16, 2024

/retest

@joepvd joepvd changed the title WIP: Tinify artifacts image Tinify artifacts image May 16, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 16, 2024
Copy link
Contributor

openshift-ci bot commented May 16, 2024

@joepvd: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-upgrade b12057f link true /test e2e-aws-ovn-upgrade
ci/prow/e2e-aws-ovn-serial b12057f link true /test e2e-aws-ovn-serial
ci/prow/e2e-metal-ipi-ovn-ipv6 b12057f link false /test e2e-metal-ipi-ovn-ipv6
ci/prow/e2e-aws-ovn b12057f link true /test e2e-aws-ovn
ci/prow/e2e-agnostic-ovn-cmd b12057f link true /test e2e-agnostic-ovn-cmd

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@joepvd
Copy link
Author

joepvd commented May 17, 2024

Errors are legit, console wants to serve an arm binary, also when it is itself a x86_64 cluster.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 19, 2024
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 17, 2024
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants