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

unixPB: Alter adoptopenjdk_install role to allow for jdk8 #1138

Merged
merged 2 commits into from
Feb 24, 2020

Conversation

Willsparker
Copy link
Contributor

Based off the adoptopenjdk_install role. I did this as it seems there's a lot of discrepancy between the linux distributions about whether openjdk8 is available using their specific package manager. If there is, they can end up in different directories, with different names.

With this role, we can ensure all distros have a version of JDK8, and they are in a standardised place with a standardised name. This can also mitigate any issues when trying to build JDK8 without the package managers having JDK7 available.

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Feb 12, 2020

@Willsparker The role successfully installs openjdk8 when there isn't one available in /usr/lib/jvm, but it also installs if it is already present. For example, java-1.8.0-openjdk-1.8.0.242.b07-1.el6_10.x86_64 was already in /usr/lib/jvm, and yet the playbook downloaded and installed jdk8u242-b08 into that directory.

This was tested on x86_64

@sxa
Copy link
Member

sxa commented Feb 12, 2020

What is this doing that requires a separate role from adoptopenjdk_install that means we need a new role? Also I'm not sure this quite helps is put it in a "standardised place" as it's subject to whatever the latest release is at the time of the playbook execution, so we still have to specify the location in the jenkins configuration

@Willsparker
Copy link
Contributor Author

I initially attempted to add it to the adoptopenjdk_install role, but due to the naming scheme jdk8u... as opposed to jdk-XX..., there would have the be a duplication of the Checking if it's installed and Get full path name tasks - one for when jdk_version == 8 and one for when jdk_version != 8.
This also caused some issues in conditionals - for example, the initial Check if it's installed tasks assigned a variable adoptopenjdk_installed. If the JDK8 specific version of the task following it is skipped, for example, then that variable becomes undefined, and will fail for install latest release tasks. Therefore it can only succeed for one of jdk_version == 8 and jdk_version != 8 (depending on the way round you assign the variable)
If we assign a different variable to that i.e. adoptopenjdk8_installed and then put the conditional when (adoptopenjdk8_installed.rc != 0) or (adoptopenjdk_installed.rc != 0)onto the install task then one of those will be undefined and will error.

At that point, there'd need to be JDK8 specific version of the task for every task in the adoptopenjdk_install role - therefore we should just create a separate role.

@Willsparker
Copy link
Contributor Author

@Willsparker The role successfully installs openjdk8 when there isn't one available in /usr/lib/jvm, but it also installs if it is already present. For example, java-1.8.0-openjdk-1.8.0.242.b07-1.el6_10.x86_64 was already in /usr/lib/jvm, and yet the playbook downloaded and installed jdk8u242-b08 into that directory.

This was tested on x86_64

The first one you mentioned java-1.8.0-openjdk ... will have been installed on the machine via the package manager (i.e. apt install java-1.8.0-openjdk or yum install openjdk-8-jdk) which is fine to have in addition to the adoptopenjdk one. The reason I want to add this role is because some distributions of linux wont necessarily be able to install any version of openjdk8 / java8 using their package manager

@gdams
Copy link
Member

gdams commented Feb 12, 2020

@Willsparker I think I'm right in saying that this will run on macOS which you probably want to skip as we use homebrew. Also you should be able to expand the architecture variable inn the URL rather than having a single task for each architecture

@Willsparker
Copy link
Contributor Author

@gdams Good point ... I'll add those conditions. And I'll do some testing with the architecture variable, but agreed, that'd be a much cleaner way to do it :-)

@Willsparker
Copy link
Contributor Author

Running through it with the vagrantPlaybookCheck job : https://ci.adoptopenjdk.net/job/VagrantPlaybookCheck/358/

@sxa
Copy link
Member

sxa commented Feb 20, 2020

Ref the reasons above for having the role separate, can I propose modifying adoptopenjdk_install to have a check at the top to set a jdk_path variable based on whether jdk_version is equal to 8, and set it differently if it is not later than (not equal would also work) to 8. Using this new jdk_path variable instead of /usr/lib/jvm/jdk-{{ jdk_version }} would resolve the above concerns I believe.

@sxa
Copy link
Member

sxa commented Feb 21, 2020

Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

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

Can you rename your commits (and this PR) now that we are no longer creating a separate role for JDK8 please?

