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

Reduce libguestfs image size #6077

Merged
merged 3 commits into from
Jul 22, 2021
Merged

Conversation

rmohr
Copy link
Member

@rmohr rmohr commented Jul 20, 2021

What this PR does / why we need it:

Exclude quite a bunch of RPMs which are not needed by libguestfs but are pulled in automatically due to RPM dependencies. Reduces the size of pulled in dependencies from roughly 1.3 GB to 500 M.

More dependencies can be removed. This is just a first pass. Thanks @alicefr for providing initial investigations on potential candidates for removal.

This step is needed to achieve two goals:

  • keep the production image small for users
  • speed up kubevirt-build, since this image drastically slows down builds and deploys. Especially when nothing is cached.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 20, 2021
@rmohr
Copy link
Member Author

rmohr commented Jul 20, 2021

/cc @alicefr

@rmohr
Copy link
Member Author

rmohr commented Jul 20, 2021

@andreabolognani FYI: We just do this step now already before #5991 because the image makes building significantly slower.

@alicefr
Copy link
Member

alicefr commented Jul 20, 2021

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2021
@rmohr rmohr force-pushed the smaller-libguestfs branch from a693609 to 1ff60f4 Compare July 20, 2021 13:02
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2021
@rmohr
Copy link
Member Author

rmohr commented Jul 20, 2021

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 20, 2021
@rmohr rmohr force-pushed the smaller-libguestfs branch from 1ff60f4 to 02ea799 Compare July 20, 2021 14:37
@rmohr
Copy link
Member Author

rmohr commented Jul 20, 2021

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 20, 2021
libguestfs-tools \
--force-ignore-with-dependencies '^(kernel-|linux-firmware)' \
--force-ignore-with-dependencies '^(python[3]{0,1}-|perl[3]{0,1}-)' \
--force-ignore-with-dependencies '^(mesa-|libwayland-|selinux-policy|mozjs60)' \
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't dropping SELinux-related packages a bit too aggressive? Are you sure that's not going to cause any issues?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am looking forward to the e2e test results with libguestfs :)

Copy link
Member

Choose a reason for hiding this comment

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

@andreabolognani I think it should be fine to drop selinux packages. Selinux runs outside the container not inside.

@rmohr
Copy link
Member Author

rmohr commented Jul 20, 2021

/retest

1 similar comment
@mhenriks
Copy link
Member

/retest

@rmohr
Copy link
Member Author

rmohr commented Jul 21, 2021

/retest

@alicefr test results look good, can you have another look?

@alicefr
Copy link
Member

alicefr commented Jul 21, 2021

it looks good. I also tried a couple of libguestfs-tools it seems working fine :)
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 21, 2021
@alicefr
Copy link
Member

alicefr commented Jul 21, 2021

The diet was also very efficient 1.3G -> 605 MB ;)

@rmohr
Copy link
Member Author

rmohr commented Jul 21, 2021

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rmohr

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

The pull request process is described 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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2021
@rmohr
Copy link
Member Author

rmohr commented Jul 21, 2021

/retest

@alicefr
Copy link
Member

alicefr commented Jul 21, 2021

@rmohr the storage tests are failing and they are the guestfs tests. However, it is because the pod is still pending. So, I think it is because the pvc hasn't be bound and it times out. I'll trigger it once more
/retest

@alicefr
Copy link
Member

alicefr commented Jul 21, 2021

ok the storage tests are still failing but now the failed tests are not the guestfs tests. So, it was just flaky

@rmohr
Copy link
Member Author

rmohr commented Jul 21, 2021

ok the storage tests are still failing but now the failed tests are not the guestfs tests. So, it was just flaky

Yes. Something is wrong with them since a few days.

@rmohr
Copy link
Member Author

rmohr commented Jul 21, 2021

/retest

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2021
rmohr added 3 commits July 22, 2021 08:46
bazeldnf now has an option to ignore dependencies which helps reducing
image sizes.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
Ignore a first set of definitely unwanted dependencies. Possibly more
can be removed.

Signed-off-by: Roman Mohr <rmohr@redhat.com>
Signed-off-by: Roman Mohr <rmohr@redhat.com>
@rmohr rmohr force-pushed the smaller-libguestfs branch from 02ea799 to a9b558e Compare July 22, 2021 06:52
@kubevirt-bot kubevirt-bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 22, 2021
@rmohr
Copy link
Member Author

rmohr commented Jul 22, 2021

@alicefr rebased. Could you restore the lgtm?

@alicefr
Copy link
Member

alicefr commented Jul 22, 2021

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 22, 2021
@kubevirt-commenter-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit 32e4ed4 into kubevirt:main Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants