chaoss / grimoirelab

GrimoireLab: platform for software development analytics and insights
https://chaoss.github.io/grimoirelab/
GNU General Public License v3.0
485 stars 181 forks source link

Mac M1 Docker problem #481

Closed diananova closed 11 months ago

diananova commented 2 years ago

When running sudo docker-compose up on my Mac (with M1 chip), I get this error:

runtime: failed to create new OS thread (have 2 already; errno=22)
fatal error: runtime.newosproc

As I understand, this is a problem related to M1 chip, is there any workaround for this issue?

I get this error only for Kibiter, everything else seems to be working.

Screenshot 2022-03-26 at 20 52 49
vchrombie commented 2 years ago

Hi @diananova, the GrimoireLab is built and tested on Linux-based systems. We cannot give much help since we cannot reproduce the problem in our local system.

It would also be helpful if you can post the logs (if available).

Quick google search around this topic gave me some results, which suggests to tweak the Dockerfile

It would be great if you can try the solutions and let us know what worked. Please let us know if you need any more help from us.

vchrombie commented 2 years ago

Cross posting this message from Slack

Sean: Make sure you are using Docker for Apple Silicon: https://docs.docker.com/desktop/mac/apple-silicon/

@diananova feel free to try this and please do let us know if there is any progress.

sharontao0420 commented 2 years ago

I have the same problem failing to run on my new Macbook with Apple M1 chip. I have tried the ways you mentioned but they don't work for me. Any update on this issue?

vchrombie commented 2 years ago

Hi @sharontao0420 Georg, one of our community members, has written a post on how to install GrimoireLab using docker-compose. He uses a Mac but I'm not sure he uses Mac with N M1 chip (prolly not).

We are a bit helpless because none of the GrimoireLab maintainers use Mac and it is really hard for us to reproduce the problem and try finding a solution. Moreover, I understand that this is the problem with docker and Mac, but GrimoireLab still works fine for the rest of the systems. I really don't know if we can help with this problem in any way. Thanks for understanding.

I would still keep this issue open, with a hope there would a solution to this.

diananova commented 2 years ago

Yeah using Docker for Apple Silicon doesn't solve the issue.

hogepodge commented 2 years ago

I'm guessing that the Kibiter docker image needs to be rebuilt for ARM. Digging into the Dockerfile, it uses an x86 Kibiter build.

hogepodge commented 2 years ago

Following up on this, I tried to make a docker build from the official Kibana fork. Unfortunately, this fork is two years out of date from the main branch, and the general build tools in this branch don't support ARM processors because of a number of linker errors. I'm wondering if Bitergia or anyone else has a roadmap for bringing these tools up to date, or if it's possible to run the rest of the toolchain (Mordred and enrichment) on more recent ELK stack versions.

loganknecht commented 1 year ago

Hello!

I would like to communicate that this is an issue for me as well. This is really unfortunate because this project seems very exciting!

EDIT I was able to get a working demo by using this command.

docker run -p 127.0.0.1:5601:5601 \
           -v ~/Desktop/test/config/projects.json:/projects.json \
           -v ~/Desktop/test/config/setup.cfg:/setup.cfg \
           -t grimoirelab/full
loganknecht commented 1 year ago

For anyone who needs to use an Apple M1 Docker setup, please try using these files to use opensearch

You won't have the default dashboards though when using open search. In order to import them you can follow the steps here

sduenas commented 11 months ago

Images should work now for M1. Feel free to open this ticket again if you find the same problem.

mhauru commented 5 months ago

When running docker compose up on my ARM Mac, the elasticsearch container fails with

elasticsearch-1      | [2024-04-25T10:37:39,214][INFO ][o.e.t.TransportService   ] [k_2zKtx] publish_address {172.21.0.2:9300}, bound_addresses {[::]:9300}
elasticsearch-1      | [2024-04-25T10:37:39,226][INFO ][o.e.b.BootstrapChecks    ] [k_2zKtx] bound or publishing to a non-loopback address, enforcing bootstrap checks
elasticsearch-1      | ERROR: [1] bootstrap checks failed
elasticsearch-1      | [1]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
elasticsearch-1      | [2024-04-25T10:37:39,233][INFO ][o.e.n.Node               ] [k_2zKtx] stopping ...
elasticsearch-1      | [2024-04-25T10:37:39,373][INFO ][o.e.n.Node               ] [k_2zKtx] stopped
elasticsearch-1      | [2024-04-25T10:37:39,373][INFO ][o.e.n.Node               ] [k_2zKtx] closing ...
elasticsearch-1      | [2024-04-25T10:37:39,391][INFO ][o.e.n.Node               ] [k_2zKtx] closed
elasticsearch-1 exited with code 78

I don't really know what's going on there, but I suspect this is related to the fact that the elasticsearch 6.8.6 docker container is only available for amd64 and on arm gets run through Docker's emulation thingie. (Even if that's not the cause of the fail, the emulation is sure to a significant cause a performance hit.)

Elasticsearch v7 images are available on Docker Hub for arm64 as well, so upgrading to v7 would solve this. Don't know how disruptive that would be for GrimoireLab.

I haven't tried the opensearch containers as a workaround. If that's the recommended way to run on ARM, that would be good to have in the documentation.

sduenas commented 5 months ago

Yes, ElasticSearch docker images don't have images for ARM. You can use OpenSearch or ElasticSearch 7. However, you will have to upload the dashboards manually, which is not great. I still think you should use them, though.

mhauru commented 5 months ago

Any plans to upgrade to ElasticSearch 7, or 8, in general?

If I find a time I might submit a PR for docs to mention this for ARM users.

SamuZad commented 2 weeks ago

If anyone comes across this issue in the future.. Rather than using the mac-specific docker compose file (which does not include dashboards, per the documentation), follow these steps:

  1. in your terminal going to run docker compose, set export DOCKER_DEFAULT_PLATFORM=linux/amd64
  2. in the docker-compose file, make sure to add -Ebootstrap.system_call_filter=falseto the command, such that:
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.8.6
      command: elasticsearch -Enetwork.bind_host=0.0.0.0 -Ehttp.max_content_length=2000mb -Ebootstrap.system_call_filter=false
      ports:
        - 9200:9200
      environment:
        - ES_JAVA_OPTS=-Xms2g -Xmx2g
        - ANONYMOUS_USER=true
  3. run docker compose up 🙂

This way you will have an instance with dashboards initialized by default on a Mac!