Skip to content

Setting up new build jobs, mirrors,... when a new openjdk version is branched from jdk(head)

Stewart X Addison edited this page Apr 5, 2024 · 38 revisions

When and why?

Scenario 1 (non-u repository)

When a new jdk release is created upstream eg.jdk-21, a new upstream repo is branch from jdk(head), so https://github.com/openjdk/jdk21. We then mirror this new repository to https://github.com/adoptium/jdk21.

Scenario 2 (u repository)

Once shipped upstream moves to development of updates for the following .0.N updates, this is done in a new repro https://github.com/openjdk/jdk19u, known as the "updates" repo. We need to create a new mirror for this "updates" repo after the initial release has been shipped.

Prerequistes:

Create the new adoptium mirror

  1. Create the new mirror jdkNN repository using otterdog: https://github.com/adoptium/.eclipsefdn Create a new PR for file https://github.com/adoptium/.eclipsefdn/blob/main/otterdog/adoptium.jsonnet and add a definition like this is we're add a u repository:
 newMirrorRepo('jdkNNu') {},

Or for a non-u repository:

 newMirrorRepo('jdkNN') {},

You can also use the same otterdog PR to create the new binaries repository in the second case - see the example piece of code later in the file.

  1. Once the new repository has been created, populate it with a mirror of either the upstream openjdk repository (non-u release) or the existing adoptium one (u release):
git clone --mirror [email protected]:openjdk/jdkNN[u].git
cd jdkNN[u].git
git push --mirror [email protected]:adoptium/jdkNN[u].git

or

git clone --bare https://github.com/adoptium/jdkNN
cd jdkNN.git
git push --mirror [email protected]:adoptium/jdkNNu.git

Ignore any errors attempting to push to branch "main". Verify repository populated successfully with branch "master".

  1. Delete any upstream "pr/nn" branches (There typically shouldn't be any for a new u release as we will have removed them in the non-u mirror_.

  2. For a non-u release: Clone the new adoptium repo:

git clone [email protected]:adoptium/jdkNN[u].git
  1. For a non-u release: Create the "dev" branch with necessary patches:
git checkout -b dev origin/master

Apply "Adoptium" patches, "Files changed" => https://github.com/adoptium/jdk/compare/master...dev

Commit changes and push:

git push origin dev
  1. For a non-u release, create the "release" branch with necessary patches:
git checkout -b release origin/master

Apply "Adoptium" patches, "Files changed" => https://github.com/adoptium/jdk/compare/master...release. This should include, as a minimum, the mandatory README.JAVASE file.

Commit changes and push:

git push origin release
  1. Create the skara mirror job:
bash ./skaraMirror.sh jdkNN[u]

This can also be done manually by running the script after cloning https://github.com/adoptium/mirror-scripts

  1. Build the new git-skara-jdkNN[u] job. It should now mirror any new upstream openjdk commits to master, merge with dev, and create the release branch. Verify the job completes successfully and the repository content looks correct.

  2. If "main" branch was auto-created as "default" branch: Raise an Eclipse Help Desk issue to change the "default" branch to "master", and to delete the "main" branch.

For a non-u release, ensure the temurinNN-binaries repository is created

  1. Does https://github.com/adoptium/temurinNN-binaries exist (You may have created one in the same PR when you created the source code mirror)
  2. If not create using "otterdog": https://github.com/adoptium/.eclipsefdn Create a new PR for file https://github.com/adoptium/.eclipsefdn/blob/main/otterdog/adoptium.jsonnet and add a definition like:
    orgs.newRepo('temurin21-binaries') {
      allow_merge_commit: true,
      allow_update_branch: false,
      delete_branch_on_merge: false,
      dependabot_security_updates_enabled: true,
      description: "Temurin 21 binaries",
      has_issues: false,
      web_commit_signoff_required: false,
    },
  1. Create README.md based on https://github.com/adoptium/temurin17-binaries/README.md

If jdk(head) has forked to next jdk version (a non-u release) generate new jdk(head) build jobs

  1. Create the new jdkNN head pipeline config, eg:https://github.com/adoptium/ci-jenkins-pipelines/pull/720
  2. Update JAVA_VERSION in build job generator https://ci.adoptium.net/job/build-scripts/job/utils/job/pipeline_jobs_generator_jdk/ to the new jdk version
  3. Run the updated pipeline_jobs_generator
  4. Repeat for the evaluation_pipeline_jobs_generator as well.
  5. Repeat for the release_pipeline_jobs_generator as well.

Create pipeline_jobs_generator_jdkNN[u] job and configuration

  1. Create the pipeline job configuration: https://github.com/adoptium/ci-jenkins-pipelines/tree/master/pipelines/jobs/configurations , using the previous version file contents as a basis:
  • Create jdkNN.groovy
  • Create jdkNN_pipeline_config.groovy
  • Create PR and merge
  1. Duplicate an existing job: https://ci.adoptopenjdk.net/job/build-scripts/job/utils/job/pipeline_jobs_generator_jdk17u/ and name pipeline_jobs_generator_jdkNN
  2. Change JAVA_VERSION parameter to "jdkNN"
  3. Build the pipeline_jobs_generator_jdkNN job, and ensure the new pipeline build jobs are created: https://ci.adoptopenjdk.net/job/build-scripts/job/jobs/
  4. Repeat for the evaluation_ and release_ pipeline_jobs_generators as well.

Run a test pipeline build

  1. Build the newly generate pipeline job : https://ci.adoptopenjdk.net/job/build-scripts/job/openjdkNN-pipeline/
  2. Verify all build successfully

Update refactor_openjdk_release_tool to support jdk new head version

  1. Go to Configure for job https://ci.adoptopenjdk.net/job/build-scripts/job/release/job/refactor_openjdk_release_tool/ and add the new jdk head to the VERSION choices parameter

Update daily Slack status job with new jdkNN status

  1. Go to Configure for job https://ci.adoptium.net/view/Tooling/job/nightlyBuildAndTestStats_temurin/configure
  2. Add "jdkNN" to FEATURE_RELEASES
  3. Update TIP_RELEASE with new "head" version

Create or update release trigger jobs

If we have created a mirror for a new major release, it will need a release trigger job to be able to detect and build new tags, which we build and ship early access builds from.

The jobs which run these builds are in the utils folder on jenkins and are named releaseTrigger_XXea.

  • If you are transitioning from a non=u to a u repository, then you can simply update the MIRROR_REPO reference in the job to the jdkNN repository to jdkNNu. The binaries repository will be unchanged.
  • If you are creating a new major non-u version, then you should create a copy of the old releaseTrigger jobs with the new version number, and then update all references to the old version to the new one, including the temurin-binariesNN repository.