Dgraph: Support ARM

Created on 21 Jun 2019  路  13Comments  路  Source: dgraph-io/dgraph

If it would I can dev on Raspberry Pi, PINEBOOK and possibly ARM server.

kinquestion

Most helpful comment

Actually, I was able to reproduce this issue. It turns out the culprit is the gRPC library. When trying to set the max message size, the compiler fails because it's expecting an int (8 bytes in a 32-bit architecture) but our max message size is 4GB, which overflows the max value of an int.

This is the case for the 386 and arm architectures. arm64 is working. I talked to other folks and we don't officially support 32-bit architectures in dgraph. Since the issue is hard to fix because it's embedded in one of our core libraries, there's no easy workaround.

So I'm closing this issue for now. To summarize, we support the ARM architecture, but only in 64 bits.

All 13 comments

You can build ARM binaries for Dgraph using GOARCH=arm64 go build. Is there something more you're looking for in terms of ARM support?

I couldn't in a last year. I'll try it out!

By the way, @pawanrawal mentioned like this:
https://github.com/dgraph-io/dgraph/issues/2040#issuecomment-359605484

I checked and yes ARM is not supported for now because of some assembly code that we use within Dgraph. Unfortunately, getting Dgraph to work on ARM is not out the priority for now. Feel free to try out Dgraph on amd64 architectures.

Things have changed considerably since then. You might be able to compile Dgraph on ARM. Did you try?

Build from the source on macOS:

$ GOOS=linux GOARCH=arm64 go build -o dgrapharm main.go
$ ls
Makefile            dgrapharm*          main.go
cmd/                docker-compose.yml  minio.env
$ rsync dgrapharm [email protected]:bin/

On Raspberry Pi:

~/bin $ ls
cayley  dgrapharm  gnatsd  micro  t1  tinygo
~/bin $ dgrapharm version
-bash: /home/pi/bin/dgrapharm: cannot execute binary file: Exec format error

Quick install on Raspberry Pi directly:

$ curl https://get.dgraph.io -sSf | bash
$ dgraph
-bash: /usr/local/bin/dgraph: cannot execute binary file: Exec format error

All I did are failed.

Edit

Build from the source on Raspberry Pi:

~/go/src/github.com/dgraph-io/dgraph/dgraph $ GOARCH=arm64 go build main.go
~/go/src/github.com/dgraph-io/dgraph/dgraph $ ls
Makefile  cmd  docker-compose.yml  main  main.go  minio.env
~/go/src/github.com/dgraph-io/dgraph/dgraph $ ./main
-bash: ./main: cannot execute binary file: Exec format error

Also failed.

SORRY I realised that I'm using ARM 32 bit on my machine! 馃槀
I'll try on 64 bit.

@1l0, Any updates on this? Wondering whether you were able to build and run Dgraph.

Not at all since I have only ARM machines installed 32 bit that are daily drivers for me so it's hard to swap OSes for 64 bit easily.
I'd like reports too about running Dgraph on ARM.

@1l0 I think you can do GOARCH=arm go build to build Dgraph in 32-bit ARM architecture.

https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63#a-list-of-valid-goarch-values

Still no luck on Arm 32 bit.

 $ GOARCH=arm go build
# github.com/dgraph-io/dgraph/x
../x/x.go:522:26: constant 4294967296 overflows int
../x/x.go:523:26: constant 4294967296 overflows int

@1l0 Sorry for the late reply. What version are you using? (ideally share a commit timestamp so I can reference the exact lines in the error message). I remember fixing a similar bug that was causing the i386 build to break so I think that would fix other 32-bit archs as well. I would try master since I don't remember whether I added the fix to the release 1.0 branch.

Actually, I was able to reproduce this issue. It turns out the culprit is the gRPC library. When trying to set the max message size, the compiler fails because it's expecting an int (8 bytes in a 32-bit architecture) but our max message size is 4GB, which overflows the max value of an int.

This is the case for the 386 and arm architectures. arm64 is working. I talked to other folks and we don't officially support 32-bit architectures in dgraph. Since the issue is hard to fix because it's embedded in one of our core libraries, there's no easy workaround.

So I'm closing this issue for now. To summarize, we support the ARM architecture, but only in 64 bits.

Sorry to revive this thread, but would you guys consider releasing an ARM64 Docker image, too then? I made a stab at this over at https://gitlab.com/Tiemen/dgraph-aarch64

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichelDiz picture MichelDiz  路  3Comments

jeffkhull picture jeffkhull  路  3Comments

KadoBOT picture KadoBOT  路  5Comments

andrewsmedina picture andrewsmedina  路  4Comments

yupengfei picture yupengfei  路  4Comments