diff --git a/CHANGES.md b/CHANGES.md index a89cf97f..d6032dda 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,8 +7,10 @@ ### Changed * [#348]: Bumped default Spark to 3.2; dropped support for Python 3.6; added CI build for Python 3.10. +* [#361]: Migrated from AdoptOpenJDK, which is deprecated, to Adoptium Open JDK. [#348]: https://github.com/nchammas/flintrock/pull/348 +[#361]: https://github.com/nchammas/flintrock/pull/361 ## [2.0.0] - 2021-06-10 diff --git a/flintrock/core.py b/flintrock/core.py index 454806ac..e60303b5 100644 --- a/flintrock/core.py +++ b/flintrock/core.py @@ -573,15 +573,15 @@ def ensure_java(client: paramiko.client.SSHClient, java_version: int): if installed_java_version and installed_java_version < java_version: logger.info(""" - Existing Java {j} will be upgraded to AdoptOpenJDK {java_version} + Existing Java {j} will be upgraded to Adoptium OpenJDK {java_version} """.format(j=installed_java_version, java_version=java_version)) - # We will install AdoptOpenJDK because it gives us access to Java 8 through 15 + # We will install Adoptium OpenJDK because it gives us access to Java 8 through 15 # Right now, Amazon Extras only provides Corretto Java 8, 11 and 15 - logger.info("[{h}] Installing AdoptOpenJDK Java {j}...".format(h=host, j=java_version)) + logger.info("[{h}] Installing Adoptium OpenJDK Java {j}...".format(h=host, j=java_version)) - install_adoptopenjdk_repo(client) - java_package = "adoptopenjdk-{j}-hotspot".format(j=java_version) + install_adoptium_repo(client) + java_package = "temurin-{j}-jdk".format(j=java_version) ssh_check_output( client=client, command=""" @@ -600,19 +600,19 @@ def ensure_java(client: paramiko.client.SSHClient, java_version: int): """.format(jp=java_package)) -def install_adoptopenjdk_repo(client): +def install_adoptium_repo(client): """ - Installs the adoptopenjdk.repo file into /etc/yum.repos.d/ + Installs the adoptium.repo file into /etc/yum.repos.d/ """ with client.open_sftp() as sftp: sftp.put( - localpath=os.path.join(SCRIPTS_DIR, 'adoptopenjdk.repo'), - remotepath='/tmp/adoptopenjdk.repo') + localpath=os.path.join(SCRIPTS_DIR, 'adoptium.repo'), + remotepath='/tmp/adoptium.repo') ssh_check_output( client=client, command=""" # Use sudo to install the repo file - sudo mv /tmp/adoptopenjdk.repo /etc/yum.repos.d/ + sudo mv /tmp/adoptium.repo /etc/yum.repos.d/ """ ) diff --git a/flintrock/scripts/adoptium.repo b/flintrock/scripts/adoptium.repo new file mode 100644 index 00000000..4f525d4c --- /dev/null +++ b/flintrock/scripts/adoptium.repo @@ -0,0 +1,8 @@ +# Source: https://adoptium.net/installation/linux/#_centosrhelfedora_instructions + +[Adoptium] +name=Adoptium +baseurl=https://packages.adoptium.net/artifactory/rpm/amazonlinux/$releasever/$basearch +enabled=1 +gpgcheck=1 +gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public diff --git a/flintrock/scripts/adoptopenjdk.repo b/flintrock/scripts/adoptopenjdk.repo deleted file mode 100644 index 7773e1f7..00000000 --- a/flintrock/scripts/adoptopenjdk.repo +++ /dev/null @@ -1,6 +0,0 @@ -[AdoptOpenJDK] -name=AdoptOpenJDK -baseurl=http://adoptopenjdk.jfrog.io/adoptopenjdk/rpm/centos/8/$basearch -enabled=1 -gpgcheck=1 -gpgkey=https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public