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

Jlink to reduce container image size #265

Merged
merged 7 commits into from
Oct 8, 2020

Conversation

slinkydeveloper
Copy link
Contributor

Fixes #10

Now image size (receiver) is 184Mb, compared to previous 478Mb

This is a first pass on the issue, there are some mods picked by jdeps that we could eventually remove (like java.sql, that we don't use but we bring in b/c of jackson-databind). Also, we're on ubuntu base, we could drill down the image even further porting to alpine (but that requires musl libc and we need to figure out how to make that working with jlink).

Proposed Changes

  • Use jlink to create a smaller jdk, in order to reduce image size of our deliverables

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 7, 2020
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 7, 2020
@slinkydeveloper
Copy link
Contributor Author

/assign @pierDipi

@codecov
Copy link

codecov bot commented Oct 7, 2020

Codecov Report

Merging #265 into master will increase coverage by 0.45%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #265      +/-   ##
============================================
+ Coverage     76.30%   76.76%   +0.45%     
  Complexity      170      170              
============================================
  Files            49       49              
  Lines          1435     1463      +28     
  Branches         46       46              
============================================
+ Hits           1095     1123      +28     
  Misses          271      271              
  Partials         69       69              
Flag Coverage Δ Complexity Δ
#java-unittests 76.05% <ø> (ø) 170.00 <ø> (ø)
#unittests 76.76% <ø> (?) 170.00 <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
control-plane/pkg/reconciler/broker/broker.go 80.47% <0.00%> (+1.22%) 0.00% <0.00%> (ø%)
control-plane/pkg/config/env_config.go 90.00% <0.00%> (+10.00%) 0.00% <0.00%> (ø%)
control-plane/pkg/core/config/utils.go 75.00% <0.00%> (+29.54%) 0.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85e89e0...dfa9761. Read the comment docs.

@matzew
Copy link
Contributor

matzew commented Oct 7, 2020

nice one, Slinky!

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Cool!

data-plane/docker/Dockerfile Show resolved Hide resolved
data-plane/docker/generate_jdk.sh Show resolved Hide resolved
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Can you open an issue to keep track of the next iteration?

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2020
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2020
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@pierDipi
Copy link
Member

pierDipi commented Oct 7, 2020

/test pull-knative-sandbox-eventing-kafka-broker-integration-tests

@slinkydeveloper
Copy link
Contributor Author

/hold I wanna retry again with vert.x dns

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2020
@slinkydeveloper
Copy link
Contributor Author

Ok it seems like the vert.x dns works, but it requires the module of the jdk dns, funky

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper
Copy link
Contributor Author

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2020
@pierDipi
Copy link
Member

pierDipi commented Oct 8, 2020

/test pull-knative-sandbox-eventing-kafka-broker-integration-tests

@slinkydeveloper
Copy link
Contributor Author

This PR looks good to me, @pierDipi wanna merge?

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

/lgtm
🎉

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 8, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi, slinkydeveloper

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:
  • OWNERS [pierDipi,slinkydeveloper]

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

@knative-prow-robot knative-prow-robot merged commit ad2ba89 into knative-extensions:master Oct 8, 2020
@slinkydeveloper slinkydeveloper deleted the jdeps branch October 8, 2020 08:45
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request May 16, 2022
Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Jlink to reduce container image size
4 participants