Skip to content

Conversation

dinogun
Copy link
Collaborator

@dinogun dinogun commented Jun 8, 2018

  • Add support for generating slim builds
    • These are generated by stripping away unnecessary files / dirs / classes / debug info / documentation.
    • See the file slim-java.sh for more info all the deletions.
    • slim builds currently are about 80MB smaller than the regular/full builds and help reduce pull / push / provisioning times.
    • These builds will have to eventually pass a headless TCK test. (The slim-java.sh is based on a script that generates the ibmjava SFJ (small footprint java) docker image. More info on that can be found here).
    • In the future, the slim-java.sh file needs to be part of the openjdk-build repo and generate slim build tarballs that can go through headless TCK testing. The Docker scripts can then be modified to just pull in the tarball to create the slim images rather than build it from the full / regular tarballs as is being done in the current PR.
  • Refactor scripts
    • We now have 4 variants for each OS / Version combination viz, release / nightly builds and full / slim types for each build.
    • It is a lot more easy to have all the valid combinations in a config file and not try to hard code anything in the scripts. We now have two config files, openj9.config and hotspot.config.
    • Similarly all the tags are now abstracted into a tags.config file. This helps to generate the manifest entries a lot more easier as all we have to do now is to read the tags.config file and expand them to add in the appropriate arch entries for each VM and OS.

@dinogun
Copy link
Collaborator Author

dinogun commented Jun 8, 2018

This also fixes issue #28 and PR #25 as well.

@dinogun dinogun changed the title WIP: Add support for slim builds and refactor scripts to have config files. Add support for slim builds and refactor scripts to have config files. Jun 18, 2018
Copy link
Member

@karianna karianna left a comment

Choose a reason for hiding this comment

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

Some nitpicks

build_latest.sh Outdated
#adoptopenjdk/openjdk${version}-openj9:${arch}-${os}-${rel}-nightly
for os in ${oses}
#adoptopenjdk/openjdk${version}-openj9:${arch}-${os}-${rel}-nightly-slim
for vm in ${avail_jvms}
Copy link
Member

Choose a reason for hiding this comment

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

Can we extract more logic to functions?

rtags=$(echo ${rawtags} | sed "s/{{ JDK_${build}_VER }}/${rel}/gI; s/{{ OS }}/${os}/gI;");
echo ${rtags} | sed "s/{{ *ARCH *}}/{{ARCH}}/" |
# Separate the arch and the generic alias tags
awk '{ a=0; n=0;
Copy link
Member

Choose a reason for hiding this comment

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

whitespace

srepo=${srepo}-${vm}
fi
echo "done"
for typ in ${types}
Copy link
Member

Choose a reason for hiding this comment

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

type to type :-)

@@ -0,0 +1,43 @@

Copy link
Member

Choose a reason for hiding this comment

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

license header

@@ -0,0 +1,33 @@

Copy link
Member

Choose a reason for hiding this comment

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

license header

slim-java.sh Outdated
fi
}

# We only support 64 bit builds now
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to extract stuff into functions (from here down)

slim-java.sh Outdated
# 1.1. Parse arguments
argc=$#
if [ ${argc} != 1 ]; then
echo " Usage: `basename $0` IBM-full-JRE-path"
Copy link
Member

Choose a reason for hiding this comment

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

IBM?

slim-java.sh Outdated
pushd ${root}/rt_class >/dev/null
jar -xf ${root}/jre/lib/rt.jar
mkdir -p ${root}/rt_remaining_class
remainingClasses='com/sun/java/swing/plaf/motif/MotifLookAndFeel
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth extracting these long lists to another import file

@dinogun
Copy link
Collaborator Author

dinogun commented Jun 27, 2018

@karianna Thanks for the review ! Have refactored the scripts to incorporate your comments, please take a look, Thanks

@karianna karianna merged commit 1c5eb86 into AdoptOpenJDK:master Jun 27, 2018
@dinogun dinogun deleted the add_slim_builds branch July 19, 2018 13:47
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.

2 participants