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

HDDS-8569. Build ozone-runner with JDK 11 for arm64 #35

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

JDK 11 is not available for aarch64 from https://jdk.java.net/archive/, but we can install it from OS package. This allows building multi-arch images for Ozone releases before 1.4.0.

https://issues.apache.org/jira/browse/HDDS-8569

How was this patch tested?

workflow run: https://github.com/adoroszlai/ozone-docker-runner/actions/runs/11939244167/job/33279343409
image: https://github.com/adoroszlai/ozone-docker-runner/pkgs/container/ozone-runner/309268740?tag=9f2a72c80cfbb98b42ef002cd63b07d65f469024

Built Ozone 1.3.0 image with slightly modified Dockerfile:

$ docker build --progress plain --build-arg OZONE_RUNNER_IMAGE=ghcr.io/adoroszlai/ozone-runner --build-arg OZONE_RUNNER_VERSION=9f2a72c80cfbb98b42ef002cd63b07d65f469024 .
...
#15 writing image sha256:70e68065fcf5a71e7e49bcf7c74b7582128122e2eccbc6778f749002b04c8c26 done

$ docker run -it --rm 70e68065fcf5a71e7e49bcf7c74b7582128122e2eccbc6778f749002b04c8c26 ozone version
...
              /    1.3.0(Grand Canyon)
...

$ docker run -it --rm 70e68065fcf5a71e7e49bcf7c74b7582128122e2eccbc6778f749002b04c8c26 java -version
openjdk version "11.0.25" 2024-10-15 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS, mixed mode, sharing)

@adoroszlai adoroszlai self-assigned this Nov 20, 2024
@adoroszlai adoroszlai requested a review from smengcl November 20, 2024 19:20
Copy link
Contributor

@smengcl smengcl left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch.

I have verified that the resulting runner image is working on my ARM Mac:

$ docker run --rm -it ghcr.io/adoroszlai/ozone-runner:9f2a72c80cfbb98b42ef002cd63b07d65f469024 /bin/bash
...
To use Ozone please mount ozone folder to /opt/hadoop
[hadoop@0c7d769f6465 ~]$ arch
aarch64
[hadoop@0c7d769f6465 ~]$ java --version
openjdk 11.0.25 2024-10-15 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS, mixed mode, sharing)

@smengcl
Copy link
Contributor

smengcl commented Nov 20, 2024

Also verified that ozone 1.4.0 image built from this runner image works on ARM Mac:

$ git clone https://github.com/apache/ozone-docker && cd ozone-docker
$ git checkout ozone-1.4.0-rocky
# Change first line of Dockerfile into
# FROM ghcr.io/adoroszlai/ozone-runner:9f2a72c80cfbb98b42ef002cd63b07d65f469024

$ docker build --progress plain .
...
#15 writing image sha256:67da5d17b9996bfc9b5536a4c113f510ae97d356de42e646964b65b835e5ffb2 done
#15 DONE 0.8s
...
$ docker run --rm -it 67da5d17b9996bfc9b5536a4c113f510ae97d356de42e646964b65b835e5ffb2 /bin/bash
bash-5.1$ arch
aarch64
bash-5.1$ java -version
openjdk version "11.0.25" 2024-10-15 LTS
OpenJDK Runtime Environment (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-11.0.25.0.9-1) (build 11.0.25+9-LTS, mixed mode, sharing)
bash-5.1$ ozone version
...
              /    1.4.0(Hot Springs)

Source code repository https://github.com/apache/ozone.git -r e4b6007c8e9f79d1432cf6f128d6f83e733f8e9b
Compiled by ozone on 2024-01-10T15:32Z
...
bash-5.1$ readlink -f $(which java)
/usr/lib/jvm/java-11-openjdk-11.0.25.0.9-3.el9.aarch64/bin/java

@adoroszlai adoroszlai merged commit 0b0afa1 into apache:jdk11 Nov 21, 2024
1 check passed
@adoroszlai
Copy link
Contributor Author

Thanks @smengcl for reviewing and testing this.

@adoroszlai adoroszlai deleted the HDDS-8569-jdk11 branch November 21, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants