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

[FEATURE] Add arm support (e.g. for new Apple M1 processors) for Docker image #2891

Open
spoonerWeb opened this issue Mar 8, 2021 · 8 comments · May be fixed by #3501
Open

[FEATURE] Add arm support (e.g. for new Apple M1 processors) for Docker image #2891

spoonerWeb opened this issue Mar 8, 2021 · 8 comments · May be fixed by #3501
Labels
help wanted Priority: Low Used by Solr-Core team to prioritize (Pull-Requests are welcome)

Comments

@spoonerWeb
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently it's not possible to run the docker container (e.g. using ddev)

Describe the solution you'd like
Support for arm architecture

Additional context
Using typo3solr/solr image in ddev context.

docker-compose.solr.yaml

version: '3.6'
services:
  solr:
    container_name: ddev-${DDEV_SITENAME}-solr
    image: typo3solr/ext-solr:11.0.3
    restart: "no"
    expose:
      - 8983
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.approot: $DDEV_APPROOT
    environment:
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - HTTP_EXPOSE=8983
    volumes:
      - "./solr:/opt/solr/server/solr"
  web:
    links:
      - solr

Error when starting on M1 processor:

Starting Solr 
OpenJDK 64-Bit Server VM warning: Failed to reserve shared memory. (error = 1)
OpenJDK 64-Bit Server VM warning: Failed to reserve shared memory. (error = 1)
OpenJDK 64-Bit Server VM warning: Failed to reserve shared memory. (error = 1)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000004017d4a4e0, pid=23, tid=122
#
# JRE version: OpenJDK Runtime Environment 18.9 (11.0.8+10) (build 11.0.8+10)
# Java VM: OpenJDK 64-Bit Server VM 18.9 (11.0.8+10, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# J 97 c1 java.lang.String.isEmpty()Z [email protected] (14 bytes) @ 0x0000004017d4a4e0 [0x0000004017d4a4c0+0x0000000000000020]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid23.log
Compiled method (c1)    2957   97       3       java.lang.String::isEmpty (14 bytes)
 total in heap  [0x0000004017d4a310,0x0000004017d4a688] = 888
 relocation     [0x0000004017d4a488,0x0000004017d4a4b8] = 48
 main code      [0x0000004017d4a4c0,0x0000004017d4a5e0] = 288
 stub code      [0x0000004017d4a5e0,0x0000004017d4a610] = 48
 metadata       [0x0000004017d4a610,0x0000004017d4a618] = 8
 scopes data    [0x0000004017d4a618,0x0000004017d4a630] = 24
 scopes pcs     [0x0000004017d4a630,0x0000004017d4a670] = 64
 dependencies   [0x0000004017d4a670,0x0000004017d4a678] = 8
 nul chk table  [0x0000004017d4a678,0x0000004017d4a688] = 16
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
qemu: uncaught target signal 6 (Aborted) - core dumped

Target versions
v10 and v11

@dkd-kaehm
Copy link
Collaborator

@spoonerWeb
Thanks for reporting.
We must check how to add platforms on docker hub.

But currently you can build the image locally, just refer to following snipped:

https://github.com/TYPO3-Solr/solr-ddev-site/blob/dd776dad79d3ca405652124bb91e5b5d1fd732be/.ddev/docker-compose.solr.yaml#L5-L8

version: '3.6'

services:
  solr-site:
    build:
      context:
        ../packages/ext-solr/
      dockerfile: Docker/SolrServer/Dockerfile

Note: EXT:solr or contents of EXT:Solr/Resources/Private/Solr must present before ddev start command is executed.

@spoonerWeb
Copy link
Contributor Author

Thanks, this solution works for now.

@schliesser
Copy link
Contributor

Building the image locally during ddev start solved the issue also for me on M1.

Had always HTTP ERROR 404 javax.servlet.UnavailableException: Error processing the request. CoreContainer is either not initialized or shutting down. errors with the image typo3solr/ext-solr:11.0.3.

As we run composer commands inside ddev and therefore the solr ext may not available, I've copied the necessary files of the extension to .ddev/solr-build to provide a clean and easy boot:
image

