Skip to content

Commit

Permalink
Merge branch 'nchammas:master' into amazon_linux_2023_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pragnesh authored Sep 18, 2023
2 parents b43c72b + 01f8ef9 commit 7f447e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions flintrock/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="""
Expand All @@ -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/
"""
)

Expand Down
8 changes: 8 additions & 0 deletions flintrock/scripts/adoptium.repo
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions flintrock/scripts/adoptopenjdk.repo

This file was deleted.

0 comments on commit 7f447e3

Please sign in to comment.