Apple M1, Docker arm64 emulation

Where do I specify --platform linux/arm64 in the ./launcher rebuild app sequence?

I need to test Discourse/Docker locally on M1.

Would be great to set this until such point as ARM build is fully implemented.

best regards,
Walker

1 Like

Discourse doesn’t work on arm64 at the moment, so there is no switch in launcher for it.

We are actively working on it, and we have quite a few members of our team running it on M1 already, but it still requires a branch of libv8, which is a transitive dependency coming from miniracer.

8 Likes

Thanks Rafael.

You all rock.

best,
Walker

4 Likes

You could try the docker args param launcher has, it may work

5 Likes

How’s it looking in dev performance wise?

4 Likes

Incredible performance for single core Rails work, like Topic Create or Topic view. Still a lot slower than any recent x86_64 offering in multicore or anything that touches disk IO.

8 Likes

I see. Thanks for this info. I think the software support for M1 will take some time to get right but future is looking bright.

It sounds notorious but it makes me a little happy that my recently bought device isn’t obsolete all of a sudden. :wink:

4 Likes

If that doesn’t work, you can use the DOCKER_DEFAULT_PLATFORM environment variable. I currently have:

export DOCKER_DEFAULT_PLATFORM=linux/amd64

in my zsh profile. When using Docker I pretty much always want the architecture to match production systems.

Compared to previous generation MacBooks it’s a big improvement, even though the filesystem performance issues still exist. A high-end linux desktop is still going to beat it though.

For example, I can run bin/turbo_rspec on core in about 2m50s (M1 Macbook pro, with Discourse, Redis & Postgres running natively). Team members on high-end linux desktops can do that in about 1 minute.

12 Likes

whats the roadmap for this to be enabled as stable?

We need a new mini racer / v8 gem to be released, no eta yet, we are testing alpha versions at the moment

6 Likes

@sam and how are tests going? Im highly interested in M1-compatible version.

Its not that bad timing… there are people (developers) out there who dont even come close to this…

For development of Discourse on M1, you can find some info over on the Rails forum: Tips and tricks for developing Rails applications on Apple Silicon - rubyonrails-talk - Ruby on Rails Discussions. A few of us on the team are using this day-to-day, and it works.

I would not recommend trying to run a production Discourse server on M1 though.

8 Likes

if so, than why do not release it to GA?

I would not recommend trying to run a production Discourse server on M1 though.

Why not?

@david

Its absolutely lovely. I’m lost for words on how to thank you for this. Great job.

Also, is the M1 macbook air good enough for discourse dev?

4 Likes

I suppose so :slight_smile:

Its absolutely lovely. I’m lost for words on how to thank you for this. Great job.

I suppose spreading word about Discourse would be enough…

1 Like

I don’t follow… all of this is public, you can follow those instructions yourself and get things going.

Our production install instructions are intended for running on an AMD64 linux host. You might be able to get it running on other OS/architectures using the tips in this topic, but there are no guarantees.

Absolutely. I have the Pro, but we also have people using M1 MacBook Airs and Mac Minis. There seems to be very little performance difference between them in our development benchmarks.

6 Likes

where? in official public repo?

1 Like

In the article I linked:

6 Likes

We didn’t make any changes to Discourse that are in some private development branch, if that’s what you’re wondering. You can get Discourse to work on an M1 system by installing the ARM64 versions of dependencies we use, which is in the guide posted above by David.

7 Likes

We would all like the official repo to work with the new hardware right :wink: and not some code hidden in the closet.

2 Likes