@Willsparker Willsparker changed the title unixPB: Add role to install AdoptOpenJDK8 unixPB: Alter adoptopenjdk_install role to allow for jdk8 Feb 24, 2020
@sxa sxa merged commit 72d11ee into adoptium:master Feb 24, 2020
gdams added a commit to gdams/openjdk-infrastructure that referenced this pull request Feb 26, 2020
* add first set of perf machines (adoptium#1038)

* Fixed X11 Install from AIX Ansible Playbook (adoptium#969)

* Added X11.vfb to AIX playbook

* Adding XLC16 to aix playbook as its a requirement for JDK13 (adoptium#773)


Signed-off-by: Joe deKoning <joe_dekoning@ca.ibm.com>

* pbTests: Don't specify URL when git pulling (adoptium#1035)

* pbTests: Don't specify URL when git pulling (adoptium#1035)

* winPB: Change Git version to latest; use win_shell module (adoptium#1039)

* UnixPB: Added retries to roles that often fail (adoptium#1011)

* pbTests: Update testJDK.sh (adoptium#1040)

* UnixPB: Changes so PB runs on Raspbian Buster (adoptium#1036)

* pbTests: Find correct JDK versions for different OSs (adoptium#1034)

Check and set correct Java_8 for CentOS And Ubuntu

* pbTests: Refactor and clean-workspace option (adoptium#1030)

* pbTests: Refactor and clean-workspace option

* pbTests: Clean up checkLogFiles function

* pbTests: Removal of -b option in the build and test commands

* pbTests: Fixed pbFailed var assignment (adoptium#1046)

* Passed the value of hosts from command line (adoptium#1017)

- The variable groups['Vendor_groups']
is skipped due to lack of definition when we
run AdoptOpenJDK Unix Playbook internally

- Replaced it with a command line variable
and set the value to all or a specific group

[skip ci]

Signed-off-by: Jenny Chen <Jenny.Chen@ibm.com>

* pbTests: Altered Windows Scripts to build and test (adoptium#1053)

* UnixPB: Debian Fixes + trailing space fix (adoptium#1052)

* UnixPB: Fixed incorrectly named modules

* Unix: Add Deb8 IP config for ansible, fix trailing space

* pbTests: Put vagrant reload in the right place (adoptium#1055)

* add missing swap_file tag (adoptium#1054)

* add additional aarch64 test machines (adoptium#1050)

* add additional aarch64 test machines

* add missing deps

* WinPB: Fix the Git installation for Windows (adoptium#1047)

* WinPB: Create Git properties file and use for installation

* WinPB: Set autocrlf to false in Cygwin Git

* UnixPB: Add checksums to all `get_url` modules (adoptium#1051)

* UnixPB: 1st Group of Checksums

* UnixPB: 2nd Group of Checksums

* Fix earlier swap_file tag indentation (adoptium#1057)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* WinPB: Added Checksums to win_get_url modules (adoptium#1058)

* pbTests: Renamed testScript.sh (adoptium#1060)

* Allow Debian8 as an option to vmDestroy.sh (adoptium#1064)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* PbTests: Updated READMEs relevant to the Test Scripts (adoptium#993)

* Redraft and update ansible README.md (Phase 1!) (adoptium#1063)

* PbTests: Updated READMEs relevant to the Test Scripts

* Refactor and update ansible README.md

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

Co-authored-by: William Parker <52783864+Willsparker@users.noreply.github.com>

* Made Deb8 VF find IP correctly (adoptium#1065)

* Made Deb8 VF find IP correctly

* Change Deb8 box

* ansible: Add adoptopenjdk8 repository to Debian (adoptium#1068)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTestScripts: Add Debian8 reference and link to VagrantPlaybookCheck job (adoptium#1069)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* UnixPB: Update playbook to allow SLES12 to work (adoptium#1062)

* VFs: Add FreeBSD12 and SLES12 Vagrantfiles (adoptium#1073)

* VFs: Add FreeBSD12 VF

* pbTest: Update vmDestroy.sh to include FBSD12

* VFs: Add SLES12 VF & Add to vmDestroy.sh

* Use vagrantfiles from main repo by default, option to take from the alternate branch (adoptium#1070)

* Don't use vagrant files from the branch under test

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTestScripts: Add option to use Vagrant files from the new branch

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* Fixup last commit which had wrong main Vagrantfile path (adoptium#1076)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* UnixPB: Remove 'group' tag from adoptopenjdk_install role (adoptium#1078)

* UnixPB: Make changes so FreeBSD works (adoptium#1077)

* pbTest: Run extended.system tests on Windows (adoptium#1079)

* Update Marist zlinux inventory to the new z15 linux machines (adoptium#1041)

* Add AIX71SP5TL5 machine for AIX JDK13+ builds

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* inventory: Replace Marist machines with new z15 versions

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: Fix 'checkVagrantOS' error message (adoptium#1080)

* ansible: Switch adoptopenjdk downloads to APIv3 from APIv2 (adoptium#1074)

* pbTests: add optional extra skip tags to speed up testing (adoptium#1082)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: ensure in correct directory to vagrant halt (adoptium#1089)

* Add initial openjdk-infrastructure FAQ (adoptium#1066)

* Add initial openjdk-infrastructure FAQ.md

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* typo fix

* jenkins_user tag, instead of jenkins

The Jenkins roles in the Unix playbook are tagged with "jenkins_user", not "jenkins" (if it's these roles you were going for)

Co-authored-by: George Adams <george.adams@microsoft.com>
Co-authored-by: Haroon Khel <34969545+Haroon-Khel@users.noreply.github.com>

* UnixPB: Fixes for FreeBSD12 (adoptium#1083)

* UnixPB: Set vars for if undefined and remove unneeded tasks (adoptium#1092)

* unixPB: Enable protobuf for OpenJ9 JITserver (adoptium#1094)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: Update buildJDK.sh to support FreeBSD & openSUSE (adoptium#1095)

* pbTests: Update buildJDK.sh to support FreeBSD

* pbTest: Set JAVA_HOME for FreeBSD

* pbTests: Allow for openSUSE to be built

* pbTests: Update testJDK.sh for FreeBSD

* add build-macstadium-macos1014-1 (adoptium#1107)

* Set Java 8 as Default in Alternatives for CentOS 6

Signed-off-by: Rajdeep Singh <rajdeep.singh@ibm.com>

* Upgrade protobuf to v3.7.1 (adoptium#1112)

Upgrade protobuf version from 3.5.1 to 3.7.1 and update the download
link accordingly.

Signed-off-by: Violeta Sebe <vsebe@ca.ibm.com>

* inventory: Add new AIX systems (adoptium#1109)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* Added build tags to appropriate roles (adoptium#1100)

* Added build tags to appropriate roles

* change hosts back from all

* test prereq packages for centos added

* added libcurl-devel packages

* Remove trailing spaces

* UnixPB: Add support for OpenSUSE12.3 (adoptium#1101)

* unixPB: Add support for OpenSUSE12.3

* pbTests: add SUSE12 to vmDestroy and remove SLES12 VF

* unixPB: Enable protobuf for OpenJ9 JITserver (adoptium#1094)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: Update buildJDK.sh to support FreeBSD & openSUSE (adoptium#1095)

* pbTests: Update buildJDK.sh to support FreeBSD

* pbTest: Set JAVA_HOME for FreeBSD

* pbTests: Allow for openSUSE to be built

* pbTests: Update testJDK.sh for FreeBSD

Co-authored-by: Stewart X Addison <sxa555@users.noreply.github.com>

* unixPB: Passed CC/CXX to Protobuf build task (adoptium#1114)

* winPB: Update checksums for win_get_url module (adoptium#1113)

* winPB: Put checksum into correct format for win_get_url

* winPB: Correct failing checksums

* winPB: Changed Freemarker URL

* Remove zulu-9 from Additional_Build_Tools var lists (adoptium#1116)

* Remove zulu-9 from Additional_Build_Tools var lists

* Remove tasks for adding zulu.repo

* remove azul repo (adoptium#1117)

* Set ansible_processor_vcpus for cmake role (adoptium#1110)

Ensure ansible_processor_vcpus variable is inherited by cmake role when
running tag only.

Signed-off-by: Violeta Sebe <vsebe@ca.ibm.com>

* vagrant: Temporarily use alternate openjdk-build branch (adoptium#1122)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: update testJDK.sh to not use run_configure.mk (adoptium#1123)

* pbTests: Fixup last commit (adoptium#1126)

* inventory: Add first 2 AWS Win2019 systems (adoptium#1130)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* updates to support RHEL 8 playbooks (adoptium#1129)

* unixPB: Remove duplicate protobuf install (adoptium#1102)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* remove p7zip dependency on macOS (adoptium#1137)

* More aix machines woohoo (adoptium#1115)

* inventory: Add new AIX systems

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* inventory: Add AIX machines correctly

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

*  UnixPB: Remove CPAN role (adoptium#1136)

*  UnixPB: Remove CPAN role

* Removed additional seperate packages

* VFs: Ref adoptium#685 non-zero exit status fix (adoptium#1144)

* UnixPB: Add support for SLES15-SP0 (adoptium#1140)

* UnixPB: Add support for SLES15-SP0

* Remove ntp and enable chronyd for SLES15

* winPB: Passed the value of hosts from command line (adoptium#1075)

* apply change to windows playbook as performed in adoptium#1017
* adoptium#423

Signed-off-by: Joe deKoning <joe_dekoning@ca.ibm.com>

* UnixPB: remove sudo from GIT_SOURCE role (adoptium#1147)

* ansible: Remove old gcc 7 locations for Protobuf role

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* UnixPB: Add support for CentOS8 (adoptium#1131)

* UnixPB: Add support for CentOS8

* Add CentOS8 as vmDestroy option

* win: Adjust cygwin setup checksum as it's been updated (adoptium#1149)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* pbTests: Change buildJDK to build from other URLs (adoptium#1152)

* pbTests: Change buildJDK to be able to build JDKs 8-14

* Add various options to buildJDK.sh

* Make build openj9 by default

* pbTests: Add script to test U18 on s390x/ppc64le QEMU VMs (adoptium#1119)

* pbTests: Initial commit of qemu_test_script

* Add 'fastmode' to qemu script

* PB: Add qemu to vagrant.yml

* Make ppc64le machine as pseries-2.12

* Correct expect path; Add expect to vagrant.yml

* Remove use of expect_script

* Build Qemu 4.2; Add arguments to 'ps'

* Ensure script stops if playbook fails

* Add multi-core support to the qemu VMs

* Fix syntax error

* Update port detection logic to use netstat

* Increase RAM on  qemu systems as 1Gb is mean for SMP4

* Use xz compressed base images from /qemu_base_images

* alter testJDK to accept other architectures

* changes to allow for U18 s390x to work

* Change infra repo to run playbook from

* Add back in checksum

Co-authored-by: Stewart X Addison <sxa555@users.noreply.github.com>

* pbTests: Change URLs to run the playbook from (adoptium#1156)

* UnixPB: Remove pulseaudio from Common/vars/SLES.yml (adoptium#1157)

* playbook: Update gcc-7 role to install gcc 7.5 (adoptium#1158)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* Ram increase for Vagrant VMs (adoptium#1081)

* Vagrant: 4GB of RAM, 50% CPU cap

* Vagrant: Adjust RAM down to 2.5Gb

* winPB: Change checksum for MSVS_2017 (adoptium#1162)

* unixPB: Remove repeat in SLES package list (adoptium#1161)

* unixPB: Remove checksum for gcc_7 task (adoptium#1160)

* winPB: Switch adoptopenjdk download to use APIv3 (adoptium#1167)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* unixPB: Remove devtoolset-7 and require Adopt's GCC7.5 (adoptium#1166)

Signed-off-by: Stewart Addison <sxa@uk.ibm.com>

* unixPB: Alter adoptopenjdk_install role to allow for jdk8 (adoptium#1138)

* unixPB: Alter adoptopenjdk_install to let jdk8

* Alter adoptopenjdk_install to exclude macOS

* pbTests: Added option to specify openjdk-build repo (adoptium#1170)

* add dockerfiles for aws codebuild

Co-authored-by: Pav Salimon <32314784+olvap377@users.noreply.github.com>
Co-authored-by: Joe deKoning <joe_dekoning@ca.ibm.com>
Co-authored-by: William Parker <52783864+Willsparker@users.noreply.github.com>
Co-authored-by: Jenny Chen <41126207+JennyChenyj@users.noreply.github.com>
Co-authored-by: Stewart X Addison <sxa555@users.noreply.github.com>
Co-authored-by: Haroon Khel <34969545+Haroon-Khel@users.noreply.github.com>
Co-authored-by: Rajdeep Singh <56080803+rajdeepsingh1@users.noreply.github.com>
Co-authored-by: vsebe <vsebe@ca.ibm.com>
Co-authored-by: Sej <41746002+sej-jackson@users.noreply.github.com>
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.

5 participants