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

Arm64 build support #9

Open
tgunsen opened this issue May 10, 2023 · 3 comments
Open

Arm64 build support #9

tgunsen opened this issue May 10, 2023 · 3 comments

Comments

@tgunsen
Copy link

tgunsen commented May 10, 2023

Hello,

Would it be possible to add support for arm64 builds? Currently the docker images are only available as amd64, which decreases the performance on Apple Silicon computers.

Thank you.

@RStaeber
Copy link
Member

Hello,
as there is no test environment for arm64 here, please feel free to join the project. Pull Requests/Contributions are welcomed.

@dotWee
Copy link
Contributor

dotWee commented May 15, 2023

I'm experiencing little to none performance issues running the published docker on my Apple Silicon machine.

If you still want to build the docker container with native arm64 arch, you can build the container yourself. The idp-server depends on eclipse-temurin:17.0.4.1_1-jre, which already supports arm64: https://hub.docker.com/layers/library/eclipse-temurin/17.0.4.1_1-jre/images/sha256-56ca01631ce976b22515ca927326db358af461ae02356e264e1e97dbd9f66115?context=explore

Docker will automatically use the arm64 version.

If more help regarding arm64 support is needed, I'll create a pull request with more details.

(running the idp-server locally outside a docker container is easier to debug tho)

@dotWee
Copy link
Contributor

dotWee commented Jun 8, 2023

Quick follow-up: To make maven compiling a additional image for arm64 is a two-liner configuration addition to idp-server's pom.xml: dotWee@7dbdb3e

I'd also suggest making use of GitHub's Action/Workflow tools for an automated docker image release to GitHub Packages and Docker Hub. Checkout this workflow template I've set up a few minutes ago: https://github.com/dotWee/ref-idp-server/blob/master/.github/workflows/maven.yml

Please also consider pushing the "official" docker image to GitHub Packages as alternative Docker Registry, in regards to Docker's latest controversy.

dotWee added a commit to dotWee/ref-idp-server that referenced this issue Jul 6, 2023
This commit updates the the mysql docker image tag to 8.0.29.

Updating mysql to 8.0.29 and its corresponding docker tag (`mysql:8.0.29`) improves the support for developing and running on arm64 architectures and Apple Silicon machines.

Related: gematik#9

## Explanation:
 
Currently, the used docker image for mysql (`mysql:8.0.22`) is published only for architecture `linux/amd64` and has be used with Apple's Rosetta compatibility layer enabled.

`mysql:8.0.29` is the first **stable** version also targeting arm64.

### References:

- Docker Hub entry for 8.0.22: https://hub.docker.com/layers/library/mysql/8.0.22/images/sha256-7d83f4d89c92d7e72b366cc9d0f5c19b12cba934c5e135d21d81b2b84651df69?context=explore
- Docker Hub entry for 8.0.29: https://hub.docker.com/layers/library/mysql/8.0.29/images/sha256-12cf01a51f803d0ad49ee0dbbb3025a6eef3341e24757c2ed8150b6654c3fb07?context=explore

### Disclaimer:

A quick review of mysql's version changelog shows no compatibility issues.
All unit tests finished without any issues.

### Workaround:

Add the `platform` property to the docker service to trigger Rosetta 2 on Apple Silicon:

```yaml
services:
  # Database
  db:
    image: mysql:8.0.29
    container_name: idp-mysql
    <<: [*service-network-ref, *service-setup-ref]
    environment:
      MYSQL_ROOT_USER: root
      MYSQL_ROOT_PASSWORD: idp
      MYSQL_DATABASE: IDP
      <<: *environment-timezone-ref
    ports:
      - "8572:3306"
    volumes:
      - idp-data-db:/var/lib/mysql
    healthcheck:
      test: "/usr/bin/mysql --user=root --password=idp --execute \"SHOW DATABASES;\""
      interval: 20s
      timeout: 20s
      retries: 10
    # in case of development on Apple Silicon to trigger Rosetta 2
    platform: linux/amd64
```
RStaeber pushed a commit that referenced this issue Jul 7, 2023
This commit updates the the mysql docker image tag to 8.0.29.

Updating mysql to 8.0.29 and its corresponding docker tag (`mysql:8.0.29`) improves the support for developing and running on arm64 architectures and Apple Silicon machines.

Related: #9

## Explanation:
 
Currently, the used docker image for mysql (`mysql:8.0.22`) is published only for architecture `linux/amd64` and has be used with Apple's Rosetta compatibility layer enabled.

`mysql:8.0.29` is the first **stable** version also targeting arm64.

### References:

- Docker Hub entry for 8.0.22: https://hub.docker.com/layers/library/mysql/8.0.22/images/sha256-7d83f4d89c92d7e72b366cc9d0f5c19b12cba934c5e135d21d81b2b84651df69?context=explore
- Docker Hub entry for 8.0.29: https://hub.docker.com/layers/library/mysql/8.0.29/images/sha256-12cf01a51f803d0ad49ee0dbbb3025a6eef3341e24757c2ed8150b6654c3fb07?context=explore

### Disclaimer:

A quick review of mysql's version changelog shows no compatibility issues.
All unit tests finished without any issues.

### Workaround:

Add the `platform` property to the docker service to trigger Rosetta 2 on Apple Silicon:

```yaml
services:
  # Database
  db:
    image: mysql:8.0.29
    container_name: idp-mysql
    <<: [*service-network-ref, *service-setup-ref]
    environment:
      MYSQL_ROOT_USER: root
      MYSQL_ROOT_PASSWORD: idp
      MYSQL_DATABASE: IDP
      <<: *environment-timezone-ref
    ports:
      - "8572:3306"
    volumes:
      - idp-data-db:/var/lib/mysql
    healthcheck:
      test: "/usr/bin/mysql --user=root --password=idp --execute \"SHOW DATABASES;\""
      interval: 20s
      timeout: 20s
      retries: 10
    # in case of development on Apple Silicon to trigger Rosetta 2
    platform: linux/amd64
```
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

No branches or pull requests

3 participants