@dkd-kaehm dkd-kaehm added the Priority: Low Used by Solr-Core team to prioritize (Pull-Requests are welcome) label Nov 27, 2021
@baschny
Copy link
Contributor

baschny commented Jan 20, 2022

@dkd-kaehm we started building cross-plattform images lately (using Github Actions also) so if you need some help, we could offer some help in that regard.

Starting from solr 7.x, the official solr images (which you use as a base) are already build for arm64/v8 (M1 compatible), so it would be pretty easy to have them build for you too.

I see you are building and testing the docker images via Github Actions already, but then upload the artefacts. How does this image end up in docker hub at the end?

Since you are using the pre-configured actions from buildx, refer to this example on how to "enhance" your build process to produce a multi-arch image (it has to be done in the same step, since the manifest must include both platforms before uploading them to docker-hub):

https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md

What you need to add is:

  1. the qemu action (in order to build for arm even on the amd64 platforms that Github Actions provides us). This can be slow if you need to compile stuff, but since you are just copying files, it should be enough

  2. configure the additional platforms in the docker/build-push-action action.

@dkd-kaehm
Copy link
Collaborator

@dkd-kaehm we started building cross-plattform images lately (using Github Actions also) so if you need some help, we could offer some help in that regard.

Starting from solr 7.x, the official solr images (which you use as a base) are already build for arm64/v8 (M1 compatible), so it would be pretty easy to have them build for you too.

I see you are building and testing the docker images via Github Actions already, but then upload the artefacts. How does this image end up in docker hub at the end?

Since you are using the pre-configured actions from buildx, refer to this example on how to "enhance" your build process to produce a multi-arch image (it has to be done in the same step, since the manifest must include both platforms before uploading them to docker-hub):

https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md

What you need to add is:

1. the qemu action (in order to build for arm even on the amd64 platforms that Github Actions provides us). This can be slow if you need to compile stuff, but since you are just copying files, it should be enough

2. configure the additional platforms in the `docker/build-push-action` action.

@baschny
Thanks for advice,
currently the GitHub-Actions and Docker Hub builds are not related/connected with each other, we are using the Automated Builds of Docker Hub, see https://docs.docker.com/docker-hub/builds/ and docker/roadmap#109.

To provide the ARM images we must switch to the actions, which is currently unfavorable, because it is still possible to build the images locally, but in the future we'll of course do that.

@DenisMir
Copy link

DenisMir commented Feb 1, 2023

Any progress on this topic?

@dkd-kaehm
Copy link
Collaborator

Any progress on this topic?

Currently no plans to switch to other docker build stack. All our power is now on TYPO3 12 compatibility and maintaining the supported versions.
If somebody did the builds of docker images via GH-Actions already, please let us know and integrate the new build stack together.
Of course the pull-reqeuests with POCs for that task and other are welcome.

sjorek added a commit to sjorek/ext-solr that referenced this issue Feb 19, 2023
…rs) to docker-image

This PR also updates all required actions in .github/workflow/ci.yml and adds a new
publish-docker-hub job to the pipeline.

Fixes: TYPO3-Solr#2891
sjorek added a commit to sjorek/ext-solr that referenced this issue Feb 19, 2023
…rs) to docker-image

This PR also updates all required actions in .github/workflow/ci.yml and adds a new
publish-docker-hub job to the pipeline.

Fixes: TYPO3-Solr#2891
@sjorek
Copy link

sjorek commented Feb 19, 2023

… Of course the pull-reqeuests with POCs for that task and other are welcome.

Here you are: #3501. It still lacks a POC, but it's a first step.

sjorek added a commit to sjorek/ext-solr that referenced this issue Mar 25, 2023
…rs) to docker-image

This PR also updates all required actions in .github/workflow/ci.yml and adds a new
publish-docker-hub job to the pipeline.

Fixes: TYPO3-Solr#2891
dkd-kaehm pushed a commit to dkd-kaehm/ext-solr that referenced this issue Oct 17, 2023
…rs) to docker-image

This PR also updates all required actions in .github/workflow/ci.yml and adds a new
publish-docker-hub job to the pipeline.

Fixes: TYPO3-Solr#2891
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Priority: Low Used by Solr-Core team to prioritize (Pull-Requests are welcome)
Projects
None yet
6 participants