Skip to content

Add support for ARM64 architecture #2

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

Merged
merged 1 commit into from
Sep 13, 2018
Merged

Conversation

odidev
Copy link
Contributor

@odidev odidev commented Aug 24, 2018

Silverpeas is building and running fine on arm64v8 architecture as well.
The only issue was due to the hard-coded JAVA_HOME environment variable.

Once this is fixed, silverpeas is good to run on multiple platforms.

Regards,

@mmoqui
Copy link
Member

mmoqui commented Sep 3, 2018

What is wrong in the PR:

  • the change isn't restricted to only the ARM64 or AMD64 architecture: no control on the supported architecture.
  • the Docker image for ARM64 architecture can only be built onto an ARM64 machine (as the targeted architecture is detected during the build)
  • the change is done directly into the Dockerfile instead of the Dockerfile.template from which the Dockerfile is generated with the generate-dockerfile.sh script.

@odidev
Copy link
Contributor Author

odidev commented Sep 3, 2018

Hi @mmoqui
Thanks for providing your time to review the PR.

Can you please guide, what can be the best way to add support for arm64 for silverpeas.
Will modification in Dockerfile.template be sufficient enough?

Regards,

@odidev
Copy link
Contributor Author

odidev commented Sep 4, 2018

Hi @mmoqui

  • Regarding no control on the supported architecture
    I think supported architecture will be shown on the Docker Official library page of Silverpeas, which will just show support for amd64 & arm64v8 architectures.
    This will inform everyone that SilverPeas is supporting just mentioned architectures, so if someone tries to build it over other architectures then it will be his own responsibility.
  • Regarding targeted architecture is detected during the build
    In my view, this is what is happening for all multi-architecture supported docker modules.
    Detect the architecture at runtime, if it is suppported then proceed ahead otherwise return a failure.

Regards,

@odidev
Copy link
Contributor Author

odidev commented Sep 4, 2018

Updated this PR with the suggestions provided above.

The user needs to run below command to generate a new dockerfile

  • For arm64 architecture
    $generate-dockerfile.sh 6.0.1 10.1.0 arm64

  • For amd64 architecture
    $generate-dockerfile.sh 6.0.1 10.1.0 amd64

The above commands will generate Dockerfile for either AMD64 or ARM64 based on architecture provided in generate-dockerfile.sh

Regards,

@@ -61,7 +61,7 @@ ENV LC_ALL ${DEFAULT_LOCALE}
#

# Set up environment variables for Silverpeas
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-TARGET_ARCH
Copy link

Choose a reason for hiding this comment

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

Having a separate Dockerfile per architecture just for changing one environment variable is not going to be acceptable for the official images.

See https://github.com/docker-library/openjdk/blob/ecb81629f5d5f226491e9f3e0a5be11662f72870/11/jdk/Dockerfile#L28-L40 for the approach we took over in the openjdk official images which might be acceptable to the maintainers here?

@odidev
Copy link
Contributor Author

odidev commented Sep 6, 2018

Hi @tianon ,

Thanks for reviewing the changes and providing the solution too 😄
I also agree with your concern regarding maintaining multiple Dockerfiles just for the sake of an environment variable with architecture specific path.

I will surely get back with updated PR, with the architecture check at runtime.

Regards,

JAVA_HOME variable has been made generic so as to support Silverpeas
on multiple platforms.
This feature is validated only on amd64 & arm64.

Signed-off-by: Odidev <odidev@puresoftware.com>
@odidev
Copy link
Contributor Author

odidev commented Sep 6, 2018

Hi @tianon

I have updated this PR with your suggested changes.
The changes are working very well on both amd64 and arm64 architectures.

BTW, thanks again for your suggestion 😄

Regards,

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.

3 participants