Skip to content

Commit

Permalink
Use JDK-Head version number instead of 'jdk'
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Davies <morgan.davies@ibm.com>
  • Loading branch information
Morgan Davies committed May 21, 2020
1 parent 02649fc commit 0e1f298
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 deletions.
11 changes: 4 additions & 7 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,19 +169,16 @@ JDK_FIX_VERSION=0
- Eventually after rampdown and final phase testing the GA build is tagged and released, e.g. the `jdk-13-ga` code level is tagged along side the actual release build tag.
- When a new release occurs, we must also update one of our job generators to match the new jdk versions and remove old STR that are no longer needed. The full details on what these are in https://github.com/AdoptOpenJDK/openjdk-build/blob/master/pipelines/build/regeneration/README.md but for a quick run down on how to update them when we want to build a new release, follow the steps below:

1. Update the Job Folder - https://ci.adoptopenjdk.net/job/build-scripts/job/utils/: The jobs themselves you are looking for are called `pipeline_jobs_generator_jdkxx` (`pipeline_jobs_generator_jdk` for HEAD).
1. Update the Job Folder - https://ci.adoptopenjdk.net/job/build-scripts/job/utils/: The jobs themselves you are looking for are called `pipeline_jobs_generator_jdkxx`.
* If you are ADDING a JDK version:
- Create a New Item in the folder linked above that copies the `pipeline_jobs_generator_jdk` job. Call it `pipeline_jobs_generator_jdk<new-version-number>`.
- Create a New Item in the folder linked above that copies a `pipeline_jobs_generator_jdk` job. Rename it to `pipeline_jobs_generator_jdk<new-version-number>`.
- Change the `Script Path` setting of the new job to `pipelines/build/regeneration/jdk<new-version-number>_regeneration_pipeline.groovy`. Don't worry if this currently doesn't exist in this repo, you'll add it in step 3.
- Update the `Script Path` setting of the JDK-HEAD job (`pipeline_jobs_generator_jdk`) to whatever the new JDK HEAD is. I.e. if the new head is JDK16, change `Script Path` to `pipelines/build/regeneration/jdk16_regeneration_pipeline.groovy`
* If you are REMOVING a JDK version:
- Delete the job `pipeline_jobs_generator_jdk<version-you-want-to-delete>`
2. Create the new build configurations for the release - https://github.com/AdoptOpenJDK/openjdk-build/tree/master/pipelines/jobs/configurations: Create a new `jdk<new-version-number>_pipeline_config.groovy` file with the desired `buildConfigurations` for the new pipeline. 99% of the time, copy and pasting the configs from the previous version ios acceptable. Ensure that the classname and instance of it is changed to `Config<new-version-number>`. Don't remove any old version configs.
3. Create a new Regeneration Pipeline for the downstream jobs - https://github.com/AdoptOpenJDK/openjdk-build/tree/master/pipelines/build/regeneration: Create a new `jdk<new-version-number>_regeneration_pipeline.groovy`. Ensure that the `javaVersion` and `buildConfigurations` variables are what they should be for the new version. Don't remove any old version configs. While you're here, make sure all of the current releases have a `regeneration_pipeline.groovy` file (including head). If they don't, create one using the same technique as above.
3. Create a new Regeneration Pipeline for the downstream jobs - https://github.com/AdoptOpenJDK/openjdk-build/tree/master/pipelines/build/regeneration: Create a new `jdk<new-version-number>_regeneration_pipeline.groovy`. Ensure that the `javaVersion` and `buildConfigurations` variables are what they should be for the new version. Don't remove any old version configs. While you're here, make sure all of the current releases have a `regeneration_pipeline.groovy` file (including HEAD). If they don't, create one using the same technique as above.
*If we want to build `freebsd`, do this next step. Otherwise, skip it*
4. Update the config_regeneration base file - https://github.com/AdoptOpenJDK/openjdk-build/blob/master/pipelines/build/common/config_regeneration.groovy: Update the following lines
- https://github.com/AdoptOpenJDK/openjdk-build/blob/2041d51db738b741f2a630bc803ca1f038ef62b2/pipelines/build/common/config_regeneration.groovy#L359 (`javaVersion` in `context.stage("Regenerate $javaVersion pipeline jobs")`). Update the jdkxx part of `javaVersion == "jdkxx"` to match the new jdk head version number.

*If we want to build `freebsd`, do these next two line changes. Otherwise, you can ignore them:*
- https://github.com/AdoptOpenJDK/openjdk-build/blob/2041d51db738b741f2a630bc803ca1f038ef62b2/pipelines/build/common/config_regeneration.groovy#L389 (`if (buildConfigurationKey == "freebsd") { continue }`). Remove this line.
- https://github.com/AdoptOpenJDK/openjdk-build/blob/2041d51db738b741f2a630bc803ca1f038ef62b2/pipelines/build/common/config_regeneration.groovy#L234 (output warning that `freebsd` wont be regenerated). Remove this `if` statement.
5. Build the `pipeline_jobs_generator` that you just made. Ensure the equivalant `openjdkxx_pipeline` to the generator exists or this will fail. If the job fails or is unstable, search the console log for `WARNING` or `ERROR` messages for why. Once it has completed successfully, the [pipeline](https://ci.adoptopenjdk.net/job/build-scripts/) is ready to go!
Expand Down
3 changes: 1 addition & 2 deletions build-farm/make-adopt-build-farm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ JAVA_FEATURE_VERSION=$(echo "${JAVA_TO_BUILD}" | tr -d "[:alpha:]")

if [ -z "${JAVA_FEATURE_VERSION}" ]
then
# THIS NEEDS TO BE UPDATED WHEN HEAD UPDATES (the latest tag that jdk/jdk contains)
JAVA_FEATURE_VERSION=15
echo "ERROR: JAVA_FEATURE_VERSION not found."
fi

echo "BUILD TYPE: "
Expand Down
5 changes: 1 addition & 4 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,10 @@ class Builder implements Serializable {
}

Integer getJavaVersionNumber() {
// version should be something like "jdk8u" or "jdk" for HEAD
// version should be something like "jdk8u"
Matcher matcher = javaToBuild =~ /.*?(?<version>\d+).*?/
if (matcher.matches()) {
return Integer.parseInt(matcher.group('version'))
} else if ("jdk".equalsIgnoreCase(javaToBuild.trim())) {
// This needs to get updated when JDK HEAD version updates
return Integer.valueOf("15")
} else {
context.error("Failed to read java version '${javaToBuild}'")
throw new Exception()
Expand Down
2 changes: 1 addition & 1 deletion pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class Regeneration implements Serializable {
def folders = queryJenkinsAPI("https://ci.adoptopenjdk.net/job/build-scripts/job/jobs/api/json?tree=jobs[name]&pretty=true&depth=1")

folders.jobs.name.each { folder ->
if ((folder == "jdk" && javaVersion == "jdk15") || folder.contains(javaVersion)) {
if (folder.contains(javaVersion)) {
def jobs = [] // clean out array each time to avoid duplication

// i.e. jdk8u-linux-x64-hotspot, jdk8u-mac-x64-openj9, etc.
Expand Down
5 changes: 1 addition & 4 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,10 @@ class Build {

Integer getJavaVersionNumber() {
def javaToBuild = buildConfig.JAVA_TO_BUILD
// version should be something like "jdk8u" or "jdk" for HEAD
// version should be something like "jdk8u"
Matcher matcher = javaToBuild =~ /.*?(?<version>\d+).*?/
if (matcher.matches()) {
return Integer.parseInt(matcher.group('version'))
} else if ("jdk".equalsIgnoreCase(javaToBuild.trim())) {
// This needs to get updated when JDK HEAD version updates
return Integer.valueOf("15")
} else {
context.error("Failed to read java version '${javaToBuild}'")
throw new Exception()
Expand Down
2 changes: 1 addition & 1 deletion pipelines/build/openjdk15_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

def javaToBuild = "jdk"
def javaToBuild = "jdk15u"

node ("master") {
def scmVars = checkout scm
Expand Down
2 changes: 1 addition & 1 deletion sbin/common/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export JDK11_VERSION="jdk11u";
export JDK12_VERSION="jdk12u";
export JDK13_VERSION="jdk13u";
export JDK14_VERSION="jdk14u";
export JDKHEAD_VERSION="jdk";
export JDKHEAD_VERSION="jdk15u";

export JDK8_CORE_VERSION="jdk8";
export JDK9_CORE_VERSION="jdk9";
Expand Down

0 comments on commit 0e1f298

Please sign in to comment.