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

Create a debug symbols-only package #2042

Closed
milderhc opened this issue Aug 28, 2020 · 33 comments
Closed

Create a debug symbols-only package #2042

milderhc opened this issue Aug 28, 2020 · 33 comments
Assignees
Labels
enhancement Issues that enhance the code or documentation of the repo in any way
Milestone

Comments

@milderhc
Copy link
Contributor

Option to create debug symbols in a different archive than within the JDK one.

We can either create the JDK archive with or without the debug symbols but there isn't an option to create them separately.

@karianna karianna added this to TODO in temurin-build via automation Sep 5, 2020
@karianna karianna added the enhancement Issues that enhance the code or documentation of the repo in any way label Sep 5, 2020
@karianna karianna added this to the September 2020 milestone Sep 5, 2020
@karianna karianna moved this from TODO to In Progress in temurin-build Sep 5, 2020
@karianna karianna modified the milestones: September 2020, November 2020 Nov 3, 2020
@smlambert
Copy link
Contributor

@milderhc - it looks like you have made great progress on this (with #2043 merged), thanks!

Are the next steps to:

  • update the build pipeline scripts, so that these artifacts are produced and pushed to the releases repo
  • served up via the API
  • visible on the website for download

Will you be taking that on? Do you need any support to move this forward?

@milderhc
Copy link
Contributor Author

milderhc commented Dec 11, 2020

@smlambert Sure. I can take those.

Could you tell me where the pipeline scripts are? And also, the idea in the API would be a new method that serves the debug symbols exclusively, as well as in the website?

I'm not familiar with any of those repos, it would take a while.

@smlambert
Copy link
Contributor

smlambert commented Dec 11, 2020

Thanks @milderhc! Pipeline scripts are in this repo. Though, as I look at one of the PRs that added support for debugimages for OpenJ9, I think a bunch of the work may already be in place... but defer to build team to give guidance.

@andrew-m-leonard @sxa - Would one of you be able to assist @milderhc ?
Is all that is needed to actually update the pipeline config to build the debug images?

API work: (work is done) AdoptOpenJDK/openjdk-api-v3#130
Website work: (still outstanding?) AdoptOpenJDK/openjdk-website#696 (this is less critical than being able to serve up debuginfo through the API)

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Dec 11, 2020

Sure I can help. @smlambert @milderhc I wanted to check if the following bug I helped integrate into OpenJDK for jdk-16 is also relevant here?
https://bugs.openjdk.java.net/browse/JDK-8252233 Put debug symbols in symbols-image

@smlambert
Copy link
Contributor

I would guess it is relevant @andrew-m-leonard - can you outline what, if any further changes are needed to produce these artifacts at the project (for hotspot builds)?

@andrew-m-leonard
Copy link
Contributor

So the change https://bugs.openjdk.java.net/browse/JDK-8252233 enabled the production of a pure debug symbols image via the target:

make symbols-image

Which will result in a "build/*/images/symbols" image
The default "make product-images" which the Adopt builds use includes "symbols-image", so you should find we already have a symbols image folder being produced, we just need to zip it up... and archive.

@smlambert
Copy link
Contributor

@andrew-m-leonard - is that make target only for jdk16+ or for all versions (is it possible for all versions, or what is the debuginfo artifact that should be produced for pre-jdk16)? perhaps you can point to the place in the code where one would make the change to enable this given #2042 (comment)

@karianna karianna modified the milestones: November 2020, December 2020 Jan 3, 2021
@smlambert smlambert added this to To do in Top Priorities via automation Jan 5, 2021
@andrew-m-leonard
Copy link
Contributor

@milderhc hi Milder, i've been having a look at what upstream openjdk supports and currently they vary by version:
jdk16+ : With support in https://bugs.openjdk.java.net/browse/JDK-8252233 you can now simply issue "make symbols-image". The "symbols-image" is part of the "product-images" make target, and for jdk8+ Adopt already builds that target: https://github.com/AdoptOpenJDK/openjdk-build/blob/87f799024a58d392255eead1cd83d93515410b2e/configureBuild.sh#L206 . This means for jdk16+ we already build the "build/*/symbols/.." image, we just need to archive it at the end of the build, so this line needs to be moving the "symbols" folder: https://github.com/AdoptOpenJDK/openjdk-build/blob/88c0d77255264cc92423d534de9c3563d4fb0903/sbin/build.sh#L632 ie."${BUILD_CONFIG[DEBUG_IMAGE_PATH]}" for jdk16+ needs to be "symbols".

jdk11u & jdk8u: So both of these support make "symbols-image", however they do not have JDK-8252233, and so it does not produce an image bundle, but just places the symbols in the jdk image "lib" folder. This means we have two options here:

  1. Get JDK-8252233 backported and use the same method as jdk16+. This is probably ideal, but will take time...
  2. Add logic to sbin/build.sh to move the symbols from lib to a new location, it looks like you have already done this? https://github.com/AdoptOpenJDK/openjdk-build/blob/88c0d77255264cc92423d534de9c3563d4fb0903/sbin/build.sh#L651 Does this work for jdk16+ ? if so then maybe ignore JDK-8252233 for the moment.

I see now you added a new build arg: --create-debug-symbols-package, so I think the question to ask is when do we want this set to true? always? if so it's just a matter of setting it in: https://github.com/AdoptOpenJDK/openjdk-build/blob/master/build-farm/make-adopt-build-farm.sh
If it only wants setting on specific platforms or versions then in here: https://github.com/AdoptOpenJDK/openjdk-build/tree/master/build-farm/platform-specific-configurations

@andrew-m-leonard
Copy link
Contributor

@milderhc another important fact that needs evaluating before we enable --create-debug-symbols-package, is how much more space is the symbols archive going to add to our builds, for capacity planning? As this is going to add xMB per osbuild x variant x version... ?
@sxa fyi

@milderhc
Copy link
Contributor Author

milderhc commented Jan 8, 2021

Hi @andrew-m-leonard, thanks for looking into this and for the detailed explanation.

The --create-debug-symbols-package option works in jdk8u, jdk11u, and jdk16+. We can include it directly in make-adopt-build-farm.sh which I believe is called by the build pipeline?

The space in MB for jdk11u in Linux is around 230MB and around 40MB for macOS and Windows. In jdk8u is around 100MB for LInux and 5MB for Windows. Sizes for jdk16 are pretty similar to jdk11u.

@andrew-m-leonard
Copy link
Contributor

@milderhc hi, one quick question, what is the difference between the current openj9 "-debug-image" and the new "-debug-symbols" ?

@andrew-m-leonard
Copy link
Contributor

it would make sense to call Hotspot one "debug-image" as well?

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Jan 8, 2021

So some rough calculations on size:
Platforms that cache builds for each version:

  • arm : 5x230MB = +1.15Gb
  • pLinux : 5x230MB = +1.15Gb
  • mac : 5x10MB = +50MB

Platforms that do not cache currently:
AIX : ws cleared
zLinux : ws cleared
Win : only caches last build in tmp ws
xLinux : Docker
aarch64 : Docker

"master" node archive storage for all versions x platforms:

jdk8:
- 11 Linux = 1100MB
- 5 mac & win = 25MB
jdk11:
- 9 Linux = 2160MB
- 4 mac & win = 160MB
jdk15:
- 7 Linux = 1680MB
- 3 mac & win = 120MB
jdk16:
- 7 Linux =1680MB
- 4 mac & win = 160MB
jdk17:
- 7 Linux = 1680MB
- 4 mac & win = 160MB

So adding roughly an extra 1.1-2.3Gb increase in size of each new archived pipeline build on Jenkins "master"

@sxa fyi

@milderhc
Copy link
Contributor Author

milderhc commented Jan 8, 2021

I was asking the same myself. I think they are the same. In fact, if we call the script for openj9 along with --with-debug-symbols-package we might get two packages. It makes sense to rename debug-symbols to debug-image as well.

@andrew-m-leonard
Copy link
Contributor

I was asking the same myself. I think they are the same. In fact, if we call the script for openj9 along with --with-debug-symbols-package we might get two packages. It makes sense to rename debug-symbols to debug-image as well.

yes, agree

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Jan 8, 2021

I was asking the same myself. I think they are the same. In fact, if we call the script for openj9 along with --with-debug-symbols-package we might get two packages. It makes sense to rename debug-symbols to debug-image as well.

So I think we need to update the logic so for openj9 it uses the current "debug-image" make target as it currently does, and for the other variants uses the new logic you have added to create their "debug-image".

@milderhc
Copy link
Contributor Author

milderhc commented Jan 8, 2021

Ok, I will update that first.

@karianna karianna moved this from To do to In progress in Top Priorities Jan 12, 2021
@andrew-m-leonard
Copy link
Contributor

@milderhc hi Milder, how is it going?

@milderhc
Copy link
Contributor Author

@andrew-m-leonard hi, sorry for the late answer. I created the pull request: #2393

@andrew-m-leonard
Copy link
Contributor

@milderhc thanks, that PR looks good. Once that is merged it's just a matter of:

  1. Perform Jenkins infrastructure capacity evaluation/impact: Create a debug symbols-only package #2042 (comment)
  2. Having completed (1), adding --create-debug-image if variant != "openj9" somewhere around here: https://github.com/AdoptOpenJDK/openjdk-build/blob/102237341c7f0737f0dd4dc57fcc7e9e3ffe3bd5/build-farm/make-adopt-build-farm.sh#L164

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Feb 3, 2021

The build output cleaning PR is now merged, and needs to propagate across the build nodes to take affect. Currently the build nodes with the most marginal space are the 2 arm nodes, with spare space of 3Gb, 4Gb respectively as of now. Introducing at this at the moment would marginalize this 2 machines by about another 1.2Gb.
I will examine each to check for any dedundent usage and monitor nodes once the clean build output has propagated across them.

Having just examined build-scaleway-ubuntu1604-armv7-1, the build output cleaning should release 8Gb from it.

@sxa fyi

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Feb 3, 2021

Submitted build pipelines for arm on jdk8/11/16/17
New arm node space:

  • build-scaleway-ubuntu1604-armv7-1 : 18Gb
  • build-scaleway-ubuntu1604-armv7-2 : 19Gb
    So we've freed up at least 6Gb
    This easily gives us enough headroom for debug-images.

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Feb 3, 2021

@milderhc Would you like to propose a PR to enable --create-debug-image ?
https://github.com/AdoptOpenJDK/openjdk-build/blob/ecb4ce1182b079fb88cc77ce871e3ad1216e4612/build-farm/make-adopt-build-farm.sh#L163

@milderhc
Copy link
Contributor Author

milderhc commented Feb 3, 2021

Thanks, @andrew-m-leonard, would that be enough for the debug-images to be downloadable?

@milderhc
Copy link
Contributor Author

milderhc commented Feb 4, 2021

Here it is: #2443

@karianna karianna modified the milestones: December 2020, February 2021 Feb 4, 2021
@M-Davies M-Davies linked a pull request Feb 18, 2021 that will close this issue
@andrew-m-leonard
Copy link
Contributor

Nightly builds for hotspot with debug-image's are now available from the website: https://adoptopenjdk.net/nightly.html?variant=openjdk8&jvmVariant=hotspot

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Feb 25, 2021

Things remaining:

  • Upstream mac debug jdk8 patch
  • Upstream win debug jdk8 fix
  • Upstream AIX debug fix for all versions

@andrew-m-leonard andrew-m-leonard self-assigned this Mar 3, 2021
@karianna karianna modified the milestones: February 2021, March 2021 Mar 29, 2021
@smlambert smlambert moved this from In progress to Reviewer approved in Top Priorities Apr 6, 2021
@gdams gdams removed this from Reviewer approved in Top Priorities Apr 27, 2021
@andrew-m-leonard
Copy link
Contributor

AIX debug symbol contributions now merged into all upstream versions, just awaiting official build levels

@karianna karianna modified the milestones: March 2021, May 2021 May 24, 2021
@karianna karianna modified the milestones: May 2021, June 2021 Jun 6, 2021
@sxa
Copy link
Member

sxa commented Jul 12, 2021

@andrew-m-leonard Is this now present in the July versions?

@andrew-m-leonard
Copy link
Contributor

@sxa yes, complete

@lwahonen
Copy link

Nightly builds for hotspot with debug-image's are now available from the website: https://adoptopenjdk.net/nightly.html?variant=openjdk8&jvmVariant=hotspot

The debug images don't seem to be available from this page anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues that enhance the code or documentation of the repo in any way
Projects
No open projects
temurin-build
  
In Progress
Development

Successfully merging a pull request may close this issue.

7 participants
@karianna @smlambert @lwahonen @milderhc @sxa @andrew-m-leonard and others