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

slim-java: stop stripping .so files #537

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

Conversation

sxa
Copy link
Member

@sxa sxa commented Apr 1, 2021

The size of JDK16 as included in the slim images is around 250Mb. Stripping the .so files makes it very hard to do any debugging/profiling on the JVM and only saves about 4-5Mb. this is probably not a good tradeoff, so I'm suggesting changing this.

Fixes #318 but has also been reported as a concern elsewhere

Signed-off-by: Stewart X Addison [email protected]

@sxa sxa added the enhancement label Apr 1, 2021
@sxa sxa added this to the March 2021 milestone Apr 1, 2021
@sxa sxa self-assigned this Apr 1, 2021
@karianna karianna modified the milestones: March 2021, April 2021 Apr 1, 2021
@karianna
Copy link
Member

karianna commented Apr 1, 2021

Wouldn't the typical workflow be for someone to deploy a specialist debug image?

@sxa
Copy link
Member Author

sxa commented Apr 1, 2021

Debug symbols are not necessary for profiling - no need for a full set of debug symbols for that, but you want to be able to see the names of the methods being invoked. I think the 5Mb overhead is well worth it to avoid a lot of extra hassle, particularly in a docker image (and up until recently we didn't produce such images for HotSpot, and even now it's also not something we easily make available even if people wanted to go to the hassle of downloading them into their docker images)

@karianna
Copy link
Member

karianna commented Apr 1, 2021

Hmm, these are the slim images though which I think comes with an expectation that everything is stripped out.

@aahlenst
Copy link
Contributor

aahlenst commented Apr 1, 2021

Playing devil's advocate here: When you opt for the slim image, you're opting for a weird "JDK but not really a JDK" experience. There are posts like An OpenJDK 14 Docker image that's 33% slimmer than Adoptium's, so people apparently want that. Why take it away? If somebody wants to have something that's blessed, they shouldn't take the slim images.

@sxa
Copy link
Member Author

sxa commented Apr 1, 2021

If we cared that much about the size we might have responded to #478 as well. I don't know what people's motivations are when they pick the slim one, so while that /may/ be a valid response I don't think that 5Mb (~2%) necessarily tips the balance in favour of stripping them all (I was surpsied it wasn't more to be honest) but if that's the case we should definitely respond in the issue that this would "fix". I've had another discussion on this during the week on this topic so it may not immediately be obvious to people that we've restricted it this way.

(EDIT: Also, having just looked at that "33% slimmer" image - it looks on a quick look that the JDK directory is about 280Mb so larger than our non-Alpine SLIM image, so if we wanted to reduce further there is almost certainly further opportunities)

@aahlenst
Copy link
Contributor

aahlenst commented Apr 1, 2021

If we cared that much about the size we might have responded to #478 as well.

Just guessing here, but I assume this is rather caused by lack of development resources than anything else.

I went through the old issues and PRs. Information about the use case and the promise around the slim images is hard to find. The current README offers this:

These are stripped down JDK builds that remove functionality not typically needed while running in a cloud. See the ./slim-java.sh script to see what is stripped out.

#29 (comment) offers some context in regards to a quality bar. Apparently, the objective is to pass headless TCK testing (I don't know what that requires).

If not stripping .so files is required "while running in a cloud", add it. If "headless TCK testing" requires not to strip .so files, add it. Otherwise 🤷.

@sxa
Copy link
Member Author

sxa commented Apr 1, 2021

If not stripping .so files is required "while running in a cloud", add it. If "headless TCK testing" requires not to strip .so files, add it. Otherwise 🤷

I'm quite 🤷 on it too, and while I can totally understand why they were stripped, I'd now slightly err on the side of including them given the numbers inbolved.

I assume this is rather caused by lack of development resources

Almost certainly, but if our end users of our product are raising them it would be good to give some sort of response, even if it's "help wanted to fix it" or a reason why we don't.

@aahlenst
Copy link
Contributor

aahlenst commented Apr 1, 2021

I don't really care about what we do (strip or not), but we should set the expectations right.

It would be good to give some sort of response.

I agree, but I cannot (and don't want to be) everywhere.

@karianna
Copy link
Member

karianna commented Apr 1, 2021

We should work on #478 - I think the original goal here is to have the smallest image possible for cloud deployments where even saving 5Mb (* 100K+ deployments) does matter. @dinogun - can you add any extra context here?

@dinogun
Copy link
Collaborator

dinogun commented Apr 1, 2021

The fact that we have a huge number of people using the slim images shows that they prefer having smaller sized images as this has a direct impact on docker push / pull times, provisioning times, build times (during CI/CD) etc. The whole point of the slim image has always been to solve this usecase. If people want full functionality they can always use the regular JDK/JRE images which dont have anything stripped out. Adding anything back into the slim images means it will fail the primary usecase and it is impossible to please everyone for individual scenarios. That being said, if we can reach broad agreement on what constitutes a slim image, we can make changes. Maybe we can have a poll on slack where folks can vote on this. In any case I would personally not want to merge this.

@sxa
Copy link
Member Author

sxa commented Apr 6, 2021

The fact that we have a huge number of people using the slim images shows that they prefer having smaller sized images as this has a direct impact on docker push / pull times, provisioning times, build times (during CI/CD) etc.

Of course - if you have two images why not pick the smaller one? But there are people out there who do not realise that it has stripped out the symbols, making things like profiling in a live environment problematic, and that's something you may not find out until it's too late. I personall think 5MB or so is a price worth paying. Do we list anywhere what the expectations are of the slim image contents? https://hub.docker.com/r/adoptopenjdk/openjdk15-openj9 doesn't seem to make it clear what the differences are to end-users, so I don't think we can assume that the would necessarily expect those 5MB of symbols to be removed. If we don't merge this, we need to make it clear what the differences are.

@srbala
Copy link
Contributor

srbala commented Apr 19, 2021

Team, #478 gives big size drop compare to current size, without even removing any more .so files. As @dinogun indicated, if anyone need full sources or any other files for any debug/profiling purpose, they can use the full image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

symbol stripping
5 participants