8000 Create an ARM build to support running Cockroach on an m1-powered Mac · Issue #68648 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Create an ARM build to support running Cockroach on an m1-powered Mac #68648

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

Closed
jhatcher9999 opened this issue Aug 10, 2021 · 23 comments
Closed
Assignees
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf

Comments

@jhatcher9999
Copy link
Collaborator
jhatcher9999 commented Aug 10, 2021

Running the cockroach executable from a Mac with an m1 chip runs very poorly.

I'd like to see an ARM build that would support better performance on M1 chips.

Epic DEVINF-247

Jira issue: CRDB-9140

@jhatcher9999 jhatcher9999 added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 10, 2021
@blathers-crl blathers-crl bot added the T-server-and-security DB Server & Security label Aug 17, 2021
@knz knz added T-dev-inf A-build-system B-unsupported-arch Non-x86_64 architectures: PPC, MIPS, etc and removed T-server-and-security DB Server & Security labels Aug 24, 2021
@knz
Copy link
Contributor
knz commented Aug 24, 2021

Possibly dup of #32689.

this is really for dev inf. cc @jlinder for triage.

@jlinder
Copy link
Collaborator
jlinder commented Oct 20, 2021

Let's keep these as separate. While on the surface they are both ARM64 architectures and much of the work we do for to improve support for one will directly help the other, they are for different OSes and are different custom chips so there are likely to be specific needs for each one. If we end up finding there is minimal difference, we can close one as duplicate then.

@ecordell
Copy link

I have built an arm image locally and pushed it here: https://quay.io/repository/ecordell/crdb

It's very painful to build locally, however: because the builder image is amd64-only, it runs in qemu on an m1 mac, which is very prone to segfaulting during the build. Since the builder image already supports outputting arm images, it would be great if there were an official release.

@rickystewart
Copy link
Collaborator

@jhatcher9999 Sorry, just clarifying: what is the actual feature request here? Is this asking for an official release for ARM Macs? If you just want a native Cockroach executable that will run on your own machine, you can build it yourself. The Bazel build works and supports M1 Macs.

If the request is for an official release, that's going to be a big investment. It'll probably happen at some point but I'm not sure it's planned for the next release.

@jhatcher9999
Copy link
Collaborator Author
jhatcher9999 commented Dec 1, 2021

Hey Ricky -- I work for Cockroach, and I'm just passing this on as feedback from various customers. I have some customers who are wanting to run CRDB (for development purposes) on their local m1-based MAC laptops so they want a build that is performant. I also have some customers who are wanting to use CRDB in their CI/CD pipelines and they have had issues running those in docker-based containers. And, a third case is folks that want to run their actual production CRDB clusters on EC2 instances and AWS is starting to push ARM-based servers.

So, I guess the feature request is to have a CRL-supported build that works well across those 3 scenarios.

@rickystewart
Copy link
Collaborator

OK. The third case is a dup of #32689 (macOS vs. Linux, and indeed the bugs should be kept separate per James' comment). As for the first case, you can work around by building your own cockroach, which I understand is less convenient than just downloading a pre-built binary, but will work.

The second case isn't addressed until we have a cross-build (official release) for M1 Macs, which I think is what this bug will track.

@jhatcher9999
Copy link
Collaborator Author

Ricky, do we have instructions for doing your own Cockroach build that I could follow and/or share?

@rickystewart
Copy link
Collaborator

General instructions: https://wiki.crdb.io/wiki/spaces/CRDB/pages/73204103/Building+from+source+on+macOS

Bazel-specific instructions: https://wiki.crdb.io/wiki/spaces/CRDB/pages/2221703221/Developing+with+Bazel

I recommend building w/ Bazel if you're building from master, but if you're building from an older release (21.2 or earlier) you probably want to stick to make.

@christoofar
Copy link
christoofar commented Dec 13, 2021

Here. I made a version of v21.2.2 for ARM64 @rickystewart @jhatcher9999

It should run on an M1 Mac.

https://hub.docker.com/layers/christoofar/cockroachdb-arm64/21.2.2/images/sha256-f6d9acfffb1b1e3cb251b0c70ba1f629033612379d2adcd32a00111c1cb896a9?context=explore

I also made an all-in-one Dockerfile with all the superdeps, takes several hours to run on a Rock64 but it will yield the same bits: https://github.com/christoofar/cockroachdb-arm64

You can install DockerCE and fire it up in Docker Swarm or k8s and should work fine or just grab the ARM64 image from Docker Hub.

@julius-welink
Copy link

I have a multiarch cockroachdb docker image based on @christoofar work

https://hub.docker.com/r/juliuszaromskis/cockroachdb
https://github.com/julius-welink/cockroachdb-arm64

@hand-crdb
Copy link
Contributor

A customer reports in a Zendesk ticket (I can share details):

Hi, we're currently in the process adding support for apple silicon to the local development environments, so as part of this we need a aarch64 build of crdb. CL does not currently provide binary distributions of darwin/aarch64.

@natm
Copy link
natm commented Jul 9, 2022

Any progress with this?

@Amphaal
Copy link
Amphaal commented Jul 18, 2022

Rosetta often crashes unexpectedly while emulating the linux/amd64 docker image. Any official build for the linux/arm64/v8 blockchain would be greatly appreciated !

@rail
Copy link
Member
rail commented Oct 11, 2022

#89201 will add MacOS ARM64 platform to the release builds. There will be some extra work in #89754 to get the binaries signed and published.
22.2.0-beta.4 is expected to have the new platform live.

@rail
Copy link
Member
rail commented Oct 19, 2022

22.2.0-beta.4 is expected to have the new platform live.

Correction, beta 5 it is.

@Scalahansolo
Copy link

I see that beta 5 just got tagged. How would I ago about installed beta 5 for testing the MacOS ARM version?

@rail
Copy link
Member
rail commented Nov 1, 2022

The URLs will be published shortly on the website 🕺

@Scalahansolo
Copy link

I see that the binary got added to https://www.cockroachlabs.com/docs/releases/index.html?filters=mac. But there is only a column for intel binaries? Does that binary install the correct version, or is there a different URL for ARM version?

@rail
Copy link
Member
rail commented Nov 1, 2022

Waiting for cockroachdb/docs#15281 to merge :)

@rail
Copy link
Member
rail commented Nov 2, 2022

Let's call it done!
image

@rail rail closed this as completed Nov 2, 2022
@kenliu-crl
Copy link
Contributor

Link to download Apple M1/M2 build: https://www.cockroachlabs.com/docs/releases/index.html?filters=mac

@AndiDog
Copy link
AndiDog commented Nov 4, 2022

The homebrew recipe still needs to be adapted: https://github.com/cockroachdb/homebrew-tap/blob/master/Formula/cockroach.rb

@jlinder
Copy link
Collaborator
jlinder commented Nov 4, 2022

Hi @AndiDog, our homebrew tap always points to the latest stable version, which is still a v22.1.X release. Once we release v22.2.0, it will include the ARM64 version. Here is the PR if you'd like to follow along: cockroachdb/homebrew-tap#117.

5F60 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-dev-inf
Projects
None yet
Development

No branches or pull requests

0