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

Apple M1 (arm64) Support #719

Closed
dudymas opened this issue Jun 27, 2021 · 7 comments · Fixed by #837
Closed

Apple M1 (arm64) Support #719

dudymas opened this issue Jun 27, 2021 · 7 comments · Fixed by #837

Comments

@dudymas
Copy link

dudymas commented Jun 27, 2021

See #719 (comment)

per https://www.docker.com/blog/multi-platform-docker-builds/ , let's get geodesic on arm

This would allow apple silicon/m1 chipsets to run geodesic without emulation!

Slack Community

Describe the Feature

Using multi-stage dockerfile features, introduce an arm build mode.

Use Case

I have an m1 mac, and atm qemu struggles with several bugs on non-arm64 dockerfiles

Describe Ideal Solution

Most tools should still be supported. There may be some that will have to wait while other folks update libraries or replace deprecated dependencies (i.e. terraform's hashicorp/template is archived and deprecated, and thus doesn't support darwin_arm64. It should be replaces with newer terraform templating providers.)

Alternatives Considered

Running with qemu emulation hasn't worked. And many of the hacks people provide require substituting a stable qemu environment for an unstable and rather experimental one. I've found it to be even buggier, slower, and very inefficient.

Additional Context

It's not expected to be a 100% solution, but if at least atmos is working, a lot of the rest of the tooling can follow soon!

@Nuru
Copy link
Sponsor Contributor

Nuru commented Jul 8, 2021

@dudymas I understand the need, but simply compiling the Dockerfile for M1 will not be sufficient. Geodesic bundles dozens (hundreds?) of executable binaries and we would have to have M1 versions of all of them available to install. Plus we would need to build (compile and link) Python3 for M1, and right now we would have to do that with qemu, so if qemu is having problems, it likely won't work.

I will leave this feature request open, but expect it will be more than a year before a sufficient infrastructure is in place to enable Geodesic to be delivered for arm64.

@Nuru Nuru changed the title Arm platform support Apple M1 support Aug 20, 2021
@Nuru Nuru pinned this issue Aug 20, 2021
@osterman
Copy link
Member

osterman commented Jan 5, 2022

Apple M1 Support

We've confirmed that Geodesic works on recent versions of OSX on the M1 running as amd64 (not arm64). Docker auto-detects this by default, but otherwise, it’s possible to pass --platform linux/amd64 to docker to force the platform.

@osterman osterman changed the title Apple M1 support Apple M1 (arm64) Support Jan 21, 2022
@nitrocode
Copy link
Member

nitrocode commented Aug 25, 2022

FYI to set the --platform or any additional docker argument, use the following environment variable.

export GEODESIC_DOCKER_EXTRA_ARGS="--platform linux/amd64"

The poor performance of Geodesic on M1 is not specific to Geodesic, but rather a known issue with Docker for Mac. Things to try from @Nuru

  • Check (enable) Preferences -> General -> use gRPC FUSE for file sharing
  • Check (enable) Preferences -> Experimental Features -> Use the new Virtualization Framework
  • Use VMware Fusion to run a Debian VM, and run Geodesic from within the Debian VM

From @mcalhoun you can see improvements via

  • Check (enable) Preferences -> Experimental Features > Enable VirtioFS accelerated directory sharing

@PiotrPalkaSpotOn
Copy link

PiotrPalkaSpotOn commented Sep 28, 2022

Let me add my 2 cents to this discussion and share with you my PR with a Dockerfile that I managed to built on my Mac m1. Took me 2 evenings to figure things out and put it together so even if it looks more like a proof of concept it may be a good start for further development. It looks hacky but it works 😉

Happy to get your feedback how it can be improved.

@johncblandii
Copy link

I also needed to add DOCKER_BUILD_FLAGS to the Makefile, but ended up moving both out to my ~/.bash_profile so it supported other devices too.

export GEODESIC_DOCKER_EXTRA_ARGS="--platform linux/arm64"
export DOCKER_BUILD_FLAGS="--platform linux/arm64"

@PiotrPalkaSpotOn
Copy link

PiotrPalkaSpotOn commented Dec 22, 2022

Coming upon a realization that just building an arm64 geodesic image is not enough as the packages are still built for x86 architecture I was able to fix it (by providing ARCH env variable and an update to one package). I build the proper arm64 image and I can see the performance improvement is huge (about 30%). atmos terraform plan... execution that I use the most went down from 2m30s to 1m30s which is significant taking into consideration that I have tens of executions daily (happy to share more metrics if needed).

As I couldn't verify if all packages work properly I can't say it's a complete setup.

I'm also aware how big chunk of work it is on your side to support geodesic arm64 the right way. Since we're using geodesic debian-based as a base image for our custom container I can see the x86 packages are stored in Cloudsmith Debian repo with no arm64 equivalent so far. Also, not all maintainers are having arm64 packages in their Github Releases which makes things even more complicated. I've checked some packages and their x86 versions work in arm64 container. I can't say if it's efficient.

Anyway, knowing the load of work that has to be done I don't expect geodesic to officially support arm64 soon but it's worth to explore as more Macs with Apple Silicon processor gain developers' attention.

@Nuru
Copy link
Sponsor Contributor

Nuru commented Mar 24, 2023

arm64 support is included, starting with Geodesic version 2.0.0

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

Successfully merging a pull request may close this issue.

6 participants