Skip to content

Docker Image for Apple Silicon #894

Closed

Description

@gramian

ArcadeDB Version: v23.1.2 (build 9dbe3ce/1675373316135/main)

JDK Version: openjdk 11.0.18 2023-01-17

OS: MacOS 12.6

The docker container seems to be made for x86-64 architectures. an adapted Apple silicon (M1, M2) image should be provided for reasonable performance.

Expected behavior

Performance similar to x86

Actual behavior

Poor performance

Resources

Here is a blog post which may be of help: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/
(via orientechnologies/orientdb#9926)

Activity

  1. psytron commented on Feb 25, 2023

    @psytron
    Contributor

    potentially related: #795

  2. lvca commented on Feb 28, 2023

    @lvca
    Member

    I merged @gramian PR, but I don't see the Apple Silicon image on dockerhub: https://hub.docker.com/repository/docker/arcadedata/arcadedb/tags?page=1&ordering=last_updated.

  3. self-assigned this
    on Feb 28, 2023
  4. added this to the 23.2.1 milestone on Feb 28, 2023
  5. lvca commented on Feb 28, 2023

    @lvca
    Member

    Maybe this works better? fabric8io/docker-maven-plugin#1502

  6. gramian commented on Feb 28, 2023

    @gramian
    CollaboratorAuthor

    I tried this plugin with:

                            <groupId>org.eclipse.jkube</groupId>
                            <artifactId>kubernetes-maven-plugin</artifactId>
                            <version>${kubernetes-maven-plugin.version}</version>
                            <executions>
                                <execution>
                                    <id>default</id>
                                    <phase>package</phase>
                                    <goals>
                                        <goal>build</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <id>deploy</id>
                                    <phase>deploy</phase>
                                    <goals>
                                        <goal>push</goal>
                                    </goals>
                                </execution>
                            </executions>
                            <configuration>
                                <verbose>true</verbose>
                                <images>
                                    <image>
                                        <name>arcadedata/arcadedb</name>
                                        <build>
                                            <dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>
                                            <contextDir>${project.build.directory}/arcadedb-${project.version}.dir</contextDir>
                                            <args>
                                                <docker.buildArg.ARCH>arm64v8/,amd64/,winamd64/,arm32v7/</docker.buildArg.ARCH>
                                            </args>
                                            <tags>
                                                <tag>latest</tag>
                                                <tag>${project.version}</tag>
                                            </tags>
                                        </build>
                                    </image>
                                </images>
                            </configuration>
    

    in the package/pom.xml which fails with:

    [ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.42.0:build (default) on project arcadedb-package: Unable to build image [arcadedata/arcadedb] : "COPY failed: no source files were specified"
    

    The current maven plugin works for me locally with profile -Pdocker which produces a working docker image locally.

  7. lvca commented on Mar 1, 2023

    @lvca
    Member

    How to generate also Apple Silicon? Is there a way to generate all the versions and deploy them to DockerHub?

  8. gramian commented on Mar 1, 2023

    @gramian
    CollaboratorAuthor

    I was hoping the list of platforms in docker.buildArg.ARCH would achieve this by building an image for each list member, then Apple Si would use arm64v8. Practically, I do not know, sorry; I could only test locally.

  9. modified the milestones: 23.2.1, 23.3.1 on Mar 1, 2023
  10. adubkov commented on Mar 1, 2023

    @adubkov

    Just arm64 should work. In fact I build and running same image on both m1 pro and my local k8s setup on raspberry pi 4.
    https://hub.docker.com/r/adubkov/arcadedb/tags

    I build it with following command:

    docker buildx build --push --platform linux/arm64 -t ${IMG_NAME} .

    But you need to run some other command before use buildx it just I had it configured already.

  11. lvca commented on Mar 2, 2023

    @lvca
    Member

    Correct, running docker build buildx works. I was able to publish both amd64 and arm64 on dockerhub:

    image

    Unfortunately, the maven plugin is pretty new, I wasn't able to figure out how to make this automatic by our CI (Github actions).

  12. 2 remaining items

  13. lvca commented on Mar 20, 2023

    @lvca
    Member

    Assigning both @gramian and @robfrank to this issue. Right now I can generate Apple Silicon image by running manually a command, but the final goal is to make this automatic.

  14. gramian commented on Mar 20, 2023

    @gramian
    CollaboratorAuthor

    My current contribution is an adapted package/pom.xml and an adapted Dockerfile package/src/main/docker/Dockerfile, with which architecture dependent local image builds work, but automated deploy needs testing.

    Please note I am using a naive way of making shell calls via Maven since I could neither get the tested Docker nor Kubernetes Maven plugins to have separate build and deploy phases for images. From my point of view there are interlocking issues for each which prevent this.

    PS: I started off: https://dzone.com/articles/build-docker-image-from-maven

  15. modified the milestones: 23.3.1, 23.4.1 on Apr 5, 2023
  16. modified the milestones: 23.4.1, 23.5.1 on May 2, 2023
  17. robfrank commented on May 14, 2023

    @robfrank
    Collaborator

    I managaed to create a multiplatfrom image using the fabric8 docker maven plugin on this PR: #1070

    Let e cleanup and verify that all is working fine, than I'll move the PR out of the draft status

  18. lvca commented on May 22, 2023

    @lvca
    Member

    Thanks @robfrank we can close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions