self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Support ARM64

Open androidacy-user opened this issue 2 years ago • 52 comments

Self-Hosted Version

n/a

CPU Architecture

arm64

Docker Version

20.10.12

Docker Compose Version

1.29.2

Steps to Reproduce

  1. Try to run ./install.sh on a relatively fresh install of ubuntu 22.04
  2. Install fails

Expected Result

Install succeeds

Actual Result

Hits an error:

Step 4/5 : RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 2ae646b00261
exec /bin/sh: exec format error

Note we don't have an enhance-image.sh anywhere in the directory

androidacy-user avatar Jul 16 '22 14:07 androidacy-user

@ethanhs Can getsentry/sentry docker image run on a host with an arm64 cpu?

It may also help if to you try running ./install.sh again like this DEBUG=1 ./install.sh and paste the output in a gist.

aminvakil avatar Jul 16 '22 16:07 aminvakil

Can getsentry/sentry docker image run on a host with an arm64 cpu?

No I think on macOS it is getting run by Rosetta maybe? I'm a bit uncertain. Theoretically it is unlikely that any of its dependencies won't work on ARM, I will ask around to see how feasible it is to build native ARM images.

ethanhs avatar Jul 18 '22 23:07 ethanhs

We're not on MacOS but Ubuntu 22.04 running on GCP.

@aminvakil would that even help? I think it's pretty obvious, the image used to run that script isn't respecting the system architecture and as such failing to run as it defaults to amd64

androidacy-user avatar Jul 18 '22 23:07 androidacy-user

@androidacy-user What's the output of this command: docker info --format '{{.Architecture}}'?

aminvakil avatar Jul 19 '22 08:07 aminvakil

aarch64 as expected

androidacy-user avatar Jul 19 '22 12:07 androidacy-user

I'll try to reproduce and fix this later.

ethanhs avatar Jul 19 '22 17:07 ethanhs

Hm, unfortunately I think we will be stalled on this until we upgrade zookeeper, ref https://github.com/getsentry/self-hosted/issues/1292 as confluence's zookeeper image seems not to support ARM until the 7.x series.

ethanhs avatar Jul 19 '22 21:07 ethanhs

Hm, unfortunately I think we will be stalled on this until we upgrade zookeeper, ref #1292 as confluence's zookeeper image seems not to support ARM until the 7.x series.

Can I replace zookeeper to some arm64 version? such as watershine

licstar avatar Jul 20 '22 10:07 licstar

We use a rather old version of zookeeper, I'm not sure if it would be safe to upgrade but I'm looking into it.

ethanhs avatar Jul 20 '22 17:07 ethanhs

I successfully run sentry on an ARM server, using this third-party version: https://github.com/Sentry-ARM/onpremise

licstar avatar Jul 30 '22 07:07 licstar

Note that we don't support third-party repos for deployment. I do want to add aarch64 for Linux at some point, but there are several changes we'd need to make to see that happen.

ethanhs avatar Aug 01 '22 16:08 ethanhs

We have also run into ARM issues while running the ./install.sh script. Apparently the getsentry/relay docker image is not built for ARM, only for AMD. We opened a separate issue for this: #1642

nickjmv avatar Aug 10 '22 07:08 nickjmv

I think I have code to build an arm64 build of Sentry in https://github.com/getsentry/sentry/pull/38180

armenzg avatar Aug 26 '22 20:08 armenzg

Hello,

we are facing the same issue on aws graviton (aarch64) while running ./install.sh seems, that the current sentry-image doesn't provide the platform aarch64

#7 [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 0.490 exec /bin/sh: exec format error
#7 ERROR: executor failed running [/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi]: exit code: 1
------
 > [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi:
#7 0.490 exec /bin/sh: exec format error
------
failed to solve: executor failed running [/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi]: exit code: 1
Error in build-docker-images.sh:6.
'$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web' exited with status 17
-> ./install.sh:main:30
--> build-docker-images.sh:source:6

checkolala avatar Sep 20 '22 19:09 checkolala

Getting the following error trying to build on my M1 Mac

container for service "zookeeper" is unhealthy
Error in bootstrap-snuba.sh:3.
'$dcr snuba-api bootstrap --no-migrate --force' exited with status 1
-> ./install.sh:main:33
--> bootstrap-snuba.sh:source:3

Cleaning up...

johnsturgeon avatar Oct 04 '22 21:10 johnsturgeon

@johnsturgeon I believe that is an inconsistent issue that only happens some of the time, if you try again does it happen?

ethanhs avatar Oct 04 '22 23:10 ethanhs

I tried again, and it did happen again.

I got around it by just doing a docker compose up that fired up quite a few containers... then docker compose down then redid the install.sh

johnsturgeon avatar Oct 05 '22 00:10 johnsturgeon

The only problem I have now is whenever I start the stack the nginx container usually does not start, so I have to stop it / and the web container and restart them. That usually gets it going

johnsturgeon avatar Oct 05 '22 00:10 johnsturgeon

image This is the normal state after I start the stack

johnsturgeon avatar Oct 05 '22 00:10 johnsturgeon

note: Maybe M1 Max vs M1 Pro is causing issues with compatibility

I have to comment out this for self-hosted to work on M1 Max in docker-compose.yml while Chad and Ethan do not.

platform: ${DOCKER_PLATFORM:-} 

hubertdeng123 avatar Oct 17 '22 20:10 hubertdeng123

any update?

naiba avatar Feb 23 '23 03:02 naiba

Any update?

abersheeran avatar Mar 16 '23 12:03 abersheeran

Ping pong pang. Running into the same issue, anyone got a workaround?

kdckrs avatar Mar 27 '23 06:03 kdckrs

As of now, we have no update here as we don't have the bandwidth to tackle this issue 😔. If you'd like to look into this on your own, we do accept PR's

hubertdeng123 avatar Mar 27 '23 16:03 hubertdeng123

Same issue:

#6 [2/4] COPY . /usr/src/sentry
#6 CACHED

#7 [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 0.333 exec /bin/sh: exec format error
#7 ERROR: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
------
 > [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi:
#7 0.333 exec /bin/sh: exec format error
------
failed to solve: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
+++ cleanup ERR
+++ local retcode=17
+++ local 'cmd=$dcb --force-rm web'
+++ [[ 0 -eq 1 ]]
+++ DID_CLEAN_UP=1
+++ [[ ERR != \E\X\I\T ]]
+++ set +o xtrace
Error in install/build-docker-images.sh:6.
'$dcb --force-rm web' exited with status 17
-> ./install.sh:main:29
--> install/build-docker-images.sh:source:6
# docker info --format '{{.Architecture}}'
aarch64

Still only linux/amd64:

SENTRY_IMAGE=getsentry/sentry:nightly
SNUBA_IMAGE=getsentry/snuba:nightly
RELAY_IMAGE=getsentry/relay:nightly
SYMBOLICATOR_IMAGE=getsentry/symbolicator:nightly

nohnaimer avatar Apr 28 '23 10:04 nohnaimer

Having the same issues with Ampere (ARM64) hosting, bash syntax error

mmospanenko avatar Apr 28 '23 23:04 mmospanenko

Do we have a workaround for this ? I am using Ampere (Oracle-ARM64) but always getting the error related to bash

trinhhuyit avatar Jun 06 '23 04:06 trinhhuyit

Made some research and it seems to be snuba does not have support for the arm builds yet. However meanwhile we can try use these images to go around.

NikoGrano avatar Aug 15 '23 01:08 NikoGrano

This method is working for me!

Realybig avatar Aug 28 '23 08:08 Realybig

This method is working for me!

How did you try ? Is it working with some service like amphere ?

trinhhuyit avatar Aug 28 '23 10:08 trinhhuyit